Unable to create instance when multiple networks found

Bug #1257838 reported by Jordan Pittier
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Andrey Shestakov

Bug Description

When the user specified in "nova_proxy_admin_user" has access to several neutron networks, instance creation fails with the following error in the task_manager :

2013-12-04 16:17:27.357 4161 ERROR trove.taskmanager.models [req-29177421-8d7e-4efd-92f0-bde4b9c51e72 e7f562a29da3492baba2cc7c5a1f2d84 8147c285d288420db3233cbe46a3c56e] Traceback (most recent call last):
  File "/home/trove/trove/taskmanager/models.py", line 400, in _create_server_volume_individually
    availability_zone)
  File "/home/trove/trove/taskmanager/models.py", line 510, in _create_server
    availability_zone=availability_zone)
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.py", line 658, in create
    **boot_kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/base.py", line 402, in _boot
    return_raw=return_raw, **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/base.py", line 145, in _create
    _resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 232, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 213, in _cs_request
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 195, in _time_request
    resp, body = self.request(url, method, **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 189, in request
    raise exceptions.from_response(resp, body, url, method)
BadRequest: Multiple possible networks found, use a Network ID to be more specific. (HTTP 400) (Request-ID: req-7646222f-c79a-41c1-a801-f5389997829e)

I suggest an additional flag in the taskmanager configuration named "instance_default_network" that would accept a valid network uuid. This flag will be used when creating a new instance. What do you think ?

Revision history for this message
Denis M. (dmakogon) wrote :

how novaclient could accept network uuid ?

Revision history for this message
Jordan Pittier (jordan-pittier) wrote :

https://github.com/openstack/trove/blob/master/trove/taskmanager/models.py#L507 there is a call to nova_client.servers.create() which signature is :

def create(self, name, image, flavor, meta=None, files=None,
               reservation_id=None, min_count=None,
               max_count=None, security_groups=None, userdata=None,
               key_name=None, availability_zone=None,
               block_device_mapping=None, block_device_mapping_v2=None,
               nics=None, scheduler_hints=None,
               config_drive=None, disk_config=None, **kwargs)

The interesting parameter is "nics" which is a list of dictionnary :
        :param nics: (optional extension) an ordered list of nics to be
                      added to this server, with information about
                      connected networks, fixed ips, port etc.

I'd like to submit a patch using the nics parameter.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/60292

Changed in trove:
assignee: nobody → Jordan Pittier (jordan-pittier)
status: New → In Progress
Revision history for this message
Jordan Pittier (jordan-pittier) wrote :

@Denis M: in the review you said "I think default nic should be managed at nova, not in trove." I understand but how would Nova know on which network the database instance is supposed to be connected ? I mean there could be several networks defined, let's say one for a web tier and one for a DB tier.

ATM in my environment I can't use trove because I have several "public" networks.

Changed in trove:
assignee: Jordan Pittier (jordan-pittier) → nobody
Changed in trove:
assignee: nobody → Andrey Shestakov (ashestakov)
Changed in trove:
importance: Undecided → High
milestone: none → icehouse-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/63212

Changed in trove:
milestone: icehouse-2 → icehouse-3
affects: trove → python-troveclient
Changed in python-troveclient:
milestone: icehouse-3 → none
affects: python-troveclient → trove
Revision history for this message
Rajdeep (dua-rajdeep) wrote :

Guys this is a critical bug and should be also merged with havana
interestingly multiple network scenario worked in grizzly

Revision history for this message
Auston McReynolds (amcrn) wrote :
Changed in trove:
milestone: none → icehouse-3
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: icehouse-3 → 2014.1
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.