nova boot --nic to accept network names

Bug #1496180 reported by Armando Migliaccio
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Wishlist
Pavel Kholkin

Bug Description

Today, in order to specify networking arguments, the nova client accepts this option:

[--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid>]

However, it can only accept uuid's. If I try to specify a (unique) name for a network on which I want to boot on, I get the following error:

ERROR (BadRequest): Bad networks format: network uuid is not in proper format (network-foo).

It would be nice if we could extend the client option to allow names to be accepted too.

Changed in python-novaclient:
importance: Undecided → Wishlist
Changed in python-novaclient:
assignee: nobody → Akhila C (chetlapalle-akhila-b)
Revision history for this message
Matt Riedemann (mriedem) wrote :

This is going to require a change to the nova API if you're going to just pass the network name through on the request, because at least in the v2.1 API we validate against the network portion of the request and name isn't allowed:

https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/servers.py#L29

You could workaround this in the client though by getting the uuid for the network given by name and then passing that uuid to the server create API.

You can get all networks via the API here:

https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/networks.py#L86

And then match the network['label'] to the requested network name during the nova boot CLI. If you find a match, then use that network's id for the uuid to pass to the server create request. If there is more than one match for the requested network name then you have to error out to the user and tell them to provide the network id (uuid).

melanie witt (melwitt)
Changed in python-novaclient:
status: New → Confirmed
Changed in python-novaclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
assignee: Akhila C (chetlapalle-akhila-b) → Pavel Kholkin (pkholkin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/225326
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=15d7b403bba2db83726f20c8395e6a7655dbe8d1
Submitter: Jenkins
Branch: master

commit 15d7b403bba2db83726f20c8395e6a7655dbe8d1
Author: Pavel Kholkin <email address hidden>
Date: Tue Jan 19 18:06:05 2016 +0300

    Support to boot a VM with network name

    Bug_description:
    Today, in order to specify networking arguments, the nova client
    only accept uuid's. It would be nice if we could extend the
    client option to allow names to be accepted too.

    Solution:
    This patch supports provisioning of VM by mentioning network name.
    _boot method currently validates for network ID to boot a VM.

    Updates:
    * new parameter 'net-name' is added
    * when 'net-name' is specified network ID is retrieved
    * network ID is used for further processing of vm boot request
    * if multiple networks with the same name exist then
    NoUniqueMatch exception is raised
    * help text is updated

    DocImpact
    Closes-Bug: #1496180

    Co-Authored-By: Pavel Kholkin <email address hidden>

    Change-Id: Ifb14a76749901ee106cdb807e38820a2c25e1320

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-novaclient 3.3.0

This issue was fixed in the openstack/python-novaclient 3.3.0 release.

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.