Thursday, November 13, 2014

NovaClient and Floating IP related errors

Error 1:
ERROR (NotFound): FloatingIpPoolNotFound: Floating ip pool not found. (HTTP 404)

root@puppet:/opt/python-script# nova floating-ip-create
ERROR (NotFound): FloatingIpPoolNotFound: Floating ip pool not found. (HTTP 404) (Request-ID: req-11559652-fb3d-40a2-b260-34a2af1eb9a6)

This error occur when the default nova floating ip pool is not present.

Default floating ip pool is 'nova'.

In my case it was mentioned as 'external'

After specifying the external pool in floating ip create command, ip was successfully created.

root@puppet:/opt/python-script# nova floating-ip-create external
+----------------+-----------+----------+----------+
| Ip             | Server Id | Fixed Ip | Pool     |
+----------------+-----------+----------+----------+
| 192.168.17.156 | -         | -        | external |
+----------------+-----------+----------+----------+

Error 2:
No nw_info cache associated with instance (HTTP 400) (Request-ID: req-ba8c1adc-cc41-4592-8ac2-9d01cd66f6e8)

When trying to add a floating ip address (which is already created) to a newly spawned instance in OpenStack cloud, I was getting the following error.

<FloatingIP fixed_ip=None, id=7e438ee9-4e5e-4b6d-b43b-246d18039890, instance_id=None, ip=192.168.17.159, pool=external>
exception is  No nw_info cache associated with instance (HTTP 400) (Request-ID: req-ba8c1adc-cc41-4592-8ac2-9d01cd66f6e8)

This was due to instance was not properly started its networking operations and we were trying to assign the floating ip address to it.

After introducing a small delay between spawning the instance and assigning the newly created floating ip address to it, the operation was successful.

root@puppet:/opt/python-script# python test.py 
Generating nova credentials...
Retrieving image, flavor and network information...
<Image: suhan-daf-agent-ubuntu12.04>
<Network: network-routable>
7bb05f0b-44b4-4c6d-a36f-7194dc43bd42


ACTIVE
<FloatingIP fixed_ip=None, id=d7938b77-ead2-40ce-b992-65770544304b, instance_id=None, ip=192.168.17.162, pool=external>
{u'network-routable': [{u'OS-EXT-IPS-MAC:mac_addr': u'fa:16:3e:74:b4:80', u'version': 4, u'addr': u'192.168.30.174', u'OS-EXT-IPS:type': u'fixed'}]}
192.168.30.174
940c3175-f066-4062-ba77-9fa3b74904c4
ACTIVE