Managing images
Images stored in the compute cluster can be downloaded to a client's machine, edited, and removed.
To protect images with third-party software licenses, system administrators can disallow image download for self-service users. In this case, VM volumes created from such images will inherit this property and once converted back to images can only be downloaded by system administrators.
Limitations
- Images are stored according to the default storage policy.
- When you install the load balancer or Kubernetes service, special images appear in the compute cluster, which are used by the system for creating service VMs. Such images are marked with the System tag and cannot be modified or deleted in the admin panel.
Prerequisites
- Images are added to the compute cluster, as described in Uploading images for virtual machines.
To download an image
Admin panel
- Go to the Compute > Virtual machines > Images tab, and then click the ellipsis button next to the required image.
- Click Download image.
The image will be downloaded to the your machine.
Command-line interface
Use the following command:
vinfra service compute image save [--file <filename>] <image>
--file <filename>
- File to save the image to (default:
stdout
) <image>
- Image ID or name
For example, to download the image cirros
to the local disk as cirros.qcow2
, run:
# vinfra service compute image save cirros --file cirros.qcow2
To edit an image
Admin panel
- Go to the Compute > Virtual machines > Images tab, and then click the required image.
- On the image right pane, click the pencil icon next to a parameter you need to change. You can change the image name, OS type, and network access. For templates, you can also edit the minimum volume size.
Command-line interface
Use the following command:
vinfra service compute image set [--min-disk <size-gb>] [--min-ram <size-mb>] [--os-distro <os-distro>] [--protected | --unprotected] [--public] [--private] [--name <name>] <image>
--min-disk <size-gb>
- Minimum disk size required to boot from image, in gigabytes
--min-ram <size-mb>
- Minimum RAM size required to boot from image, in megabytes
--os-distro <os-distro>
- OS distribution. To list available distributions, run
vinfra service compute cluster show
. --protected
- Protect image from deletion.
--unprotected
- Allow image to be deleted.
--public
- Make image accessible to all users.
--private
- Make image accessible only to the owners.
--name <name>
- Image name
<image>
- Image ID or name
For example, to make the image cirros
accessible to all users and set the minimum RAM size for it to 1 GB, run:
# vinfra service compute image set cirros --public --min-ram 1
To manage image restrictions
Use the following command:
vinfra service compute image set [--restricted| --unrestricted] <image>
--restricted
- Make image download restricted
--unrestricted
- Allow image to be downloaded
For example, to disallow the image cirros
to be downloaded by self-service users, run:
# vinfra service compute image set cirros --restricted
To remove an image
Admin panel
- Go to the Compute > Virtual machines > Images tab, and then click the ellipsis button next to the required image.
- Click Delete.
Command-line interface
Use the following command:
vinfra service compute image delete <image>
<image>
- Image ID or name
For example, to delete the image cirros
, run:
# vinfra service compute image delete cirros