Nova API doesn't return instance security groups

Bug #909207 reported by Paul McMillan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
justinsb

Bug Description

The EC2 API was updated in response to bug 802046 to return the security groups associated with an instance. Unfortunately, the Nova API didn't get that change, and so it is currently not possible to retrieve just the security groups associated with an instance.
https://github.com/openstack/nova/blob/master/nova/api/ec2/cloud.py#L1101

The Nova API should return relevant security groups in the details view.
https://github.com/openstack/nova/blob/master/nova/api/openstack/v2/views/servers.py#L85

Zhongyue Luo (zyluo)
Changed in nova:
assignee: nobody → LZY (lzyeval)
description: updated
Zhongyue Luo (zyluo)
Changed in nova:
status: New → In Progress
Revision history for this message
Zhongyue Luo (zyluo) wrote :

I'm on unittests. almost there.

Revision history for this message
Zhongyue Luo (zyluo) wrote :

If we add security group info in the detailed servers list, the security group should have a "id" and a "href" link.

If I create the "href" link the url is "http://<host>:<port>/v2/<tenant_id>/security_group/<id>

However, this is wrong since the security group API is an extension.

Should the security group API be kept as an extension or may I move it to the core?

Changed in nova:
importance: Undecided → Low
Revision history for this message
Paul McMillan (paul-mcmillan) wrote :

I spoke with several other devs who agreed that security groups will probably be moved back into core at some point. I don't know if a patch to do that as part of this change would be accepted, or if that needs to wait for a larger refactor.

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/3137

Revision history for this message
Zhongyue Luo (zyluo) wrote :

rain check

Changed in nova:
assignee: Zhongyue Luo (lzyeval) → SWS (sws)
status: In Progress → New
Zhongyue Luo (zyluo)
Changed in nova:
status: New → In Progress
Revision history for this message
justinsb (justin-fathomdb) wrote :

I don't think this is a duplicate of 918830; 918830 is "security_group => servers", this is "servers => security_groups". I need this functionality, so I'm coding a simple patch that is complementary to the patch proposed for 918830.

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

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

Revision history for this message
Zhongyue Luo (zyluo) wrote :

I did submit a sg=>servers patch a while ago but it got refused because sg's will be a core function on API V3.

Therefore it was suggested that I implement this on the sg extension for the time being.

Zhongyue Luo (zyluo)
Changed in nova:
assignee: Sina Cloud dev Team (sws) → justinsb (justin-fathomdb)
Revision history for this message
justinsb (justin-fathomdb) wrote :

Thanks - I did see your patch, and I hope sg will be in core and we can use your patch. I needed server => sg "today" though, so I implemented just that in a simple way.

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

Reviewed: https://review.openstack.org/4085
Committed: http://github.com/openstack/nova/commit/1b207d44340f88d560b469d0a30f99839a63dc61
Submitter: Jenkins
Branch: master

commit 1b207d44340f88d560b469d0a30f99839a63dc61
Author: Justin Santa Barbara <email address hidden>
Date: Mon Feb 13 12:00:20 2012 -0800

    Simple way of returning per-server security groups

    Bug #909207

    Change-Id: I7d111222210eaf3abfbae5bc7cccb6e823affc45

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-4 → 2012.1
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.