3.6. Managing images¶
3.6.1. vinfra service compute image create¶
Create a new compute image:
usage: vinfra service compute image create [--min-disk <size-gb>] [--min-ram <size-mb>]
[--os-distro <os-distro>] [--protected]
[--unprotected] [--public] [--public]
[--disk-format <disk_format>]
[--container-format <format>]
[--tags <tags>] --file <file> <image-name>
--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.
--disk-format <disk_format>- Disk format
aki,ami,ari,detect,iso,ploop,qcow2,raw,vdi,vhd,vhdx,vmdk(default:detect) --container-format <format>- Container format:
aki,ami,ari,bare,docker,ovf,ova(default:bare) --tags <tags>- A comma-separated list of tags
--file <file>- Create image from a local file
<image-name>- Image name
Example:
# vinfra service compute image create mycirrosimg \
--file /distr/cirros-0.4.0-x86_64-disk.img
Uploading image to server [elapsed time: 0:00:04]... |
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| task_id | 03874663-d03f-4891-a10b-64837e7faf43 |
+---------+--------------------------------------+
This command creates a task to create a Cirros image from the local file and upload it to Acronis Cyber Infrastructure.
Task outcome:
# vinfra task show 03874663-d03f-4891-a10b-64837e7faf43
+---------+------------------------------------------------------------------+
| Field | Value |
+---------+------------------------------------------------------------------+
| details | |
| name | backend.presentation.compute.images.tasks.ImportComputeImageTask |
| result | id: 179f45ef-c5d6-4270-b0c0-085b542544c5 |
| state | success |
| task_id | 03874663-d03f-4891-a10b-64837e7faf43 |
+---------+------------------------------------------------------------------+
3.6.2. vinfra service compute image list¶
List compute images:
usage: vinfra service compute image list [--long] [--limit <num>]
[--marker <image>] [--name <name>]
[--id <id>] [--status <status>]
[--placement <placement>]
[--disk-format <disk-format>]
--long- Enable access and listing of all fields of objects.
--limit <num>- The maximum number of images to list. To list all images, set the option to -1.
--marker <image>- List images after the marker.
--name <name>- List images with the specified name or use a filter. Supported filter operator:
contains. The filter format is<operator>:<value1>[,<value2>,...]. --id <id>- Show an image with the specified ID or list images using a filter. Supported filter operator:
in. The filter format is<operator>:<value1>[,<value2>,...]. --status <status>- List images with the specified status or use a filter. Supported filter operator:
in. The filter format is<operator>:<value1>[,<value2>,...]. --placement <placement>- List images added to a placement with the specified ID or use a filter. Supported filter operator:
any. The filter format is<operator>:<value1>[,<value2>,...]. --disk-format <disk-format>- List images with the specified disk format.
Example:
# vinfra service compute image list
+--------------------------------------+-------------+----------+--------+-------------+
| id | name | size | status | disk_format |
+--------------------------------------+-------------+----------+--------+-------------+
| 179f45ef-c5d6-4270-b0c0-085b542544c5 | mycirrosimg | 12716032 | active | qcow2 |
| 4741274f-5cca-4205-8f66-a2e89fb346cc | cirros | 12716032 | active | qcow2 |
+--------------------------------------+-------------+----------+--------+-------------+
This command lists images available to the compute cluster.
3.6.3. vinfra service compute image show¶
Display compute image details:
usage: vinfra service compute image show <image>
<image>- Image ID or name
Example:
# vinfra service compute image show 4741274f-5cca-4205-8f66-a2e89fb346cc
+------------------+-------------------------------------------------------------------+
| Field | Value |
+------------------+-------------------------------------------------------------------+
| checksum | 443b7623e27ecf03dc9e01ee93f67afe |
| container_format | bare |
| created_at | 2018-09-11T13:29:10Z |
| disk_format | qcow2 |
| file | /api/v2/compute/images/4741274f-5cca-4205-8f66-a2e89fb346cc/file/ |
| id | 4741274f-5cca-4205-8f66-a2e89fb346cc |
| min_disk | 1 |
| min_ram | 0 |
| name | cirros |
| os_distro | linux |
| os_type | linux |
| placements | [] |
| project_id | 72a5db3a033c403a86756021e601ef34 |
| protected | False |
| public | True |
| size | 12716032 |
| status | active |
| tags | [] |
| updated_at | 2018-09-11T13:29:13Z |
| virtual_size | |
+------------------+-------------------------------------------------------------------+
This command shows the details of the default Cirros image.
3.6.4. vinfra service compute image set¶
Modify compute image parameters:
usage: 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
Example:
# vinfra service compute image set 4741274f-5cca-4205-8f66-a2e89fb346cc --protected --min-ram 1
+------------------+-------------------------------------------------------------------+
| Field | Value |
+------------------+-------------------------------------------------------------------+
| checksum | 443b7623e27ecf03dc9e01ee93f67afe |
| container_format | bare |
| created_at | 2018-09-11T13:29:10Z |
| disk_format | qcow2 |
| file | /api/v2/compute/images/4741274f-5cca-4205-8f66-a2e89fb346cc/file/ |
| id | 4741274f-5cca-4205-8f66-a2e89fb346cc |
| min_disk | 1 |
| min_ram | 1 |
| name | cirros |
| os_distro | linux |
| os_type | linux |
| project_id | 72a5db3a033c403a86756021e601ef34 |
| protected | True |
| size | 12716032 |
| status | active |
| tags | [] |
| updated_at | 2018-09-12T09:26:29Z |
| virtual_size | |
| visibility | public |
+------------------+-------------------------------------------------------------------+
This command protects the default Cirros image and sets the minimum RAM size for it to 1 GB.
3.6.5. vinfra service compute image save¶
Download a compute image:
usage: vinfra service compute image save [--file <filename>] <image>
--file <filename>- File to save the image to (default:
stdout) <image>- Image ID or name
Example:
# vinfra service compute image save 4741274f-5cca-4205-8f66-a2e89fb346cc --file cirros.qcow2
Operation successful
This command downloads the default Cirros image to the local disk as cirros.qcow2.
3.6.6. vinfra service compute image delete¶
Delete a compute image:
usage: vinfra service compute image delete <image>
<image>- Image ID or name
Example:
# vinfra service compute image delete 179f45ef-c5d6-4270-b0c0-085b542544c5
Operation successful
This command deletes the image with the ID 179f45ef-c5d6-4270-b0c0-085b542544c5.
Oct 06, 2020