attach interface error

Asked by skywalker on 2013-07-04

I created a vm,created a port in a network different with the vm's network , and then attached the port to the vm.

The log is as follows:

  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py", line 430, in _process_data
    rval = self.proxy.dispatch(ctxt, version, method, **args)

  File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py", line 133, in dispatch
    return getattr(proxyobj, method)(ctxt, **kwargs)

  File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2983, in attach_interface
    self.conductor_api)

  File "/usr/lib/python2.7/dist-packages/nova/network/api.py", line 46, in wrapper
    res = f(self, context, *args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/nova/network/quantumv2/api.py", line 336, in allocate_port_for_instance
    conductor_api=conductor_api)

  File "/usr/lib/python2.7/dist-packages/nova/network/api.py", line 46, in wrapper
    res = f(self, context, *args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/nova/network/quantumv2/api.py", line 286, in allocate_for_instance
    nw_info = self._get_instance_nw_info(context, instance, networks=nets)

  File "/usr/lib/python2.7/dist-packages/nova/network/quantumv2/api.py", line 368, in _get_instance_nw_info
    nw_info = self._build_network_info_model(context, instance, networks)

  File "/usr/lib/python2.7/dist-packages/nova/network/quantumv2/api.py", line 797, in _build_network_info_model
    [n['id'] for n in networks])

  File "/usr/lib/python2.7/dist-packages/nova/network/quantumv2/api.py", line 954, in _ensure_requested_network_ordering
    if preferred:

  File "/usr/lib/python2.7/dist-packages/nova/network/quantumv2/api.py", line 954, in <lambda>
    if preferred:

ValueError: u'0dc714fa-9022-4a03-bb22-9821a396bb9d' is not in list

It looks like that a vm can't have ports in different networks.
Is that right?

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
2013-07-04
Last reply:
2013-07-04
Keith Tobin (keith-tobin) said : #1

The VM can only connect to the port of a network if,

A) the tenant that owns the VM is also the owner of the network.
B) the network is flagged as a shared network, then any VM from any network can create a port and connect a VM.

What you can not do is have a VM belong to one tenant connect to a port in a second tenant network where that network is not a flagged as shared.

The above is true for quantum/neutron/openstack networking.

skywalker (sunzuohua) said : #2

I think that may be a problem in nova.
The method nova.network.quantumv2.api._ensure_requested_network_ordering() will sort the port list with respect to the preferred network ordering.But if there is a port which is not belong to any preferred,the error will occur.

Can you help with this problem?

Provide an answer of your own, or ask skywalker for more information if necessary.

To post a message you must log in.