OpenStack Command List
OpenStack is an open-source cloud computing platform designed to manage large pools of compute, storage, and networking resources through a web-based dashboard or command-line interface. It enables users to create and manage virtual machines and other resources in a scalable and flexible cloud environment.
Additionally, OpenStack provides a modular architecture with various components (such as Nova for compute, Cinder for block storage, and Neutron for networking) that can be customized and scaled according to the needs of different companies and applications.
Install
This command installs OpenStack using the snap package manager. Use this command when you want to set up OpenStack on your machine.
$ sudo snap install openstack
This command prepares the node for OpenStack installation and changes the group to snap_daemon. Use this command after installing OpenStack to prepare the environment.
$ sunbeam prepare-node-script | bash -x && newgrp snap_daemon
This command bootstraps the OpenStack cluster with default settings. Use this command to initialize the OpenStack cluster setup.
$ sunbeam cluster bootstrap --accept-defaults
This command configures the OpenStack environment with default settings and the specified OpenRC file. Use this command to complete the configuration of your OpenStack setup.
$ sunbeam configure --accept-defaults --openrc demo-openrc
Launch Test Instance
This command launches a test instance of Ubuntu in OpenStack. Use this command to verify that your OpenStack installation is working correctly by launching a test instance.
$ sunbeam launch ubuntu -n test
Interact
Obtain OpenStack Dashboard URL
This command retrieves the URL for the OpenStack dashboard. Use this command to access the OpenStack dashboard for managing your cloud environment.
$ sunbeam dashboard-url
Generate Admin RC File
This command generates the admin OpenRC file, which contains the necessary environment variables for OpenStack CLI operations. Use this command to create an OpenRC file for admin access.
$ sunbeam openrc > admin_openrc
Source RC File
This command sources the specified OpenRC file to set environment variables for OpenStack CLI operations. Use this command to load the OpenRC file before running OpenStack CLI commands.
source <file path>
List OpenStack Services
This command lists all the available OpenStack services in the service catalog. Use this command to view the services that are available in your OpenStack environment.
openstack catalog list
Domains
List Domains
openstack domain list
This command lists all domains in the OpenStack environment. Use this command to view the available domains.
openstack domain list
Show Domain Details
This command shows details of a specific domain by its ID. Use this command to get detailed information about a domain.
openstack domain show <domain ID>
Create Domain
This command creates a new domain with the specified name. Use this command to add a new domain to your OpenStack environment.
openstack domain create <domain name>
Update Domain
This command updates the specified domain with new key-value pairs. Use this command to modify the properties of an existing domain.
openstack domain set <key> <value> <domain ID>
Users
List Users
openstack user list
This command lists all users in the OpenStack environment. Use this command to view the available users.
openstack user list
Show User Details
This command shows details of a specific user by their ID. Use this command to get detailed information about a user.
openstack user show <user ID>
Create User
This command creates a new user with the specified name and password. Use this command to add a new user to your OpenStack environment.
openstack user create --password <password> <user name>
Update User
This command updates the specified user with new key-value pairs. Use this command to modify the properties of an existing user.
openstack user set <key> <value> <user ID>
Set User Password
This command sets a new password for the specified user. Use this command to change the password of an existing user.
openstack user password set
Delete User
This command deletes the specified user by their ID. Use this command to remove a user from your OpenStack environment.
openstack user delete <user ID>
Groups
List Groups
This command lists all groups in the OpenStack environment. Use this command to view the available groups.
openstack group list
Show Group Details
This command shows details of a specific group by their ID. Use this command to get detailed information about a group.
openstack group show <group ID>
Create Group
This command creates a new group with the specified name. Use this command to add a new group to your OpenStack environment.
openstack group create <group name>
Update Group
This command updates the specified group with new key-value pairs. Use this command to modify the properties of an existing group.
openstack group set <key> <value> <group ID>
Add User to Group
This command adds a user to the specified group by their IDs. Use this command to manage group memberships.
openstack group add user <group ID> <user ID>
Remove User from Group
This command removes a user from the specified group by their IDs. Use this command to manage group memberships.
openstack group remove user <group ID> <user ID>
Delete Group
This command deletes the specified group by their ID. Use this command to remove a group from your OpenStack environment.
openstack group delete <group ID>
Projects
List Projects
This command lists all projects in the OpenStack environment. Use this command to view the available projects.
openstack project list
Show Project Details
This command shows details of a specific project by their ID. Use this command to get detailed information about a project.
openstack project show <project ID>
Create Project
This command creates a new project with the specified name. Use this command to add a new project to your OpenStack environment.
openstack project create <project name>
Update Project
This command updates the specified project with new key-value pairs. Use this command to modify the properties of an existing project.
openstack project set <key> <value> <project ID>
Delete Project
This command deletes the specified project by their ID. Use this command to remove a project from your OpenStack environment.
openstack project delete <project ID>
Roles
Assign Role on Project
This command assigns a role to a user or group within a specific project. Use this command to manage project roles and permissions.
openstack role add --project <project ID> [--user <user ID> | --group <group ID>] <role name>
Remove Role on Project
This command removes a role from a user or group within a specific project. Use this command to manage project roles and permissions.
openstack role remove --project <project ID> [--user <user ID> | --group <group ID>] <role name>
Images
List Images
This command lists all images in the OpenStack environment. Use this command to view the available images.
openstack image list
Show Image Details
This command shows details of a specific image by their ID. Use this command to get detailed information about an image.
openstack image show <image ID>
Create Image
This command creates a new image from a specified file in the qcow2 format. Use this command to add a new image to your OpenStack environment.
openstack image create --disk-format qcow2 --file <file path> <image name>
Update Image
This command updates the specified image with new key-value pairs. Use this command to modify the properties of an existing image.
openstack image set <key> <value> <image ID>
Delete Image
This command deletes the specified image by their ID. Use this command to remove an image from your OpenStack environment.
openstack image delete <image ID>
Flavors
List Flavors
This command lists all flavors in the OpenStack environment. Use this command to view the available flavors.
openstack flavor list
Show Flavor Details
This command shows details of a specific flavor by its name. Use this command to get detailed information about a flavor.
openstack flavor show <flavor name>
Create Flavor
This command creates a new flavor with the specified RAM, disk, and VCPU configurations. Use this command to add a new flavor to your OpenStack environment.
openstack flavor create --ram <MB> --disk <GB> --vcpus <count> <flavor name>
Update Flavor
This command updates the specified flavor with new key-value pairs. Use this command to modify the properties of an existing flavor.
openstack flavor set <key> <value> <flavor name>
Delete Flavor
This command deletes the specified flavor by its name. Use this command to remove a flavor from your OpenStack environment.
openstack flavor delete <flavor name>
Networks
List Networks
This command lists all networks in the OpenStack environment. Use this command to view the available networks.
openstack network list
Show Network Details
This command shows details of a specific network by its name. Use this command to get detailed information about a network.
openstack network show <network name>
Create Network
This command creates a new network with the specified name. Use this command to add a new network to your OpenStack environment.
openstack network create <network name>
Update Network
This command updates the specified network with new key-value pairs. Use this command to modify the properties of an existing network.
openstack network set <key> <value> <network name>
Delete Network
This command deletes the specified network by its name. Use this command to remove a network from your OpenStack environment.
openstack network delete <network name>
Subnets
List Subnets
This command lists all subnets in the OpenStack environment. Use this command to view the available subnets.
openstack subnet list
Show Subnet Details
This command shows details of a specific subnet by its name. Use this command to get detailed information about a subnet.
openstack subnet show <subnet name>
Create Subnet
This command creates a new subnet within a specified network with a given CIDR. Use this command to add a new subnet to your OpenStack environment.
openstack subnet create --network <network name> --subnet-range <CIDR> <subnet name>
Update Subnet
This command updates the specified subnet with new key-value pairs. Use this command to modify the properties of an existing subnet.
openstack subnet set <key> <value> <subnet name>
Delete Subnet
This command deletes the specified subnet by its name. Use this command to remove a subnet from your OpenStack environment.
openstack subnet delete <subnet name>
Routers
List Routers
This command lists all routers in the OpenStack environment. Use this command to view the available routers.
openstack router list
Show Router Details
This command shows details of a specific router by its name. Use this command to get detailed information about a router.
openstack router show <router name>
Create Router
This command creates a new router with the specified name. Use this command to add a new router to your OpenStack environment.
openstack router create <router name>
Update Router
This command updates the specified router with new key-value pairs. Use this command to modify the properties of an existing router.
openstack router set <key> <value> <router name>
Delete Router
This command deletes the specified router by its name. Use this command to remove a router from your OpenStack environment.
openstack router delete <router name>
Ports
List Ports
This command lists all ports in the OpenStack environment. Use this command to view the available ports.
openstack port list
Show Port Details
This command shows details of a specific port by its name. Use this command to get detailed information about a port.
openstack port show <port name>
Create Port
This command creates a new port within a specified network. Use this command to add a new port to your OpenStack environment.
openstack port create --network <network name> <port name>
Update Port
This command updates the specified port with new key-value pairs. Use this command to modify the properties of an existing port.
openstack port set <key> <value> <port name>
Delete Port
This command deletes the specified port by its name. Use this command to remove a port from your OpenStack environment.
openstack port delete <port name>
Security Groups
List Security Groups
This command lists all security groups in the OpenStack environment. Use this command to view the available security groups.
openstack security group list
Show Security Group Details
This command shows details of a specific security group by its name. Use this command to get detailed information about a security group.
openstack security group show <security group name>
Create Security Group
This command creates a new security group with the specified name. Use this command to add a new security group to your OpenStack environment.
openstack security group create <security group name>
Update Security Group
This command updates the specified security group with new key-value pairs. Use this command to modify the properties of an existing security group.
openstack security group set <key> <value> <security group name>
Delete Security Group
This command deletes the specified security group by its name. Use this command to remove a security group from your OpenStack environment.
openstack security group delete <security group name>
Security Group Rules
List Security Group Rules
This command lists all security group rules in the OpenStack environment. Use this command to view the available security group rules.
openstack security group rule list
Show Security Group Rule Details
This command shows details of a specific security group rule by its ID. Use this command to get detailed information about a security group rule.
openstack security group rule show <rule ID>
Create Security Group Rule
This command creates a new security group rule with the specified protocol, destination port, source IP, and security group name. Use this command to add a new rule to your security group.
openstack security group rule create --protocol <protocol> --dst-port <port> --src-ip <CIDR> <security group name>
Delete Security Group Rule
This command deletes the specified security group rule by its ID. Use this command to remove a rule from your security group.
openstack security group rule delete <rule ID>
Floating IPs
List Floating IPs
This command lists all floating IPs in the OpenStack environment. Use this command to view the available floating IPs.
openstack floating ip list
Show Floating IP Details
This command shows details of a specific floating IP by its address. Use this command to get detailed information about a floating IP.
openstack floating ip show <floating IP address>
Create Floating IP
This command creates a new floating IP in the specified public network. Use this command to allocate a new floating IP in your OpenStack environment.
openstack floating ip create <public network name>
Delete Floating IP
This command deletes the specified floating IP by its address. Use this command to release a floating IP from your OpenStack environment.
openstack floating ip delete <floating IP address>
Security Groups
List Security Groups
This command lists all security groups in the OpenStack environment. Use this command to view the available security groups.
openstack security group list
Show Security Group Details
This command shows details of a specific security group by its ID. Use this command to get detailed information about a security group.
openstack security group show <security group ID>
Create Security Group
This command creates a new security group with the specified name. Use this command to add a new security group to your OpenStack environment.
openstack security group create <security group name>
Delete Security Group
This command deletes the specified security group by its ID. Use this command to remove a security group from your OpenStack environment.
openstack security group delete <security group ID>
Security Group Rules
List Security Group Rules
This command lists all security group rules in the OpenStack environment. Use this command to view the available security group rules.
openstack security group rule list
Show Security Group Rule Details
This command shows details of a specific security group rule by its ID. Use this command to get detailed information about a security group rule.
openstack security group rule show <rule ID>
Create Security Group Rule
This command creates a new security group rule with the specified protocol, destination port, source IP, and security group ID. Use this command to add a new rule to your security group.
openstack security group rule create --protocol <protocol> --dst-port <port> --src-ip <CIDR> --ingress <security group ID>
Delete Security Group Rule
This command deletes the specified security group rule by its ID. Use this command to remove a rule from your security group.
openstack security group rule delete <rule ID>
Floating IPs
List Floating IPs
This command lists all floating IPs in the OpenStack environment. Use this command to view the available floating IPs.
openstack floating ip list
Show Floating IP Details
This command shows details of a specific floating IP by its ID. Use this command to get detailed information about a floating IP.
openstack floating ip show <floating IP ID>
Create Floating IP
This command creates a new floating IP in the specified public network. Use this command to allocate a new floating IP in your OpenStack environment.
openstack floating ip create <public network ID>
Delete Floating IP
This command deletes the specified floating IP by its ID. Use this command to release a floating IP from your OpenStack environment.
openstack floating ip delete <floating IP ID>
Volumes
List Volumes
This command lists all volumes in the OpenStack environment. Use this command to view the available volumes.
openstack volume list
Show Volume Details
This command shows details of a specific volume by its ID. Use this command to get detailed information about a volume.
openstack volume show <volume ID>
Create Volume
This command creates a new volume with the specified size, type, and name. Use this command to add a new volume to your OpenStack environment.
openstack volume create --size <size> --type <volume type> <volume name>
Delete Volume
This command deletes the specified volume by its ID. Use this command to remove a volume from your OpenStack environment.
openstack volume delete <volume ID>
Volume Snapshots
List Volume Snapshots
This command lists all volume snapshots in the OpenStack environment. Use this command to view the available volume snapshots.
openstack volume snapshot list
Show Volume Snapshot Details
This command shows details of a specific volume snapshot by its ID. Use this command to get detailed information about a volume snapshot.
openstack volume snapshot show <snapshot ID>
Create Volume Snapshot
This command creates a new volume snapshot from the specified volume with the given name. Use this command to take a snapshot of a volume in your OpenStack environment.
openstack volume snapshot create --volume <volume ID> <snapshot name>
Delete Volume Snapshot
This command deletes the specified volume snapshot by its ID. Use this command to remove a snapshot from your OpenStack environment.
openstack volume snapshot delete <snapshot ID>
Images
List Images
openstack image list
This command lists all images in the OpenStack environment. Use this command to view the available images.
openstack image list
Show Image Details
This command shows details of a specific image by its ID. Use this command to get detailed information about an image.
openstack image show <image ID>
Create Image
This command creates a new image from the specified file with the given disk format, container format, and name. Use this command to add a new image to your OpenStack environment.
openstack image create --file <file path> --disk-format <format> --container-format <format> <image name>
Delete Image
This command deletes the specified image by its ID. Use this command to remove an image from your OpenStack environment.
openstack image delete <image ID>
Networks
List Networks
This command lists all networks in the OpenStack environment. Use this command to view the available networks.
openstack network list
Show Network Details
This command shows details of a specific network by its ID. Use this command to get detailed information about a network.
openstack network show <network ID>
Create Network
This command creates a new network with the specified name. Use this command to add a new network to your OpenStack environment.
openstack network create <network name>
Delete Network
This command deletes the specified network by its ID. Use this command to remove a network from your OpenStack environment.
openstack network delete <network ID>
Subnets
List Subnets
This command lists all subnets in the OpenStack environment. Use this command to view the available subnets.
openstack subnet list
Show Subnet Details
This command shows details of a specific subnet by its ID. Use this command to get detailed information about a subnet.
openstack subnet show <subnet ID>
Create Subnet
This command creates a new subnet in the specified network with the given subnet range and name. Use this command to add a new subnet to your OpenStack environment.
openstack subnet create --network <network ID> --subnet-range <CIDR> <subnet name>
Delete Subnet
This command deletes the specified subnet by its ID. Use this command to remove a subnet from your OpenStack environment.
openstack subnet delete <subnet ID>
Routers
List Routers
This command lists all routers in the OpenStack environment. Use this command to view the available routers.
openstack router list
Show Router Details
This command shows details of a specific router by its ID. Use this command to get detailed information about a router.
openstack router show <router ID>
Create Router
This command creates a new router with the specified name. Use this command to add a new router to your OpenStack environment.
openstack router create <router name>
Delete Router
This command deletes the specified router by its ID. Use this command to remove a router from your OpenStack environment.
openstack router delete <router ID>
Add Interface to Router
This command adds a subnet interface to the specified router. Use this command to connect a subnet to a router in your OpenStack environment.
openstack router add subnet <router ID> <subnet ID>
Remove Interface from Router
This command removes a subnet interface from the specified router. Use this command to disconnect a subnet from a router in your OpenStack environment.
openstack router remove subnet <router ID> <subnet ID>
Security Group Rules
List Security Group Rules
openstack security group rule list
This command lists all security group rules in the OpenStack environment. Use this command to view the available security group rules.
openstack security group rule list
Show Security Group Rule Details
This command shows details of a specific security group rule by its ID. Use this command to get detailed information about a security group rule.
openstack security group rule show <rule ID>
Create Security Group Rule
This command creates a new security group rule with the specified protocol, destination port, source IP, and security group ID. Use this command to add a new rule to your security group.
openstack security group rule create --protocol <protocol> --dst-port <port> --src-ip <CIDR> --ingress <security group ID>
Delete Security Group Rule
This command deletes the specified security group rule by its ID. Use this command to remove a rule from your security group.
openstack security group rule delete <rule ID>
Ports
List Ports
This command lists all ports in the OpenStack environment. Use this command to view the available ports.
openstack port list
Show Port Details
openstack port show <port ID>
This command shows details of a specific port by its ID. Use this command to get detailed information about a port.
openstack port show <port ID>
Create Port
This command creates a new port in the specified network with the given name. Use this command to add a new port to your OpenStack environment.
openstack port create --network <network ID> <port name>
Delete Port
This command deletes the specified port by its ID. Use this command to remove a port from your OpenStack environment.
openstack port delete <port ID>
Floating IPs
List Floating IPs
This command lists all floating IPs in the OpenStack environment. Use this command to view the available floating IPs.
openstack floating ip list
Show Floating IP Details
This command shows details of a specific floating IP by its ID. Use this command to get detailed information about a floating IP.
openstack floating ip show <floating IP ID>
OpenStack Key Pair Commands
List Key Pairs
openstack keypair list
This command lists all the key pairs currently registered in the OpenStack environment. It shows key pair names and associated IDs.
Show Key Pair Details
openstack keypair show <key pair name>
This command displays detailed information about a specific key pair, identified by <key pair name>
. It includes details such as the key’s fingerprint and the public key.
Create Key Pair
openstack keypair create --private-key <file path> <key pair name>
This command creates a new key pair with the specified name and saves the private key to the file path provided. Replace <file path>
with the path where the private key will be saved and <key pair name>
with the desired name for the key pair.
Delete Key Pair
openstack keypair delete <key pair name>
This command deletes an existing key pair identified by <key pair name>
. The key pair and its associated public key are removed from the OpenStack environment.
Instance Commands
List Instances
openstack server list
This command lists all the instances currently running in the OpenStack environment. It provides a summary of each instance, including its ID, name, and status.
Show Instance Details
openstack server show <instance name>
This command displays detailed information about a specific instance, identified by <instance name>
. It provides information such as its ID, status, flavor, and network details.
Create Instance
openstack server create --flavor <flavor name> --image <image ID> --network <network ID> --key-name <key pair name> <instance name>
This command creates a new instance with the specified parameters: <flavor name>
(the flavor to use), <image ID>
(the image to boot from), <network ID>
(the network to attach to), <key pair name>
(the SSH key pair for access), and <instance name>
(the name of the new instance).
Update Instance
openstack server set <key> <value> <instance ID>
This command updates specific attributes of an existing instance. Replace <key>
with the attribute to update, <value>
with the new value, and <instance ID>
with the instance’s ID.
Delete Instance
openstack server delete <instance ID>
This command deletes an instance identified by <instance ID>
. The instance and its associated resources will be permanently removed from the environment.
Quota Commands
List Default Quotas
openstack quota show --default
This command lists the default quotas set for the OpenStack environment. Default quotas define the limits applied to all projects unless overridden by specific project quotas.
Update Default Quotas
openstack quota set <key> <value> --class default
This command updates the default quota value for a specified resource type. Replace <key>
with the resource type (e.g., instances) and <value>
with the new quota value.
List Project Quotas
openstack quota show <project ID>
This command lists the quota limits for a specific project, identified by <project ID>
. It shows how many resources are allowed for that project.
Update Project Quotas
openstack quota set <key> <value> <project ID>
This command updates the quota value for a specific resource type for a given project. Replace <key>
with the resource type (e.g., instances), <value>
with the new quota value, and <project ID>
with the project’s ID.
Teardown
sudo snap stop openstack
This command stops the OpenStack snap service, which halts its operation but does not remove it.
Start OpenStack
sudo snap start openstack
This command starts the OpenStack snap service if it has been stopped or disabled.
Disable OpenStack
sudo snap disable openstack
This command disables the OpenStack snap service, preventing it from starting automatically on boot. However, the service is not stopped.
Enable OpenStack
sudo snap enable openstack
This command enables the OpenStack snap service, allowing it to start automatically on boot if it was previously disabled.
Uninstall OpenStack
sudo snap remove --purge openstack
This command removes the OpenStack snap service and all its data from the system, effectively uninstalling it.
This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.
This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.