cloudbridge icon indicating copy to clipboard operation
cloudbridge copied to clipboard

Azure Image Create

Open almahmoud opened this issue 6 years ago • 1 comments

In order to create an image from an instance in Azure, the instance must be deprovisioned, which is done by running waagent deprovision after SSH-ing into the instance. We are currently using pysftp to ssh into the instance programmatically (given a private key filepath) in order to accomplish this. However, this assumes that 1) the instance was created with a key although it is an optional parameter and 2) that the instance is exposed to the outside world and has the SSH port open. I have looked for about 2 hours trying to find documentation on any other way to accomplish this, but I could not find any other way to deprovision the VM. I am not sure what to do about the first part given that a key will be necessary to ssh into the machine, but for the second part, I suggest we actually create then delete the rules exposing the necessary port as (I believe) duplicate rules are allowed thus if we make a large priority rule that temporarily overrides the rest to open the port for this purpose, then delete that rule, it should, in theory, not affect any other rules down the line. However, that (of course) presents some serious security problems, especially given that the firewall could be responsible for the connectivity of multiple VMs that we'd be inadvertently exposing (one way we could potentially avoid that, is detecting the current IP and only opening connections coming from that IP, although I am not sure if that will be as simple as it sounds).

Holding off on refactoring the image service until we implement the SubService/Containers logic as well, given that the create_image function sits in the Instance resource atm, and there is not generic create in the service.

almahmoud avatar Feb 11 '19 20:02 almahmoud

Hi my name is Aarushi Soni . I want to contribute to this issue . Is this issue still open ? I am first time contributor . Please guide me through this process.

aarushisoni avatar Sep 07 '22 12:09 aarushisoni