Manage an instance
Perform lifecycle operations on an instance, such as resizing, snapshotting, rescuing, or shelving the instance.
To run openstack client commands on the cloud, you must specify the name of the cloud detailed in your clouds.yaml file. You can specify the name of the cloud by using one of the following methods:
- Use the
--os-cloudoption with each command, for example:$ openstack flavor list --os-cloud <cloud_name>Use this option if you access more than one cloud.
- Create an environment variable for the cloud name in your
bashrcfile:`export OS_CLOUD=<cloud_name>`
Resize an instance Copy linkLink copied!
Resize an instance to increase or decrease its memory or CPU count by selecting a new flavor. Resizing rebuilds and restarts the instance, so migrate workloads beforehand to minimize downtime.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
Procedure Copy linkLink copied!
Create an instance snapshot Copy linkLink copied!
A snapshot captures the state of the running disk of an instance as an image. Use snapshots as templates to create new instances from an existing one, or to restore an instance to a previous state.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
About this task Copy linkLink copied!
If you delete an instance on which a snapshot is based, you can use the snapshot image to create a new instance to the same state as the snapshot.
Procedure Copy linkLink copied!
Rescue an instance Copy linkLink copied!
In an emergency such as a system failure or access failure, you can put an instance in rescue mode. This shuts down the instance, reboots it with a new instance disk, and mounts the original instance disk and config drive as a volume on the rebooted instance.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
About this task Copy linkLink copied!
You can connect to the rebooted instance to view the original instance disk to repair the system and recover your data.
Procedure Copy linkLink copied!
Shelve an instance Copy linkLink copied!
Shelving is useful if you have an instance that you are not using, but that you do not want to delete. When you shelve an instance, you retain the instance data and resource allocations, but clear the instance memory.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
About this task Copy linkLink copied!
Depending on the cloud configuration, shelved instances are moved to the SHELVED_OFFLOADED state either immediately or after a timed delay. When SHELVED_OFFLOADED, the instance data and resource allocations are deleted.
When you shelve an instance, the Compute service generates a snapshot image that captures the state of the instance, and allocates a name to the image in the following format: <instance>-shelved. This snapshot image is deleted when the instance is unshelved or deleted.
If you no longer need a shelved instance, you can delete it. You can shelve more than one instance at a time.