Managed Instance Group - calling API is different from Console

 

I tried to change the min value of the group size of MIG to API.
In Console, the minimum size of the instance could be changed for both EVEN and BALANCED target distribution shape.
However, if the target distribution type is BALANCED, an error occurred when calling the API. Why is that?
 
[URL]
PATCH https://compute.googleapis.com/compute/v1/projects/{project}/regions/{regoin}/autoscalers?autoscaler={groupName}

[body]

 

{
  "autoscalingPolicy": {
    "minNumReplicas": 3
  }
}

 

 

[response]

 

{
  "error": {
    "code": 400,
    "message": "Invalid resource usage: 'Target shape not supported in autoscaled regional managed instance groups.'.",
    "errors": [{
      "message": "Invalid resource usage: 'Target shape not supported in autoscaled regional managed instance groups.'.",
      "domain": "global",
      "reason": "invalidResourceUsage"
    }]
  }
}

 

 
1 2 143
2 REPLIES 2

Hello @border1px,

Welcome to Google Cloud Community!

Based on the error message you posted, a target shape refers to the instance template's machine type, which determines the virtual machine's size and resources allocated to it. Autoscaling allows you to automatically adjust the number of instances in a MIG based on workload demands.

However, there are certain limitations on the target shape that you can use for autoscaling regional MIGs.

Can you also confirm if you disable the proactive instance redistribution already? If not, see this link to disable.

Thanks!

First of all, thank you for your reply.
 
1. I create in Google Cloud console for instance groups whose target type is BALANCED
2. Changing the number of instances or min/max of API call
3. response error.
{
  "error": {
    "code": 400,
    "message": "Invalid resource usage: 'Target shape not supported in autoscaled regional managed instance groups.'.",
    "errors": [{
      "message": "Invalid resource usage: 'Target shape not supported in autoscaled regional managed instance groups.'.",
      "domain": "global",
      "reason": "invalidResourceUsage"
    }]
  }
}