0
votes

I have an instance group with the following settings: (auto-scaling:off, number_of_instances:2, zone:europe-west1-b). I have reserved two static IP's and attached them to group instances. As per to the documentation listed in https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address static IP's should persist with the instance that was attached to in case the instance stopped/restarted, but i can't see any of that working. The moment i test to stop and restart one of the group instances, the external IP's got detached from the instances, assigning them other ephermal ones. Should it behave like this? Am i doing anything wrong?

1

1 Answers

0
votes

Like the document you linked points out, the static IP should stay assigned to the instance as long as it is not deleted. Static IPs are meant to persist even if you stop the instance.

Just make sure that the instance is, in fact, being stopped and not recreated by the instance group controller (ie your instance keeps the same name and ID). You can check your operations (Compute Engine > Operations) to make sure the instance is in fact only stopping and no other operations are happening behind the scenes.

If you are using a Managed Instance Group, stopping an instance might lead to the Instance Group Controller to create a new instance to meet the requirement of 2 instances. Since you are not using the Auto-scaler and want to be able to manage instances yourself, you may want to use an unmanaged instance group.