Ask Your Question

How to verify device_owner of port is nova(compute)?

asked 2013-05-31 12:54:40 -0500

rms gravatar image

updated 2013-06-03 13:56:38 -0500

smaffulli gravatar image

While asking quantum to create port when its creating instance, nova feels in following:

zone = 'compute:%s' % instance['availability_zone']
             port_req_body = {'port': {'device_id': instance['uuid'],
                                       'device_owner': zone}}

So in quantum, if I want to know whether nova is the device_owner or not should I be checking something like following:

if 'compute:' in port['device_owner']: ??

Or is there another cleaner way. context object passed as create_port's argument does not hold any information either.

Thanks Ronak

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-06-03 16:18:48 -0500

darragh-oreilly gravatar image

Sure. As an example of other owners, here there are 2 networks with just one instance:

$ quantum  port-list -c device_owner -c network_id
| device_owner             | network_id                           |
| network:floatingip       | 62eec761-b812-43cd-b11f-22f2d24ea7e9 |
| network:router_interface | 7a9ea3bd-77bd-4b99-ab7f-b1e200f07dd7 |
| compute:None             | 7a9ea3bd-77bd-4b99-ab7f-b1e200f07dd7 |
| network:dhcp             | 7a9ea3bd-77bd-4b99-ab7f-b1e200f07dd7 |
| network:router_gateway   | 62eec761-b812-43cd-b11f-22f2d24ea7e9 |
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2013-05-31 12:54:40 -0500

Seen: 1,685 times

Last updated: Jun 03 '13