1

If I have an instance group with 10 machines and I resize the instance group to 9 machines. What determines which instance will go down? Is it FIFO, LIFO, RANDOM? Is it possible to configure this behaviour?

Grzenio
  • 35,875
  • 47
  • 158
  • 240
user3325789
  • 393
  • 1
  • 12

1 Answers1

1

Instance Group Manager, when resized, arbitrarily chooses VMs that will get deleted first. It takes in considerations aspects like:

  • Status of provisioning, as its better to delete not yet ready/serving VM
  • Health of the VM, as its better to delete not healthy VM rather then serving one
  • Version (instance-template) the VM is based on, to prefer converging to desired configuration of target versions.

Additional aspects and their relative priority can be subject to change with additional features added for Managed Instance Groups

KarthickN
  • 409
  • 2
  • 8
  • What are the additional features you're referring to. Is there documentation for these features? – user3325789 Apr 09 '18 at 16:31
  • There is an internal request to improve the [documentation](https://www.google.com/url?q=https://cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/resize&sa=D&source=hangouts&ust=1523721746739000&usg=AFQjCNFnOnHNjIf_h4G2QT3frmb2VrAIMg). You won’t be able to know the additional features that might be implemented in the future. However if you need strict order, you can always use explicit [IGM.deleteinstances API](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroupManagers/deleteInstances). – KarthickN Apr 13 '18 at 16:23
  • 1
    We currently have an internal feature request to implement Stateful Policy on MIG, which will let you specify which resources should be preserved upon autohealing, update and scaling. – KarthickN Apr 13 '18 at 16:27