Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Running rolling-action command for compute engine instance-groups by gcloud doesn't work

I'm trying to replace VM instances in instance group with gcloud CLI tool. But it not actually working.This is the command I used to run rolling-action command. It is generated by equivalent command line in GCP console.

 

 

gcloud beta compute instance-groups managed rolling-action start-update $GROUP_NAME --project=$PROJECT_ID --type='proactive' --max-surge=1 --max-unavailable=1 --min-ready=30 --minimal-action='replace' --replacement-method='substitute' --version=template=$TEMPLATE --zone=$ZONE

 

 

The result says there is no action to do and it is actually doing nothing.

 

 

 

creationTimestamp: '2023-01-10T23:35:54.691-08:00'
currentActions:
  abandoning: 0
  creating: 0
  creatingWithoutRetries: 0
  deleting: 0
  none: 3
  recreating: 0
  refreshing: 0
  restarting: 0
  resuming: 0
  starting: 0
  stopping: 0
  suspending: 0
  verifying: 0

 

 

What is the problem with this? 

0 1 1,078
1 REPLY 1

Hello @hazel,

Welcome to Google Cloud Comumnity!

I can see that you are trying to use the Proactive method.

  • Automatic (proactive): Use this method if you want the MIG to automatically apply new configurations to all or to a subset of existing VMs in the group. The level of disruption to running VMs depends on the update policy that you configure. You can use this method to canary update new instance templates. To use this method, set the MIG's update type to "proactive".

To use proactive updates you only need to configure it once. After that, the MIG applies all future VM configuration changes (that is, changes to the group's all-instances configuration, instance template, and per-instance configurations) automatically to all VMs in the group based on the settings in the group's update policy.

To automatically apply configuration updates, use the gcloud CLI or the Compute Engine API.

gcloud beta compute instance-groups managed update INSTANCE_GROUP_NAME \
    --update-policy-type=proactive \
    --update-policy-max-unavailable=MAX_UNAVAILABLE \
    --update-policy-max-surge=MAX_SURGE \
    --update-policy-min-ready=MIN_READY \
    --update-policy-minimal-action=MINIMAL_ACTION \
    --update-policy-replacement-method=REPLACEMENT_METHOD

 On the other hand, if you want to recreate a VM in a MIG, see Re-create VMs in a MIG. But if you want to re-create ALL VMs in a MIG, start a rolling update instead.