Command `nova floating-ip-create` fails

Bug #1370448 reported by Ilya Shakhat
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
Medium
Alexander Gubanov
5.0.x
Won't Fix
Medium
Pavel Kholkin
5.1.x
Won't Fix
Medium
Pavel Kholkin
6.0.x
Fix Released
Medium
Yaroslav Lobankov
6.1.x
Fix Released
Medium
Alexander Gubanov

Bug Description

VERSION:
  feature_groups:
    - experimental
  production: "docker"
  release: "5.1"
  api: "1.0"
  build_number: "6"
  build_id: "2014-09-13_14-34-19"
  astute_sha: "f5fbd89d1e0e1f22ef9ab2af26da5ffbfbf24b13"
  fuellib_sha: "395fd9d20a003603cc9ad26e16cb13c1c45e24e6"
  ostf_sha: "64cb59c681658a7a55cc2c09d079072a41beb346"
  nailgun_sha: "b8d8189cc37d6d1b26f4479be6be7313beefb1c8"
  fuelmain_sha: "d7ed7973034bde73d3f42c000984423b59b2312b"

Description:
--------------------

Command `nova floating-ip-create` fails with ERROR: FloatingIpPoolNotFound: Floating ip pool not found. (HTTP 404) (Request-ID: req-52256308-b9ac-457e-8b5c-e1df5dcc31cd)

Workaround:
--------------------

Run floating-ip-create command with floating IP pool specified, for instance:

nova floating-ip-create novapool

Details:
--------------------
# nova --debug floating-ip-create

REQ: curl -i 'http://172.16.44.50:8774/v2/9545287d79284a548f35ca04e799b417/os-floating-ips' -X POST -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 7d84b5caeeed4326a090da4cdc487e9e" -d '{"pool": null}'

