Nova send wrong information when there are several networks which have same name and VM uses more than one of them

Bug #1708316 reported by Jonghan
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Medium
Stephen Finucane
neutron
Won't Fix
Undecided
Unassigned

Bug Description

Description
===========
Nova send wrong information when there are
several networks which have same name and
VM uses more than one of them

Steps to reproduce
==================
1. Create two networks which have same name
2. Create VM with the networks created in 1st step.
3. Check the VM using "nova show <VM>"

Expected result
===============
...
| tenant_id | 92f3ea23c5b84fd69b56583f322d213e |
| testnet1 network | 192.168.0.12 |
| testnet1 network | 192.168.1.4 |
| updated | 2017-07-31T14:33:49Z |
...

Actual result
=============
...
| tenant_id | 92f3ea23c5b84fd69b56583f322d213e |
| testnet1 network | 192.168.0.12, 192.168.1.4 |
| updated | 2017-07-31T14:33:49Z |
...

Environment
===========
1. Openstack Version : I tested this using Mitaka & Ocata
2. Network : Neutron with LinuxBridge

Tags: api
Revision history for this message
Jonghan (forhim-park) wrote :

From the debug messages, below part are releated to this problem.

# nova --debug show testvm
.......
DEBUG (session:248) REQ: curl -g -i -X GET http://10.251.214.128:8774/v2/99324deb5cbc4225bcf461cb5263f073/servers/dff73b1e-c52d-4eb0-b2bf-0aac6a323a8e -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}8c47607eaf5f705b9b6803c9c1c430601dcea72d"
DEBUG (connectionpool:401) "GET /v2/99324deb5cbc4225bcf461cb5263f073/servers/dff73b1e-c52d-4eb0-b2bf-0aac6a323a8e HTTP/1.1" 200 2101
DEBUG (session:277) RESP: [200] Content-Length: 2101 Content-Type: application/json X-Compute-Request-Id: req-2ca57fe2-c873-44e6-a09b-3be7f183a0e7 Date: Sat, 22 Jul 2017 06:51:58 GMT Connection: keep-alive
RESP BODY: {"server": {"status": "ACTIVE", "updated": "2017-07-21T10:07:05Z", "hostId": "b5b56d2e7c70f50d4f72d2d071592b35949398832f1bbb3c3cca43f8", "OS-EXT-SRV-ATTR:host": "dellnova1", "addresses": {"testnet1": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:65:83:12", "version": 4, "addr": "192.168.0.1", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:7c:67:72", "version": 4, "addr": "192.168.0.1", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:12:5c:47", "version": 4, "addr": "192.168.0.1", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:7e:0b:64", "version": 4, "addr": "192.168.0.1", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://10.251.214.128:8774/v2/99324deb5cbc4225bcf461cb5263f073/servers/dff73b1e-c52d-4eb0-b2bf-0aac6a323a8e", "rel": "self"}, {"href": "http://10.251.214.128:8774/99324deb5cbc4225bcf461cb5263f073/servers/dff73b1e-c52d-4eb0-b2bf-0aac6a323a8e", "rel": "bookmark"}], "key_name": null, "image": {"id": "6479dc43-c7b0-4b4b-bcf6-7f566aec3535", "links": [{"href": "http://10.251.214.128:8774/99324deb5cbc4225bcf461cb5263f073/images/6479dc43-c7b0-4b4b-bcf6-7f566aec3535", "rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "testvm", "OS-SRV-USG:launched_at": "2017-07-21T10:07:05.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "dellnova1", "flavor": {"id": "1", "links": [{"href": "http://10.251.214.128:8774/99324deb5cbc4225bcf461cb5263f073/flavors/1", "rel": "bookmark"}]}, "id": "dff73b1e-c52d-4eb0-b2bf-0aac6a323a8e", "security_groups": [{"name": "default"}, {"name": "default"}, {"name": "default"}, {"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "nova", "user_id": "419724e2c52a462dbb9efc45db9ebc14", "name": "testvm", "created": "2017-07-21T10:06:54Z", "tenant_id": "99324deb5cbc4225bcf461cb5263f073", "OS-DCF:diskConfig": "AUTO", "os-extended-volumes:volumes_attached": [], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}}
.......

Let's isolate JSON data.

"addresses": {
  "testnet1":
  [
 {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:65:83:12", "version": 4, "addr": "192.168.0.12", "OS-EXT-IPS:type": "fixed"},
 {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:7c:67:72", "version": 4, "addr": "192.168.1.4", "OS-EXT-IPS:type": "fixed"}
  ]
}

description: updated
Revision history for this message
Jonghan (forhim-park) wrote :

This is the JSON data when VM has two ports for connecting different networks :

"addresses": {
    "nfs_mgmt":
    [
      {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:f3:ba:c0", "version": 4, "addr": "128.0.0.2", "OS-EXT-IPS:type": "fixed"}
    ],
    "public_network":
    [
      {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:31:52:c5", "version": 4, "addr": "10.251.214.52", "OS-EXT-IPS:type": "fixed"}
    ]
}

So I think the JSON data should be like below:

"addresses": {
  "testnet1_35cb3d55-cd":
  [
 {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:65:83:12", "version": 4, "addr": "192.168.0.12", "OS-EXT-IPS:type": "fixed"}
  ],
  "testNetwork_f8fad107-4a" :
  [
 {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:7c:67:72", "version": 4, "addr": "192.168.0.1", "OS-EXT-IPS:type": "fixed"}
  ]
}

Revision history for this message
Minho Ban (mhban) wrote :

Found same bug in Mitaka.

Changed in nova:
status: New → Confirmed
tags: added: api
Changed in nova:
assignee: nobody → Jonghan (forhim-park)
status: Confirmed → In Progress
Revision history for this message
Maciej Kucia (maciejkucia) wrote :

API spec is wrong. For example:
https://developer.openstack.org/api-ref/compute/#servers-ips-servers-ips
Addresses field is a dict not a list. Therefore it is not expected that network name is non-unique.

I see following options:
 - Network names should be forced to be unique
 - API shall allow multiple networks with the same name (change dict to list)
 - API shall allow special postfix in network label

Revision history for this message
Sean Dague (sdague) wrote :

This is going to need to come in as a spec, as it would be an API change. I'd also want the Neutron folks involved in this to figure out if this is their desired state.

Boden R (boden)
Changed in neutron:
status: New → Triaged
Revision history for this message
Kevin Benton (kevinbenton) wrote :

network names are definitely not unique in neutron and I don't think it would be tenable to make them that way. Ignoring the backward-compatibility, it would make the acceptable name field values for a given tenant completely unpredictable because they can't see all of the names that are in use.

Even if we scoped uniqueness to (network tenant_id, network name), it would still result in cases where just the name collides when you have networks shared to a tenant either globally or via an RBAC entry.

I think the Nova API is going to have to change to key based on network IDs instead of names or one of the other solutions.

Changed in neutron:
status: Triaged → Won't Fix
Revision history for this message
Maciej Kucia (maciejkucia) wrote :

Posted spec for API change in Nova. Feedback is appreciated
https://review.openstack.org/#/c/521392

Changed in nova:
assignee: Jonghan (forhim-park) → Maciej Kucia (maciejkucia)
Changed in nova:
assignee: Maciej Kucia (maciejkucia) → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
assignee: Matt Riedemann (mriedem) → Maciej Kucia (maciejkucia)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova-specs (master)

Reviewed: https://review.openstack.org/521392
Committed: https://git.openstack.org/cgit/openstack/nova-specs/commit/?id=253e0acafe7024e1869745b98e270f30cbc32d48
Submitter: Zuul
Branch: master

commit 253e0acafe7024e1869745b98e270f30cbc32d48
Author: Maciej Kucia <email address hidden>
Date: Sun Nov 19 23:35:33 2017 +0100

    Non-unique network names in Servers IPs API response

    Report correct server IP information when multiple networks
    with the same name are used in VM. This spec proposes to
    group VM networks using their IDs rater than names in
    Server IPs API resource.

    APIImpact

    Spec for blueprint servers-ips-non-unique-network-names

    Partial-Bug: #1708316
    Change-Id: I1b13ed3bfc647b1b85e1535bc17c06bde0fe0d24
    Signed-off-by: Maciej Kucia <email address hidden>

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

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

Changed in nova:
assignee: Maciej Kucia (maciejkucia) → Matt Riedemann (mriedem)
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/575998

Changed in nova:
assignee: Matt Riedemann (mriedem) → Maciej Kucia (maciejkucia)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova-specs (master)

Reviewed: https://review.openstack.org/558125
Committed: https://git.openstack.org/cgit/openstack/nova-specs/commit/?id=75099b24d24e2212486ccdd427a98a007aea74e7
Submitter: Zuul
Branch: master

commit 75099b24d24e2212486ccdd427a98a007aea74e7
Author: Maciej Kucia <email address hidden>
Date: Mon Apr 2 08:36:55 2018 +0200

    Fix Non-unique network names in Servers IPs API response

    Original spec change mixed two distinct API paths.
    This change fixes the spec to address each path.
    As a result, responses shall be fixed for server API paths:

     - GET /servers/detail
     - GET /servers/{server_id}
     - GET /servers/{server_id}/ips
     - PUT /servers/{server_id}
     - POST /servers/{server_id}/action (rebuild)

    APIImpact

    Spec for blueprint servers-ips-non-unique-network-names

    Partial-Bug: #1708316
    Change-Id: I6a0ca905996a50a6953e3932cf2636804d53a407
    Signed-off-by: Maciej Kucia <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Maciej Kucia (<email address hidden>) on branch: master
Review: https://review.openstack.org/575998

Changed in nova:
assignee: Maciej Kucia (maciejkucia) → Krzysztof Opasiak (kopasiak)
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/625371

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/490332

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/625371
Reason: Yup, this needs a spec. Note that there was some pre-existing work here too https://review.opendev.org/#/c/490332/

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

Fix proposed to branch: master
Review: https://review.opendev.org/686444

Changed in nova:
assignee: Krzysztof Opasiak (kopasiak) → Stephen Finucane (stephenfinucane)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by "Stephen Finucane <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/nova/+/686444
Reason: This is going to need a spec to proceed, and I'm probably not going to be doing that

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.