OpenStack is a free, open-source software platform used for building and managing cloud computing infrastructure. It provides a set of interrelated services that control large pools of processing, storage, and networking resources. One of the key features of OpenStack is the ability to automate tasks through the use of command-line tools. In this article, we will take a comprehensive look at the various OpenStack commands that are available for managing and deploying cloud infrastructure. Whether you are a seasoned OpenStack user or just starting out, this article will provide you with a comprehensive list of OpenStack commands and their uses, making it a valuable resource for anyone working with OpenStack.
Experiment with OpenStack on your personal computer, establish a small-scale cloud environment or implement a production-ready OpenStack cluster across numerous physical servers. You have the option to utilize MicroStack or OpenStack Charms , depending on your specific needs.
Keystone
Glance
Neutron
Nova
Cinder
OpenStackClient has a consistent and predictable format for all of its commands.
Commands take the form:
OpenStack command-line interface
openstack [ < global-options > ] <object-1> <action> [ < object-2>] [ < command-arguments > ]
Functions
Commands List users
openstack user list
Show user details
openstack user show <user ID>
Create user
openstack user create --password <password> <user name>
Update user
openstack user set <key> <value> <user ID>
Set user password
openstack user password set
Delete user
openstack user delete <user ID>
Functions
Commands List groups
openstack group list
Show group details
openstack group show <group ID>
Create group
openstack group create <group name>
Update group
openstack group set <key> <value> <group ID>
Add user to group
openstack group add user <group ID> <user ID>
Remove user from
openstack group remove user <group ID> <user ID>
Delete group
openstack group delete <group ID>
Functions
Commands List domains
openstack domain list
Show domain details
openstack domain show <domain ID>
Create domain
openstack domain create <domain name>
Update domain
openstack domain set <key> <value> <domain ID>
Delete domain
openstack domain delete <domain ID>
Functions
Commands List projects
openstack project list
Show group details
openstack project show <project ID>
Create project
openstack project create <project name>
Update project
openstack project set <key> <value> <project ID>
Delete project
openstack project delete <project ID>
Functions
Commands Assign role on project
openstack role add --project <project ID> [--user <user ID> | --group <group ID>] <role name>
Remove role on project
openstack role remove --project <project ID> [--user <user ID> | --group <group ID>] <role name>
Functions
Commands List images
openstack image list
Show image details
openstack image show <image ID>
Create image
openstack image create --disk-format qcow2 --file <file path> <image name>
Update image
openstack image set <key> <value> <image ID>
Delete image
openstack image delete <image ID>
Functions
Commands List flavors
openstack flavor list
Show flavor details
openstack flavor show <flavor name>
Create flavor
openstack flavor create --vcpus <vCPUs> --ram <RAM [MB]> --disk <Disk [GB]> <flavor name>
Update flavor
openstack flavor set <key> <value> <flavor name>
Delete flavor
openstack flavor delete <flavor name>
Functions
Commands List networks
openstack network list
Show network details
openstack network show <network ID>
Create network
openstack network create <network name>
Update network
openstack network set <key> <value> <network ID>
Delete network
openstack network delete <network ID>
Functions
Commands List subnets
openstack subnet list
Show subnet details
openstack subnet show <subnet ID>
Create subnet
openstack subnet create --network <network ID> --subnet-range <subnet CIDR> <subnet name>
Update subnet
openstack subnet set <key> <value> <subnet ID>
Delete subnet
openstack subnet delete <subnet ID>
Functions
Commands List routers
openstack router list
Show router details
openstack router show <router ID>
Create route
openstack router create <router name>
Update router
openstack router set <key> <value> <router ID>
Attach subnet to router
openstack router add subnet <router ID> <subnet ID>
Detach subnet from route
openstack router remove subnet <router ID> <subnet ID>
Delete router
openstack router delete <router ID>
Functions
Commands List security groups
openstack router list
Show security group details
openstack security group show <security group ID>
Create security group
openstack security group create <security group name>
Update security group
openstack security group set <key> <value> <security group ID>
List rules in the security group
openstack security group rule list <security group ID>
Add rule to the security group
openstack security group rule create <key> <value> <security group ID>
Delete rule from the security group
openstack security group rule delete <rule ID>
Delete security group
openstack security group delete <security group ID>
Functions
Commands List key pairs
openstack keypair list
Show key pair details
openstack keypair show <key pair name>
Create kay pair
openstack keypair create --private-key <file path> <key pair name>
Delete key pair
openstack keypair delete <key pair name>
Functions
Commands List instances
openstack server list
Show instance details
openstack server show <instance ID>
Create instance
openstack server create --flavor <flavor name> --image <image ID> --network <network ID> --key-name <key pair name> <instance name>
Update instance
openstack server set <key> <value> <instance ID>
Delete instance
openstack server delete <instance ID>
Functions
Commands List floating IPs
openstack floating ip list
Create floating IP
openstack floating ip create <network ID>
Attach floating IP to instance
openstack server add floating ip <instance ID> <floating IP ID>
Detach floating IP from instance
openstack server remove floating ip <instance ID> <floating IP ID>
Delete floating IP
openstack floating ip delete <floating IP ID>
Functions
Commands List volumes
openstack volume list
Show volume details
openstack volume show <volume ID>
Create volume
openstack volume create --size <size [GB]> <volume name>
Update volume
openstack volume set <key> <value> <volume ID>
Attach the volume to the instance
openstack server add volume <instance ID> <volume ID>
Detach the volume from the instance
openstack server remove volume <instance ID> <volume ID>
Delete volume
openstack volume delete <volume ID>
Functions
Commands List default quotas
penstack quota show --default
Update default quotas
openstack quota set <key> <value> --class default
List project quotas
openstack quota show <project ID>
Update project quotas
openstack quota set <key> <value> <project ID>