Ask Your Question

how to list all VMs with projects name, power status, ipaddress?

asked 2018-03-30 02:26:27 -0600

I want to list all the openstack VMs with projects name, powerstatus, ipaddress. The following command will shows all the VMs but it shows with tenant ID but I want to list with tenant name.

nova list --all-tenants

Any other command or python script to list all openstack setup VMs with tenant name?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-03-30 06:55:46 -0600

updated 2018-03-30 08:32:03 -0600

Idea for a shell script. Don't expect it to be fast:

for server in $(openstack server list --all-projects -c ID -f value)
    # the -f shell option sets environment variables
    eval $(openstack server show $server -f shell -c id -c OS-EXT-STS:power_state -c addresses -c project_id --all-projects)
    project_name=$(openstack project show -f value -c name $project_id)
    echo $id $os_ext_sts_power_state $addresses $project_name

A script around the API is probably quicker.

Or nova list piped into an awk script.

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


Asked: 2018-03-30 02:26:27 -0600

Seen: 2,160 times

Last updated: Mar 30 '18