Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up VMs used to review Airlock requests #2507

Closed
Tracked by #2245
tanya-borisova opened this issue Aug 25, 2022 · 2 comments
Closed
Tracked by #2245

Clean up VMs used to review Airlock requests #2507

tanya-borisova opened this issue Aug 25, 2022 · 2 comments
Assignees

Comments

@tanya-borisova
Copy link
Contributor

tanya-borisova commented Aug 25, 2022

In order to review import and export Airlock requests, reviewers will create VMs in Review Workspace for import and Research Workspaces to be able to look at imported / exported data.
These VMs are relatively short lived, and can be cleaned up after the data review is complete.
Note: This proposal assumes no reuse of the VM between different requests.

A possible implementation would be to create a shared service, e.g. airlock-review-vm-cleanup, that would contain e.g. an Azure Function (using a Terraform data block, the Airlock processor Function App can be reused for this).
The function will be triggered by the Event Grid events from the topic , which would contain the request ID of the Airlock request that was either approved or rejected.

The function will then proceed to clean up the VMs that aren't needed.
There are two ways to do that:

  • A quicker but less clean way would be to just delete the VM that is tagged with a request ID (note: for this, when review VMs are created, they must be tagged with a request ID, possibly accepted as a bundle parameter in the user resource template). This should be possible to do from outside the Workspace, even though the VM is created within the Workspace network, because this is a Management Plane operation.
  • A nicer way would be to issue an API request to delete the VM. For this, an identity will need to be created that has permissions to do this.

See a simplified diagram below:

image

@tanya-borisova
Copy link
Contributor Author

Had a chat with @marrobi and we think that it would actually make more sense for the cleanup mechanism to be part of the API, as we are also planning to add an endpoint for creating the review VMs, too.

To find which VMs to clean up, we will need to query Cosmos for VMs that have the corresponding Airlock Request ID (as part of their properties, perhaps).

@tanya-borisova tanya-borisova self-assigned this Oct 17, 2022
@tanya-borisova
Copy link
Contributor Author

Resolved here: #2740

Repository owner moved this from Backlog to Done in AzureTRE - Crew Rock Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant