Launching an instance with muliple interfaces attached to same network by using --net-id fails

Bug #1400037 reported by Itzik Brown
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
venkata anil
Juno
Fix Released
High
Artom Lifshitz

Bug Description

Fails to launch an instance with multiple interfaces attached to the same network by using --nic net-id= :

# nova boot --flavor m1.small --image rhel7-new --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5 --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5 vm100

ERROR (BadRequest): Duplicate networks (52fc18b6-397a-45d6-b8db-fb32accd00e5) are not allowed (HTTP 400) (Request-ID: req-7b9bfaa5-a304-4b47-9acb-ee518ba220f8)

There is no problem when launching the instance using --port-id :
# nova boot --flavor m1.small --image rhel7-new --nic port-id=4479d8c5-3c1d-41ab-8994-e577280a9584 --nic port-id=ec218051-3819-4af5-8113-96c5d31442cc vm100

# neutron port-show 4479d8c5-3c1d-41ab-8994-e577280a9584 -F network_id
+------------+--------------------------------------+
| Field | Value |
+------------+--------------------------------------+
| network_id | 52fc18b6-397a-45d6-b8db-fb32accd00e5 |
+------------+--------------------------------------+
# neutron port-show ec218051-3819-4af5-8113-96c5d31442cc -F network_id
+------------+--------------------------------------+
| Field | Value |
+------------+--------------------------------------+
| network_id | 52fc18b6-397a-45d6-b8db-fb32accd00e5 |
+------------+--------------------------------------+

Version
=======
openstack-nova-common-2014.2-2.el7ost.noarch
openstack-neutron-2014.2-11.el7ost.noarch

Expected result
=============
Both using the --nic port-id and --nic net-id should work

Changed in nova:
assignee: nobody → venkata anil (anil-venkata)
Revision history for this message
melanie witt (melwitt) wrote :

I think this might be a usage error. Does it work for you if you do the command like this?

nova boot --flavor m1.small --image rhel7-new --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5 port-id=4479d8c5-3c1d-41ab-8994-e577280a9584 --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5 port-id=ec218051-3819-4af5-8113-96c5d31442cc vm100

Also, I found this nova.conf setting in the [neutron] section which sounds like it would do what you want without specifying port id:

       cfg.BoolOpt('allow_duplicate_networks',
                   default=False,
                   help='Allow an instance to have multiple vNICs attached to '
                       'the same Neutron network.'),

Do either of these solve your issue?

Changed in nova:
status: New → Incomplete
tags: added: network
Revision history for this message
Itzik Brown (itzikb1) wrote :

1. Not sure I understand the first suggestion. I want to launch an instance with 2 interfaces using --nic net-id and not --nic port-id.

2. Yes. Without this option Launching an instance with 2 interfaces attached to the same network with using --nic port-id fails.

Itzik Brown (itzikb1)
Changed in nova:
status: Incomplete → New
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Alex Xu (xuhj)
tags: added: juno-backport-potential
Changed in nova:
importance: Undecided → High
Revision history for this message
Rui Chen (kiwik-chenrui) wrote :

I report this bug in 2014-10-13
https://bugs.launchpad.net/nova/+bug/1380544
But it's tagged as invaild because Matt think that it's a usage error :(

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

Reviewed: https://review.openstack.org/144882
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cd6c48abd592e3a40153c555ee2aa91ac773c820
Submitter: Jenkins
Branch: master

commit cd6c48abd592e3a40153c555ee2aa91ac773c820
Author: venkata anil <email address hidden>
Date: Sun Jan 4 13:42:19 2015 +0000

    boot instance with same net-id for multiple --nic

    'allow_duplicate_networks' flag should allow an instance to have
    multiple vNICs attached to the same Neutron network.

    After setting this flag to true, booting instance with multiple
    interfaces to attach to same network(with same net-id) like below
    is failing.

    nova boot --flavor m1.small --image rhel7-new
    --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5
    --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5 vm100

    We have check for duplicate networks at nova api layer(i.e nova/api/
    openstack/compute/servers.py). We can just skip this check when we are
    using neutron. Because we already have same check in network api(i.e
    nova/network/neutronv2/api.py) and also as 'allow_duplicate_networks'
    flag is only for nova neutron.

    Closes-Bug: #1400037
    Change-Id: I7ee4e03a8fda3796606fb4618b95999b7580561d

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/152990

Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/juno)

Reviewed: https://review.openstack.org/152990
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7da8a1cf4003b0ff4d68013e27f6e77cd08145ae
Submitter: Jenkins
Branch: stable/juno

commit 7da8a1cf4003b0ff4d68013e27f6e77cd08145ae
Author: venkata anil <email address hidden>
Date: Sun Jan 4 13:42:19 2015 +0000

    boot instance with same net-id for multiple --nic

    'allow_duplicate_networks' flag should allow an instance to have
    multiple vNICs attached to the same Neutron network.

    After setting this flag to true, booting instance with multiple
    interfaces to attach to same network(with same net-id) like below
    is failing.

    nova boot --flavor m1.small --image rhel7-new
    --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5
    --nic net-id=52fc18b6-397a-45d6-b8db-fb32accd00e5 vm100

    We have check for duplicate networks at nova api layer(i.e nova/api/
    openstack/compute/servers.py). We can just skip this check when we are
    using neutron. Because we already have same check in network api(i.e
    nova/network/neutronv2/api.py) and also as 'allow_duplicate_networks'
    flag is only for nova neutron.

    Closes-Bug: #1400037
    Change-Id: I7ee4e03a8fda3796606fb4618b95999b7580561d
    (cherry picked from commit cd6c48abd592e3a40153c555ee2aa91ac773c820)

tags: added: in-stable-juno
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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