Managed OpenStack
Latest
Frequently Asked Questions
Solution
How To
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
List All Instances, Username, And Tenants in OpenStack Region
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
Obtain a complete list of instance names, tenant name, region name mapped to the corresponding username in an OpenStack region.
Environment
- Platform9 Managed OpenStack - All Versions
- OpenStack CLI
Procedure
- Source the RC file for admin user of your environment.
xxxxxxxxxx$ source [your_rc_file].rc- Run the script on each region.
# 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- The script output snippet:
xxxxxxxxxx# ./script.shInstance_Name Region Username Tenant[VM_NAME] [region] [username] [tenant]Additional Information
Refer the OpenStack Documentation for more information on steps to install the OpenStack CLI and command line options.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message