Preserving Windows VMs with Managed Instance

So my team has been stumped quite a bit with this roadblock we're having.

Basically we have Windows VM with applications that utilize load balancer on a Managed Instance.

When we reboot the VMs, there's no issue, as the original VMs came back up.

The problem is when we shut down the VM, even using the 'stateful' configuration, it will force a new VM instance to be rebuilt instead of trying to start the original VM. This is causing issue since the application's configuration is now broken and requires manual intervention.

Is there anything that we can do to prevent this from happening?

Thanks in advance!

2 REPLIES 2

Shutting down an instance with Managed Instance Groups will trigger recreating it ( delete and then create with usually the same name) to preserve the size of the MIG (number of instances). This is also different from the autohealing feature which utilizes health-checks to detect if the instance is not serving, and then recreates it. Both cases are regardless of using Stateless or Stateful MIGs or even when using any other OS. Hence disabling Autohealing will not change the behavior explained in the first statement. 

If your use-case requires shutting down the instance, consider removing it from the group. Note that it seems counter-intuitive to the objectives of using such groups. As a matter of fact, attempting to stop an instance in the console that is part of a MIG is disabled by default (screenshot below). Here are also more cases on how operations affect statefulsets that might be helpful if you decide to keep the instance running. I hope this will point you in the right direction.

 

Screenshot 2021-07-02 4.44.30 PM.png

 

 

  

@iyudhi ,  as a supplement to @fadya 's clarification, please see this comparative analysis table between standalone VMs, unmanaged instance groups, and MIGs, specifically with regard to the ability to start-stop or suspend-resume VMs.