1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| # list the compute nodes where the servers locate
openstack server list --long -c ID -c Name -c Host -c 'Power State' -c 'Networks'
# list the instance names that are servers' alias
openstack server show vm4qos1 -c id -c name -c 'OS-EXT-SRV-ATTR:host' -c 'OS-EXT-SRV-ATTR:instance_name'
# merge the above two command
# get some servers' instance_name, host and so on
openstack server list -c ID -c Name | \
grep vm4qos* | \
awk -F'|' '{ print $2 }' | \
sed 's@^[[:space:]]*@@g;s@[[:space:]]*$@@g' | \
xargs -n1 openstack server show -c id -c name -c addresses -c 'OS-EXT-SRV-ATTR:host' -c 'OS-EXT-SRV-ATTR:instance_name'
# or nova list, the same as above
# fields can get from `nova show some-vm`'s Property
nova list --fields name,OS-EXT-SRV-ATTR:instance_name,OS-EXT-SRV-ATTR:host
nova list --fields name,OS-EXT-SRV-ATTR:instance_name,OS-EXT-SRV-ATTR:host --name vm4qos*
|