|Pivotal Cloud Foundry® Elastic Runtime||
This article discusses a workaround to remove static IP addresses assigned to router VM(s). It is required by network admins to specify a router IP range for a load balancer. Some sample use cases are:
- Operator forgets to configure router IPs and wants to add them after installation.
- Operator wants to modify the router IPs range to comply with network changes.
Per Ops Manager's design, if an operator forgets to assign a static IP for a job (HA Proxy, Router) Ops Manager will choose an IP at the top of the range. If the user decides to change the static IP in the middle of the range , Ops Manager will display an error since an internal range has already been calculated and allocated.
To get around this problem the user must scale the job down to zero, assign the new static IP, and redeploy. While this will work for most jobs, Elastic Runtime has a constraint that the Router job has to have more than zero instances.
Here is the procedure to scale the Router job down to zero to remove allocated static IPs and then assign new IPs.
- Go to Ops Manager GUI to record Elastic Runtime build number
- SSH into Ops Manager VM using default user and go to directory /var/tempest/workspaces/default/metadata
- Check the files inside to find out the correct metadata file referred to Elastic Runtime installed from step 1.
- Backup the metadata file to a different folder. Otherwise, Ops Manager will have errors when reloading from GUI if unknown files are at this directory.
- Perform `sudo vi` to update the file, find out the minimum constraints of the router job and set it to zero
- Save the changes
- Go to Ops Manager GUI to set Router instance to `0` and click Save button
- Disable all related Errands and then apply changes
- Wait for Apply Changes to complete successfully. This means that there are no longer any static IPs assigned to the gorouter job
- Go into Ops Manager -> ER -> IPs and Ports, to set the new static IPs for the gorouter. The number of IPs should match the count of router instances
- Go to the Ops Manager -> ER -> Resource Config screen and bump up the router count to match the number of IP addresses assigned
- Apply Changes, which pushes out the new IP addresses and creates the new router instances
Use Elastic Runtime version 1.6.20-build.1
ubuntu@pivotal-ops-manager:/var/tempest/workspaces/default/metadata$ sudo find . -name "*.yml" -print | sudo xargs grep "1.6.20"
edit the matched yml file and search the keyword `name: router` to find its job metadata and scroll down to find correct instance_definitions
set constraints -> min value from 1 to 0
- name: instances
We do not support any changes in the metadata other than that is specifically listed in this KB.
Note that the operation would have downtime as Elastic Runtime can not work without Router. Also, all the errands should be disabled to avoid time wasting to wait those failed.
Contact Pivotal Support if you have questions and need assistance.