OpenStack Cheatsheet
#
OpenStack is a cloud computing platform that provides infrastructure-as-a-service (IaaS) for creating and managing large groups of virtual private servers in a data center. It consists of several components, each designed to manage specific parts of the cloud environment.
Basic Commands
#
Command/Option | Example | Description |
---|
openstack help | openstack help | Display help information for OpenStack commands |
openstack --version | openstack --version | Show the OpenStack client version |
openstack project list | openstack project list | List all projects |
openstack user list | openstack user list | List all users |
openstack role list | openstack role list | List all roles |
openstack service list | openstack service list | List all services |
Authentication
#
Command/Option | Example | Description |
---|
openstack token issue | openstack token issue | Issue a new authentication token |
export OS_PROJECT_NAME | export OS_PROJECT_NAME="my_project" | Set the project name for the session |
export OS_USER_DOMAIN_NAME | export OS_USER_DOMAIN_NAME="default" | Set the user domain for the session |
Compute (Nova)
#
Command/Option | Example | Description |
---|
openstack server list | openstack server list | List all servers |
openstack server show | openstack server show <server_id> | Show details of a specific server |
openstack server create | openstack server create --flavor <flavor_id> --image <image_id> --network <network_id> <server_name> | Create a new server |
openstack server delete | openstack server delete <server_id> | Delete a server |
openstack flavor list | openstack flavor list | List all flavors |
openstack image list | openstack image list | List all images |
Networking (Neutron)
#
Command/Option | Example | Description |
---|
openstack network list | openstack network list | List all networks |
openstack subnet list | openstack subnet list | List all subnets |
openstack router list | openstack router list | List all routers |
openstack port list | openstack port list | List all ports |
openstack network create | openstack network create <network_name> | Create a new network |
openstack subnet create | openstack subnet create --network <network_id> --subnet-range <cidr> <subnet_name> | Create a new subnet |
openstack router create | openstack router create <router_name> | Create a new router |
Storage (Cinder)
#
Command/Option | Example | Description |
---|
openstack volume list | openstack volume list | List all volumes |
openstack volume show | openstack volume show <volume_id> | Show details of a specific volume |
openstack volume create | openstack volume create --size <size_in_gb> <volume_name> | Create a new volume |
openstack volume delete | openstack volume delete <volume_id> | Delete a volume |
Identity (Keystone)
#
Command/Option | Example | Description |
---|
openstack user create | openstack user create --domain default --password <password> <user_name> | Create a new user |
openstack user list | openstack user list | List all users |
openstack role add | openstack role add --project <project_id> --user <user_id> <role_id> | Assign a role to a user in a project |
openstack project create | openstack project create <project_name> | Create a new project |
openstack role list | openstack role list | List all roles |
Image (Glance)
#
Command/Option | Example | Description |
---|
openstack image list | openstack image list | List all images |
openstack image show | openstack image show <image_id> | Show details of a specific image |
openstack image create | openstack image create <image_name> --disk-format <format> --container-format <container_format> --file <image_file> | Create a new image |
openstack image delete | openstack image delete <image_id> | Delete an image |
Volume (Cinder)
#
Command/Option | Example | Description |
---|
openstack volume list | openstack volume list | List all volumes |
openstack volume show | openstack volume show <volume_id> | Show details of a specific volume |
openstack volume create | openstack volume create --size <size_in_gb> <volume_name> | Create a new volume |
openstack volume delete | openstack volume delete <volume_id> | Delete a volume |
Orchestration (Heat)
#
Command/Option | Example | Description |
---|
openstack stack list | openstack stack list | List all stacks |
openstack stack create | openstack stack create --template <template_file> <stack_name> | Create a new stack |
openstack stack delete | openstack stack delete <stack_name> | Delete a stack |
openstack stack show | openstack stack show <stack_name> | Show details of a specific stack |
This cheatsheet covers the most commonly used OpenStack commands and options, helping you manage various aspects of your OpenStack environment, including computing, networking, storage, and more.