0

For some reason my instance group VM's keep getting reset back to the original image. i.e after I've installed and configured software everything gets whiped out. Additionally, in some occasions their IP's also change so I have to go and edit my Cloud SQl instance to allow network connections. Anyone seen this behavior before?

Grzenio
  • 35,875
  • 47
  • 158
  • 240
  • 1
    Is this a managed instance group (MIG)? Could it be that some instances are failing health checks causing them to be deleted and then replacement instances are launched? The recreated instance uses the same name and the same instance template as the previous instance. – jarmod Nov 02 '16 at 16:58

1 Answers1

0

It sounds like you're using Managed Instance Groups, which are designed to work with stateless workloads. MIGs will scale their size up and down, if you have Autoscaler enabled, and scaling down will delete instances. The health checking feature can also destroy and recreate instances.

If you need extra software installed on MIG instances, you need to create a single VM the way you want, and then create a Snapshot of that VM's disk (and then an Image from the Snapshot). The Instance Template creates fresh instances from that Image file every time.

Even if you recreate your image the way you want with all software installed, MIGs will still create and destroy instances assuming there is nothing value on any of them. And yes, their IPs could change too, because new instances are being created.

Paul R. Nash
  • 328
  • 1
  • 6