- List Available Commands
openstack --help
- Set Environment Variables
source openrc.sh
- List All Users
openstack user list
- List Identity Service Catalog
openstack catalog list
- List Images You Can Access
openstack image list
- Delete Specified Image
openstack image delete IMAGE
- Describe a Specific Image
openstack image show IMAGE
- Update Image
openstack image set IMAGE
- Upload Kernel, RAM, Three-Part, and Raw Images
# Various commands for uploading different types of images
- List Instances, Check Status of Instance
openstack server list
- Create a Flavor Named m1.tiny
openstack flavor create --ram 512 --disk 1 --vcpus 1 m1.tiny
- List Flavors
openstack flavor list
- Boot an Instance Using Flavor and Image Names
openstack server create --image IMAGE --flavor FLAVOR INSTANCE_NAME
- Log in to the Instance, Show Details, View Console Log, Set Metadata, Create Snapshot
# Various commands for managing instances
- Create Network, Create a Subnet
openstack network create NETWORK_NAME openstack subnet create --subnet-pool SUBNET --network NETWORK SUBNET_NAME
- Create a New Volume, Boot Instance and Attach to Volume
openstack volume create --size SIZE_IN_GB NAME openstack server create --image IMAGE --flavor FLAVOR --volume VOLUME_NAME INSTANCE_NAME
- List Volumes, Attach/Detach a Volume
openstack volume list openstack server add volume INSTANCE_ID VOLUME_ID
- Additional volumes are attached post-creation
-
Create the Instance with the Boot Volume:
- The boot volume contains the operating system and is specified in the
server create
command.
openstack server create --image IMAGE --flavor FLAVOR --volume BOOT_VOLUME_NAME INSTANCE_NAME
- The boot volume contains the operating system and is specified in the
-
Attach Additional Volumes After the Instance is Created:
- Once the instance is up and running, you can attach additional volumes using the
openstack server add volume
command.
openstack server add volume INSTANCE_NAME ADDITIONAL_VOLUME_NAME_1 openstack server add volume INSTANCE_NAME ADDITIONAL_VOLUME_NAME_2 # Repeat for as many additional volumes as you have
- Once the instance is up and running, you can attach additional volumes using the
- Create an instance, specifying the volume as a block device to attach
openstack server create \
--flavor $FLAVOR \
--image $IMAGE \
--port $PORT \
--block-device uuid=006efd7a-48a8-4c75-bafb-6b483199d284,source_type=volume,destination_type=volume \
--wait test-server
- Display Information, List Containers
swift stat swift list
- Show OpenStack Client Version, Service List and Status
openstack --version openstack service list
- Show Instance Details for Troubleshooting
openstack server show <server-name>
- Network Agent List and Status, Specific Network Details
openstack network agent list openstack network show <network-name>
- Show Volume Details
openstack volume show <volume-name>
- Token Validation
openstack token issue
- Image Details
openstack image show <image-name>
- Stack Events and Details
openstack stack event list/show <stack-name>
- View and Tail Logs
tail -f /var/log/<service-name>/<log-file>
- Ping and Traceroute for Connectivity Issues
- Force Delete Stuck Resources
openstack server delete --force <server-name> openstack volume delete --force <volume-name>
- Structured Output with
-f json
or-f yaml
- Help Option for Detailed Command Usage
- Quota Checks with
openstack quota show
- Regular Service Health Checks
- Fit-Width: To ensure output fits the terminal width without wrapping.
openstack <command> --fit-width
- Select Columns: Display only specified columns in the output.
openstack <command> -c COLUMN1 -c COLUMN2 # or openstack <command> --column COLUMN1 --column COLUMN2
- Output Format: Display output in different formats like JSON, YAML, or table (default).
openstack <command> -f json openstack <command> -f yaml openstack <command> -f table
- No Headers: Hide the table header row in output.
openstack <command> --no-header
- Sort Output: Sort output by a specific column.
openstack <command> --sort-column COLUMN_NAME
- Filter Output: Use the
grep
command to filter output.openstack <command> | grep 'filter-term'
- Combining Commands: Chain commands with Unix pipes for complex filtering.
openstack <command> | grep 'filter-term' | awk '{print $1}'
- Custom Scripts: For complex formatting, consider using custom scripts that parse JSON or YAML output.
- Aliases: Create shell aliases for commonly used commands with specific formatting.
- Scripts: Write shell scripts for complex or frequently used command sequences.