3

I have a problem with the ip of my instance group.

I have a managed instance group with (autoscaling enabled) on Google Compute Engine and I've setted a static IP on the 1st instance created. After a while (not a specific time) the IP changes and settings goes back to "Temporary ip".

There is a way to set static ip on a managed instance group and stay "safe" from ip change?

EDIT: Or there is a way to prevent the "delete" of the 1st instance created (the instance with the static IP)?

EDIT2: Think i can use a Load balancer setting manage group like backend, but i have a huge problem: I need to grab HTTP and RTMP requests, both from the same backend. I can't understand the correct configuration for this kind of things. Problem is that inside load balancer settings i can set only one backend service. I need to set the same backend service (the same instance group) for both http and rtmp requests :/

tidpe
  • 201
  • 3
  • 12
  • 1
    Are you sure it's the same instance? Do you have any auto-scaling to create and delete VMs to match current usage? That could explain why the static IP is no longer assigned to any VM. Why do you want one of the VMs in an instance group to have a static IP address in the first place? There may be a better way to achieve what you are trying to do. – kasperd Jun 10 '18 at 10:25
  • 1
    Yes, I have auto-scaling enabled. I want static IP because I need to connect that IP with a domain, to connect them to an app engine. – tidpe Jun 11 '18 at 07:35
  • No one knows how to solve this issue? :/ – tidpe Jun 21 '18 at 08:59
  • It's unclear what you are trying to achieve. Assigning static IP addresses to individual VMs in such a setup sounds flawed to me when the VMs are expected to be interchangeable and pretty much all the same. I think you need to edit the question to better explain what you are trying to achieve. – kasperd Jun 21 '18 at 14:59
  • I think there's a way to do it from the command line; at least, that's how I did it in the past. Many months later, I'm now trying to recreate the instance template from the GUI console, and it appears that the GUI doesn't support this feature. I think it's probably for the reasons in the other answer, but I wish they'd just let me use the power tool without the safety glasses. – interestedparty333 May 17 '19 at 16:22

1 Answers1

4

For a managed group with auto-scaling enabled you should design or retrofit your application so that it is independent of specific instance properties that will not persist such as IP address or in-memory data. This is due to the stateless nature of the managed group as described in this document.

In such case, new instances can be created and others recreated following the configured instance template. For example, once utilization ( can be other set metric) decreases it should destroy unused instances and recreates new instance with changed IP addresses. Instances within managed groups are intended to be dynamically re-created, they get created from the instance template. That being said, due to the stateless nature of the managed group with auto-scaling enabled, even though you create instances with static IP it gets change every time with the auto-scaling operation.

Md Zubayer
  • 205
  • 1
  • 4
  • Ok, i think i can use a Load balancer setting manage group like backend, but i have a huge problem: I need to grab HTTP and RTMP requests, both from the same backend. I don't know how to set correctly the load balancer, tried HTTP LB, RTMP can't work, tried TCP LB, nothing works! – tidpe Jan 07 '19 at 17:51