New session created for: (http://172.16.44.50:8774)
INFO (connectionpool:202) Starting new HTTP connection (1): 172.16.44.50
DEBUG (connectionpool:296) "POST /v2/9545287d79284a548f35ca04e799b417/os-floating-ips HTTP/1.1" 404 97
RESP: [404] CaseInsensitiveDict({'date': 'Wed, 17 Sep 2014 10:41:20 GMT', 'content-length': '97', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-4d4b34d4-12b8-4473-a588-d37600e1513d'})
RESP BODY: {"itemNotFound": {"message": "FloatingIpPoolNotFound: Floating ip pool not found.", "code": 404}}

DEBUG (shell:777) FloatingIpPoolNotFound: Floating ip pool not found. (HTTP 404) (Request-ID: req-4d4b34d4-12b8-4473-a588-d37600e1513d)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/novaclient/shell.py", line 774, in main
    OpenStackComputeShell().main(map(strutils.safe_decode, sys.argv[1:]))
  File "/usr/lib/python2.7/dist-packages/novaclient/shell.py", line 710, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/shell.py", line 2030, in do_floating_ip_create
    _print_floating_ip_list([cs.floating_ips.create(pool=args.pool)])
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/floating_ips.py", line 41, in create
    return self._create("/os-floating-ips", {'pool': pool}, "floating_ip")
  File "/usr/lib/python2.7/dist-packages/novaclient/base.py", line 152, in _create
    _resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 286, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 260, in _cs_request
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 242, in _time_request
    resp, body = self.request(url, method, **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 236, in request
    raise exceptions.from_response(resp, body, url, method)
NotFound: FloatingIpPoolNotFound: Floating ip pool not found. (HTTP 404) (Request-ID: req-4d4b34d4-12b8-4473-a588-d37600e1513d)
ERROR: FloatingIpPoolNotFound: Floating ip pool not found. (HTTP 404) (Request-ID: req-4d4b34d4-12b8-4473-a588-d37600e1513d)

nova-all.log
-----------------
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.817 14469 DEBUG routes.middleware [req-4d4b34d4-12b8-4473-a588-d37600e1513d ] Matched POST /9545287d79284a548f35ca04e799b417/os-floating-ips __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.817 14469 DEBUG routes.middleware [req-4d4b34d4-12b8-4473-a588-d37600e1513d ] Route path: '/{project_id}/os-floating-ips', defaults: {'action': u'create', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3747e50>} __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.818 14469 DEBUG routes.middleware [req-4d4b34d4-12b8-4473-a588-d37600e1513d ] Match dict: {'action': u'create', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3747e50>, 'project_id': u'9545287d79284a548f35ca04e799b417'} __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.818 14469 DEBUG nova.api.openstack.wsgi [req-4d4b34d4-12b8-4473-a588-d37600e1513d None] Action: 'create', body: {"pool": null} _process_stack /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:940
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.819 14469 DEBUG nova.api.openstack.wsgi [req-4d4b34d4-12b8-4473-a588-d37600e1513d None] Calling method '<bound method FloatingIPController.create of <nova.api.openstack.compute.contrib.floating_ips.FloatingIPController object at 0x34a9910>>' (Content-type='application/json', Accept='application/json') _process_stack /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:945
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.820 14469 DEBUG neutronclient.client [req-4d4b34d4-12b8-4473-a588-d37600e1513d ]
REQ: curl -i http://192.168.0.2:9696/v2.0/networks.json?router%3Aexternal=True&name=nova&fields=id -X GET -H "X-Auth-Token: 7d84b5caeeed4326a090da4cdc487e9e" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient"
 http_log_req /usr/lib/python2.7/dist-packages/neutronclient/common/utils.py:173
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.868 14469 DEBUG neutronclient.client [req-4d4b34d4-12b8-4473-a588-d37600e1513d ] RESP:{'status': '200', 'content-length': '16', 'content-location': 'http://192.168.0.2:9696/v2.0/networks.json?router%3Aexternal=True&name=nova&fields=id', 'date': 'Wed, 17 Sep 2014 10:41:20 GMT', 'content-type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-bc5f8a83-c5d6-4a83-9647-0bafdc77dd68'} {"networks": []}
 http_log_resp /usr/lib/python2.7/dist-packages/neutronclient/common/utils.py:179
<179>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.869 14469 ERROR nova.api.openstack [req-4d4b34d4-12b8-4473-a588-d37600e1513d None] Caught error: Floating ip pool not found.
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack Traceback (most recent call last):
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py", line 125, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return req.get_response(self.application)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack application, catch_exc_info=False)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return resp(environ, start_response)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py", line 582, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return self.app(env, start_response)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return resp(environ, start_response)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return resp(environ, start_response)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack response = self.app(environ, start_response)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return resp(environ, start_response)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 917, in __call__
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack content_type, body, accept)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 983, in _process_stack
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 1070, in dispatch
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack return method(req=request, **action_args)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/floating_ips.py", line 158, in create
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack address = self.network_api.allocate_floating_ip(context, pool)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/network/neutronv2/api.py", line 927, in allocate_floating_ip
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack pool_id = self._get_floating_ip_pool_id_by_name_or_id(client, pool)
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/network/neutronv2/api.py", line 917, in _get_floating_ip_pool_id_by_name_or_id
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack raise exception.FloatingIpPoolNotFound()
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack FloatingIpPoolNotFound: Floating ip pool not found.
2014-09-17 10:41:20.869 14469 TRACE nova.api.openstack
<182>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.872 14469 INFO nova.api.openstack [req-4d4b34d4-12b8-4473-a588-d37600e1513d None] http://172.16.44.50:8774/v2/9545287d79284a548f35ca04e799b417/os-floating-ips returned with HTTP 404
<183>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.873 14469 DEBUG nova.api.openstack.wsgi [req-4d4b34d4-12b8-4473-a588-d37600e1513d None] Returning 404 to user: FloatingIpPoolNotFound: Floating ip pool not found. __call__ /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:1215
<182>Sep 17 10:41:20 node-13 nova-api 2014-09-17 10:41:20.874 14469 INFO nova.osapi_compute.wsgi.server [req-4d4b34d4-12b8-4473-a588-d37600e1513d None] 192.168.0.2 "POST /v2/9545287d79284a548f35ca04e799b417/os-floating-ips HTTP/1.1" status: 404 len: 291 time: 0.0913920

Tags: nova
Ilya Shakhat (shakhat)
tags: added: nova
Changed in mos:
assignee: nobody → MOS Nova (mos-nova)
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Looks like this works when nova-network is deployed instead of neutron

Changed in mos:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 6.0
Revision history for this message
Irina Povolotskaya (ipovolotskaya) wrote :

Should this be included into Release Notes?
Is there any possible workaround?

Changed in mos:
assignee: MOS Nova (mos-nova) → Pavel Kholkin (pkholkin)
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Irina, no. This seems to be a neutron 'feature', rather than a bug

Revision history for this message
Ilya Shakhat (shakhat) wrote :

Looks like Nova misses parameter 'default_floating_pool' when deployed with Neutron.

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Ilya, when nova-network is deployed, a range of floating IPs in the pool specified by CONF.default_floating_pool (defaults to 'nova') is preallocated by Puppet manifests we use. nova floating-ip-create call will then take one of these preallocated addresses and reserve it for the caller tenant.

It seems that when Neutron is deployed, no floating IPs are preallocated. So when you try to call nova floating-ip-create it fails, because pool 'nova' doesn't exist.

We could fix it in Neutron Puppet manifests: create an external network 'nova' (or any other and specify default_floating_pool option in nova.conf) and preallocate floating IPs on it. But we'll still need to connect Neutron ports to this network, i.e. to create a router per tenant network and plug the gateway interface to the external network.

Revision history for this message
Dmitry Borodaenko (angdraug) wrote :

If what's described in bug description happens every time, this is a Critical, not Medium. If not, description should be updated with better instructions how to reproduce, and (if priority is indeed Medium) 5.x release series should be Won't Fix.

description: updated
Revision history for this message
Dmitry Mescheryakov (dmitrymex) wrote :

Dmitry B: the issue happens only if floating IP pool is not specified and Neutron is deployed. The workaround is to specify pool name, and hence the bug is not that severe.

Revision history for this message
Dmitry Borodaenko (angdraug) wrote :

Agreed, marked as Won't Fix for maintenance releases.

Revision history for this message
Alexander Gubanov (ogubanov) wrote :
Changed in mos:
status: Triaged → Won't Fix
Revision history for this message
Yaroslav Lobankov (ylobankov) wrote :

Guys, this bug affects about 20 Tempest tests. Solution of the issue is known and it looks like this bug will not take a lot of efforts. Alexander Gubanov proposed the patch for fixing this bug. Well, let's review the patch at least.

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :
Revision history for this message
Yaroslav Lobankov (ylobankov) wrote :

Fix is verified for

VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "6.1"
  api: "1.0"
  build_number: "126"
  build_id: "2015-02-15_22-54-44"
  nailgun_sha: "1e3a40dd8a17abe1d38f42da1e0dc1a6d4572666"
  python-fuelclient_sha: "61431ed16fc00039a269424bdbaa410277eff609"
  astute_sha: "1f87a9b9a47de7498b4061d15a8c7fb9435709d5"
  fuellib_sha: "7f8d4382abfcd4338964182ebfea1d539f963e66"
  ostf_sha: "f9c37d0876141e1550eb4e703a8e500cd463282f"
  fuelmain_sha: "2054229e275d08898b5d079a6625ffcc79ae23b8"

Revision history for this message
Yaroslav Lobankov (ylobankov) wrote :

Since this bug affects about 20 Tempest tests it would be good to have the fix and for 6.0.1, too.

Revision history for this message
Yaroslav Lobankov (ylobankov) wrote :

The fix for 6.0.1 on review:

https://review.openstack.org/#/c/156189/

Revision history for this message
Yaroslav Lobankov (ylobankov) wrote :

The fix for 6.0.1 is verified on

VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "6.0.1"
  api: "1.0"
  build_number: "94"
  build_id: "2015-02-17_08-32-41"
  astute_sha: "f7cda2171b0b677dfaeb59693d980a2d3ee4c3e0"
  fuellib_sha: "72fb29ff8201d4532c056a928e74fd0ebe021e19"
  ostf_sha: "3b57985d4d2155510894a1f6d03b478b201f7780"
  nailgun_sha: "6967b24adc4d74e36d69b59973ff79d6ab2389e5"
  fuelmain_sha: "c799e3a6d88289e58db764a6be7910aab7da3149"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.