Ask Your Question
0

python nova, get server project from servers

asked 2018-01-19 01:28:43 -0500

uffe gravatar image

Hi

I'm fetching a list of all server using the python nova sdk, and calling list with all_tenants. Can I get what project each server belongs to some how?

Johan

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-01-19 02:25:36 -0500

ppeereb1 gravatar image

This will do:

for server in nova.servers.list(search_opts={'all_tenants': 1}):
  print server.name
  print server.tenant_id
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

1 follower

Stats

Asked: 2018-01-19 01:28:43 -0500

Seen: 128 times

Last updated: Jan 19 '18