.. _Managing Images: Managing Images --------------- .. _vinfra service compute image create: vinfra service compute image create ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Create a new compute image: :: usage: vinfra service compute image create [--min-disk ] [--min-ram ] [--os-distro ] [--protected] [--disk-format ] [--container-format ] --file ``--min-disk `` Minimum disk size required to boot from image, in gigabytes ``--min-ram `` Minimum RAM size required to boot from image, in megabytes ``--os-distro `` OS distribution. To list available distributions, run ``service compute cluster show``. ``--protected`` Protect image from deletion ``--disk-format `` Disk format ``aki``, ``ami``, ``ari``, ``detect``, ``iso``, ``ploop``, ``qcow2``, ``raw``, ``vdi``, ``vhd``, ``vhdx``, ``vmdk`` (default: ``detect``) ``--container-format `` Container format: ``aki``, ``ami``, ``ari``, ``bare``, ``docker``, ``ovf``, ``ova`` (default: ``bare``) ``--file `` Create image from a local file ```` 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 |product_name|. 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 | +---------+------------------------------------------------------------------+ .. _vinfra service compute image list: vinfra service compute image list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ List compute images: :: usage: vinfra service compute image list Example: This command lists images available to the compute cluster. :: # 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 | +--------------------------------------+-------------+----------+--------+-------------+ .. _vinfra service compute image show: vinfra service compute image show ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Display compute image details: :: usage: vinfra service compute image show ```` 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 | | project_id | 72a5db3a033c403a86756021e601ef34 | | protected | False | | size | 12716032 | | status | active | | tags | [] | | updated_at | 2018-09-11T13:29:13Z | | virtual_size | | | visibility | public | +------------------+-------------------------------------------------------------------+ This command shows the details of the default Cirros image. .. _vinfra service compute image set: vinfra service compute image set ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modify compute image parameters: :: usage: vinfra service compute image set [--min-disk ] [--min-ram ] [--os-distro ] [--protected] [--name ] ``--min-disk `` Minimum disk size required to boot from image, in gigabytes ``--min-ram `` Minimum RAM size required to boot from image, in megabytes ``--os-distro `` OS distribution. To list available distributions, run ``service compute cluster show``. ``--protected`` Protect image from deletion ``--name `` Image name ```` 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. .. _vinfra service compute image save: vinfra service compute image save ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Download a compute image: :: usage: vinfra service compute image save [--file ] ``--file `` File to save the image to (default: ``stdout``) ```` 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``. .. _vinfra service compute image delete: vinfra service compute image delete ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Delete a compute image: :: usage: vinfra service compute image delete ```` 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``.