By default, images are available for use immediately upon completion of the uploading process. At times, it may be necessary to deactivate an image to prevent users from booting instances with the image, especially in cases where the image may be outdated but must be retained for archival purposes.
When deactivating an image, ensure that you are authenticated as an administrator or are the owner of the image. You will need the following details, at a minimum:
For our examples, the following will be used:
COOKBOOK_UBUNTU_IMAGE
With the OpenStack client installed on our system, we are now able to deactivate an image with the following command:
openstack image set COOKBOOK_UBUNTU_IMAGE --deactivate
No output is returned if the operation is successful. Use the openstack image show
command to reveal the status of the image:
When an image is deactivated in OpenStack, users are unable to boot instances using the image. Attempting to boot an instance with a deactivated image results in an error similar to the following:
Image d120a923-5246-4dca-8f52-51a951bffce5 is not active. (HTTP 400) (Request-ID: req-fb43f34c-982b-4eeb-abb1-76c93ebc2b5f)
Deactivating an image is a useful step in ensuring that images are retained but unusable. Existing instances using the image are not impacted.
Deactivated images can be activated using the openstack image set
command with the --activate
argument.
When activating an image, ensure that you are authenticated as an administrator or are the owner of the image. You will need the following details, at a minimum:
For our examples, the following will be used:
COOKBOOK_UBUNTU_IMAGE
With the OpenStack client installed on our system, we are now able to activate an image with the following command:
openstack image set COOKBOOK_UBUNTU_IMAGE --activate
No output is returned if the operation is successful. Use the openstack image show
command to reveal the status of the image.
3.133.134.17