Cannot use security group name in server create

Bug #1687814 reported by Guang Yee on 2017-05-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Rui Chen

Bug Description

openstack server create --security-group foo_security_group ...

failed with the following error:

"Unable to find security_group with name or id 'foo_security_group' (HTTP 400) (Request-ID: req-e6a330b5-dcf3-4794-9884-eba235a51b7b"

Using the security ID instead of name works fine.

Doesn't appear we are doing any name to ID dance here.

https://github.com/openstack/python-openstackclient/blob/master/openstackclient/compute/v2/server.py#L709

Rui Chen (kiwik-chenrui) wrote :

I can't reproduce this issue, specifying security group name to boot server works for me in my local devstack, according to the nova API[1] and latest novaclient[2], security group name is supported, but security group uuid is not present, I think we should support to create server with security group name or uuid in openstackclient, we can do some conversion in osc and pass name to novaclient.

[1]: https://developer.openstack.org/api-ref/compute/?expanded=create-server-detail
[2]: https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/servers.py#L705-L707

Changed in python-openstackclient:
assignee: nobody → Rui Chen (kiwik-chenrui)

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

Changed in python-openstackclient:
status: New → In Progress

Reviewed: https://review.openstack.org/462076
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=45496feee6ae781dc0c1df4a0e5bd71b05653748
Submitter: Jenkins
Branch: master

commit 45496feee6ae781dc0c1df4a0e5bd71b05653748
Author: Rui Chen <email address hidden>
Date: Wed May 3 15:17:10 2017 +0800

    Create server with security group ID and name

    Both resource ID and name are supported to identify an object
    in openstackclient to make user easy to input, for security group,
    nova only support security group name in API when launch a new server,
    this patch convert ID to name, then pass name to nova API, and check
    the security group exist before creating server.

    Change-Id: I1ed4a967fb9de3f91c8945a1ef63f6c7b6b2dfb2
    Closes-Bug: #1687814

Changed in python-openstackclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-openstackclient 3.12.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers