OpenStack Juno Static IP Patch

There is a bug in OpenStack Juno which prevents BOSH from assigning static IPs. This can be quite an issue when trying to install Cloud Foundry on OpenStack.

There is a very simple fix:

Log into Controller Node

From the Mirantis Fuel Dashboard navigate to Nodes > Controller and click on the gear icon. The FQDN will list the server we will need to log into. For this example we will use

ssh into this server:

ssh node-100

Then assign all the environment variables by running:

source openrc

Now to find the list of compute nodes run:

nova service-list

An example of this output is (some columns removed for easier reading):

| Id | Binary           | Host                    | Status  |
| 1  | nova-consoleauth | | enabled |
| 2  | nova-scheduler   | | enabled |
| 3  | nova-conductor   | | enabled |
| 4  | nova-cert        | | enabled |
| 5  | nova-compute     | | enabled |
| 6  | nova-compute     | | enabled |
| 7  | nova-compute     | | enabled |
| 8  | nova-compute     | | enabled |
| 9  | nova-compute     | | enabled |

Fix the first compute node

In the output above the first compute node is node-105, ssh to this server

ssh node-105

Once on this server, open file

vi /usr/lib/python2.6/site-packages/nova/network/neutronv2/

Replace the line:

  port_req_body['port']['fixed_ips'] = [{'ip_address': fixed_ip}]


  port_req_body['port']['fixed_ips'] = [{'ip_address': str(fixed_ip)}]

Save the file and restart nova-compute:

service openstack-nova-compute restart

Fix the remaining compute nodes

Now you have a choice, you can repeat the previous section for the remaining compute nodes (node-106, node-107, node-108 and node-109) or leverage the first server we fixed, copy the file and restart nova-compute.

To leverage the first compute server’s patch get the list of remaining compute servers we need to patch.
When we ran nova service-list on the controller node there were 5 compute nodes listed, starting with node-105 and ending with node-109. We’ve already done node-105 so we still need to patch node-106 through node-109.

for i in {106..109}
   scp node-106:/usr/lib/python2.6/site-packages/nova/network/neutronv2/ node-$i:/usr/lib/python2.6/site-packages/nova/network/neutronv2/
   ssh node-$i service openstack-nova-compute restart

That’s it! Now you can deploy Cloud Foundry and use static IPs.

Spread the word

twitter icon facebook icon linkedin icon