Options to stop Apigee VM instances to reduce cost

Hi Guys,

We have stopped Apigee instances linked with the environment to reduce the Ops cost whenever not required. Still, 2 VM instances are running as part of the VM instance group even though the Apigee instance is down. 

Is there any way to stop the VM as well to reduce the Ops cost? As part of the auto-healing setup, the VM instances are recreated if we try to stop the VMs. Any suggestion would be appreciated. 

Thanks

Solved Solved
1 4 268
1 ACCEPTED SOLUTION

I am assuming the VMs you are referring to here are the Managed Instance Group(MIG) VMs in your project. The MIG dictates the scaling of the VMs, so deleting the VMs themselves will prompt the MIG to create new VMs until it has reached the desired size. Assuming the MIG is not set up with autoscaling, you can force the size of the MIG to 0 VMs using gcloud. When you want to turnup Apigee again, set the size back to more than 0:

gcloud compute instance-groups managed resize $YOUR_MIG_NAME --size=0

View solution in original post

4 REPLIES 4

I am assuming the VMs you are referring to here are the Managed Instance Group(MIG) VMs in your project. The MIG dictates the scaling of the VMs, so deleting the VMs themselves will prompt the MIG to create new VMs until it has reached the desired size. Assuming the MIG is not set up with autoscaling, you can force the size of the MIG to 0 VMs using gcloud. When you want to turnup Apigee again, set the size back to more than 0:

gcloud compute instance-groups managed resize $YOUR_MIG_NAME --size=0

Thanks mate. Let me turn off the auto scale and resize it. It sounds good to me. I will confirm after testing it out. 

Are these the "networking" VMs that used to be part of various documentation to haul traffic from the VPC to apigee? I have successfully deleted our VMs for that and replaced them with the "private service connect" configuration (https://cloud.google.com/apigee/docs/api-platform/system-administration/northbound-networking-psc)

Thanks emarcotte for the suggestion. Looks interesting to me. Let me explore this option as well. Hope, the charges will be applicable only when there is traffic.