QualiSystems / Azure-Shell

:small_blue_diamond::shell: A CloudShell 'Shell' that allows integrating Azure as an app's deployment option. Why is this Open? :cloud::shell: CloudShell cloud providers come out of the box and cannot be extended or modified independently. However, feel free to take a look at our code to better understand how things work under the hood. If you like you can experiment with our sofware, but please make sure you contact us if you need new cloud providers that would be supported in your production CloudShell deployment!
Apache License 2.0
4 stars 6 forks source link

clean up stale data in Azure #423

Closed alexazarh closed 7 years ago

alexazarh commented 7 years ago

If the prepare connectivity fails than we can have stale subnets left in Azure and it will block us from creating new reservations.

Need to add a hidden command on the CP that will clean up the stale resource.

  1. The command will get form the CloudShell API the list of active reservations
  2. Find the Azure subnets that are not part of the any active reservation.
  3. Remove stale subnets. If subnet does have any connected devices that we can remove the subnet directly. If subnet has connected devices than we need to find the relevant resource group and first delete it before deleting the subnet.
  4. The operation must be atomic in such a way that it will block and prepare/cleanup connectivity operations.
anthony-poddubny commented 7 years ago

we should also take into account "Networks In Use" attribute and don't delete subnets, listed there

alexazarh commented 7 years ago
  1. This cleanup will be part of the prep conn operation
  2. We want to do a more specific cleanup and only fix the subnet that is taken at the moment. This is less destructive approach.
  3. Add an attribute on the CP that will control this behavior. Attribute name: TBD - @TomerAdmon