Created
February 23, 2021 03:28
-
-
Save ViKingIX/b8020e2e2e7e0bf4b18c570951ed9171 to your computer and use it in GitHub Desktop.
list instance volumes using openstack client from bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for prj in $(jq -r .[] projects.json) | |
do | |
instance_uuids=$(openstack server list -f json --project $prj | jq -r ".[].ID") | |
for instance_uuid in $instance_uuids | |
do | |
instance_json=$(openstack server show $instance_uuid -f json) | |
echo $instance_json | jq '{uuid: .id, instance: ."OS-EXT-SRV-ATTR:instance_name", volumes: ."os-extended-volumes:volumes_attached"}' | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment