Skip to main content

Top Useful Red Hat OpenStack Commands:

Red Hat OpenStack is a powerful cloud platform, and mastering its command-line interface (CLI) can significantly improve your efficiency as an administrator. Here’s a comprehensive guide to some of the most useful OpenStack commands for managing compute, networking, storage, images, and more.

1. Nova (Compute Service) Commands:
Nova is used for managing instances (virtual machines) in OpenStack. 

List all instances (VMs):
# openstack server list
This command will display all the running and stopped instances in your OpenStack environment.

Boot a new instance:
# openstack server create --flavor m1.small --image <IMAGE_ID> --network <NETWORK_ID> --security-group <SEC_GROUP> --key-name <KEY_NAME> <VM_NAME>
Replace <IMAGE_ID>, <NETWORK_ID>, and other placeholders with your actual values to create a new virtual machine.

Optional: If required, you can add it at the end of the command.
--user-data <file-path>: This option allows you to specify a file that contains user-data, which typically includes a cloud-init configuration for automating tasks during the instance’s boot process (such as running scripts, setting up users, configuring networking, etc.).

To create a multiple instance:
# openstack server create --flavor m1.small --image <IMAGE_ID> --network <NETWORK_ID> --security-group <SEC_GROUP> --key-name <KEY_NAME> <VM_NAME> --min <number> --max <number>
Replace <IMAGE_ID>, <NETWORK_ID>, and other placeholders with your actual values to create a new virtual machine.
max_size: Specifies the maximum number of instances that can be created
min_size: Specifies the minimum number of instances that can be created  

Optional: If required, you can add it at the end of the command.
--user-data <file-path>: This option allows you to specify a file that contains user-data, which typically includes a cloud-init configuration for automating tasks during the instance’s boot process (such as running scripts, setting up users, configuring networking, etc.).

Stop an instance:
# openstack server stop <INSTANCE_ID>

Start an instance:
# openstack server start <INSTANCE_ID>

Delete an instance:
# openstack server delete <INSTANCE_ID>

These commands help you control the lifecycle of instances, making it easy to manage your cloud environment. 

2. Neutron (Networking Service) Commands:
Neutron handles the networking functionality in OpenStack.

List all networks:
# openstack network list
Get a full list of all available networks in your OpenStack deployment.

Create a new network:
# openstack network create <NETWORK_NAME>

Create a new subnet:
# openstack subnet create --network <NETWORK_ID> --subnet-range 192.168.1.0/24 <SUBNET_NAME>

Create a floating IP address:
# openstack floating ip create <EXTERNAL_NETWORK>
These commands make managing networks, subnets, and floating IPs straightforward.

3. Cinder (Block Storage Service) Commands:
Cinder provides block storage for OpenStack instances.

List all volumes:
# openstack volume list

Create a new volume:
# openstack volume create --size <SIZE_IN_GB> <VOLUME_NAME>

Attach a volume to an instance:
# openstack server add volume <INSTANCE_ID> <VOLUME_ID>
These commands allow you to manage block storage volumes, from creation to attaching them to VMs.

4. Glance (Image Service) Commands:
Glance manages images in OpenStack, which are used to boot instances. 

List available images:
# openstack image list

Upload a new image:
# openstack image create --file <IMAGE_FILE> --disk-format qcow2 --container-format bare <IMAGE_NAME>

Show details of an image:
# openstack image show <IMAGE_ID>
These commands are essential for managing your image library. 

5. Keystone (Identity Service) Commands:
Keystone handles authentication and authorization in OpenStack. 

List all users:
# openstack user list

Create a new user:
# openstack user create --domain <DOMAIN> --password <PASSWORD> --project <PROJECT NAME OR ID> <USERNAME>
Next, login to openstack portal, go to Identity → Projects, manage members of the project you created earlier and move the user to Project Members and add the role.

List projects:
# openstack project list

Create a new project:
# openstack project create <PROJECT_NAME>
These commands help you manage users, projects, and roles within OpenStack.

6. Heat (Orchestration Service) Commands:
Heat automates cloud deployments using templates.

List all stacks:
# openstack stack list

Create a new stack:
# openstack stack create --template <TEMPLATE_FILE> --parameters "param1=value1;param2=value2" <STACK_NAME>

Delete a stack:
# openstack stack delete <STACK_NAME>

7. Swift (Object Storage Service) Commands: 
Swift provides object storage services in OpenStack.

List containers in Swift:
# openstack container list

Create a new container:
# openstack container create <CONTAINER_NAME>

Upload an object to a container:
# openstack object create <CONTAINER_NAME> <FILE_NAME>

8. General OpenStack Management Commands:
For general management of your OpenStack environment: 

Check OpenStack version:
# openstack --version

List services and their statuses:
# openstack service list

Check resource usage (RAM, CPU, etc.):
# openstack hypervisor stats show
These general commands provide essential information about your OpenStack services and environment. 

By mastering these OpenStack commands, you can efficiently manage compute, networking, storage, images, and more in your Red Hat OpenStack environment. Whether you are a beginner or an experienced administrator, having a handy list of essential commands helps streamline daily operations.

Comments

Popular posts from this blog

temp-1

  🔧 vast_id Configuration Key: vast_id Description This section defines the VAST ID , a unique numeric identifier used by internal systems for asset tracking, automation, or integration with enterprise management platforms. It helps associate the server with inventory records, monitoring tools, or deployment workflows. ✅ Used during provisioning to register the system in centralized databases or orchestration systems. JSON Format json 1 "vast_id" : 12194 ✅ Can also be provided as a string: json 1 "vast_id" : "12194" Field Reference vast_id String or Integer Unique identifier for the system in VAST (Verizon Asset Systems Tracker) 12194 ✅ Must be non-empty and numeric — leading zeros may be stripped depending on system. Validations Enforced vast_id  is required and must be a non-empty string or integer Ensures the field is present and contains usable data If  vast_id  is a string, it must not be blank or whitespace-only Prevents " " , "...

testing

09052025 T-1 { "volume_groups" : { "vgroot" : { "vgsize" : "304G" , "fs_type" : "xfs" } } , "logical_volumes" : { "root" : { "lvroot" : { "vgname" : "vgroot" , "lvname" : "lvroot" , "lvsize" : "12G" , "mountpoint" : "/" , "purpose" : "root filesystem" , "disk" : 1 , "partition" : 2 } } , "swap" : { "lvswap" : { "vgname" : "vgroot" , "lvname" : "lvswap" , "lvsize" : "4G" , "mountpoint" : "NA" , "purpose" : "swap" , "disk" : 1 , "partit...

temp

 {   "_id": {     "$oid": "6841e4b0fd270b2ab92d7eaa"   },   // 📌 [Auto-generated]   // Description: Unique system identifier for internal use (MongoDB ObjectId).   // Type: ObjectId (string)   // Required: No (automatically handled)   "vast_id": "21452",   // 📌 [Required]   // Description: Your unique request ID or reference number.   // Type: string   // Format: Numeric string (e.g., "21452")   // Example: "21452"   "env": "dev",   // 📌 [Required]   // Description: The environment where the VM will be deployed.   // Type: string   // Allowed values: "dev", "qa", "uat", "prod"   // Example: "dev" for development, "prod" for production   "ver": "0.2",   // 📌 [Do Not Modify]   // Description: Template version. Used by automation to ensure compatibility.   // Type: string   // Format: Semantic versioning (e.g., "...