Getting started with managing volumes in the OpenStack API
You can use the OpenStack API to generate various scripts to automate your actions on the Public Cloud.
For example, you can create a new high-performance volume to attach to a Public Cloud instance.
Requirements
- Preparing the environment to use the OpenStack API by installing python-cinderclient and python-novaclient
- Setting the OpenStack environment variables
Instructions
Cinder documentation
You can get a list of possible commands by reading the OpenStack client documentation:
Here is the list of the main commands:
You can also get information about a specific command by adding help to it:
You can also consult the OpenStack documentation available on the OpenStack website.
Basic operations
Creating a high-performance volume
- List the volume types:
- Create the 10GB high-speed volume named volume1:
You can install an image on a volume using the --image argument:
In this command, be66762f-b849-43e1-b57c-005d9fe28088 is the Debian 10 image ID.
Attaching a volume to an instance
- List the additional volumes:
The majority of subsequent commands will require the volume ID rather than the name.
- Mount the volume on an instance with the OpenStack client:
- Check that the volume has been properly attached to the instance with the OpenStack client:
Deleting a volume
- Detach volume from instance:
- Delete volume:
Go further
Browse all the Compute guides.
Browse the rest of the OVHcloud US documentation for guides on our other products and services.
Learn more about Public Cloud Compute on the OVHcloud US website.