List All Instances, Username, And Tenants in OpenStack Region
Problem
Environment
Procedure
$ source [your_rc_file].rc# Give +x permission to the script before executing.# Run this bash script on each region.echo -e "Instance_Name \t Region \t Username \t \t \t Tenant"for name in $(openstack server list --all -c ID -c Status -f value | awk '{if ($2 != "ERROR") print $1}' )dovm_name=$(openstack server show $name -c name -f value 2> /dev/null)if [[ $vm_name ]];thenUser_name=$(openstack user list | grep `openstack server show $name -c user_id -f value` | awk '{$1=$2=$3="";print $4}' | sed 's/|//g')tenant_name=$(openstack project show -f value -c name $(openstack server show $name -f value -c project_id))echo -e "${vm_name} \t ${OS_REGION_NAME} \t ${User_name} \t ${tenant_name}"fidone# ./script.shInstance_Name Region Username Tenant[VM_NAME] [region] [username] [tenant]Additional Information
PreviousHow To Obtain Diagnostic Information From OpenStack VM?NextChanges in Libvirt XML File of VM are Lost After a Hard Reboot.
Last updated
