Example1)
Glance ÀúÀå¼Ò(/var/lib/glance/images)¿¡ ÆÄÀÏ·Î Á¸ÀçÇÏÁö ¾Ê°í ¿äû½Ã¸¶´Ù ´ÙÀÌ·ºÆ® ´Ù¿î·Îµå
root@controller:~# glance --os-image-api-version 1 image-create --name "url_cirros" --location "http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img" --disk-format qcow2 --container-format bare --progress
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2015-12-29T07:20:16.000000 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 4a17c952-2c74-4ecb-b799-f7bd19438e3a |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | url_cirros |
| owner | 05b2b44dafd446059e0d5bc90c99800c |
| protected | False |
| size | 13200896 |
| status | active |
| updated_at | 2015-12-29T07:20:17.000000 |
| virtual_size | None |
+------------------+--------------------------------------+
root@controller:~# glance image-show 4a17c952-2c74-4ecb-b799-f7bd19438e3a
+------------------+---------------------------------------------------------------------+
| Property | Value |
+------------------+---------------------------------------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2015-12-29T07:20:16Z |
| direct_url | http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img |
| disk_format | qcow2 |
| id | 4a17c952-2c74-4ecb-b799-f7bd19438e3a |
| min_disk | 0 |
| min_ram | 0 |
| name | url_cirros |
| owner | 05b2b44dafd446059e0d5bc90c99800c |
| protected | False |
| size | 13200896 |
| status | active |
| tags | [] |
| updated_at | 2015-12-29T07:20:17Z |
| virtual_size | None |
| visibility | private |
+------------------+---------------------------------------------------------------------+
Example2)
Glance ÀúÀå¼Ò³»¿¡ URL À̹ÌÁö ´Ù¿î·Îµå ÀúÀå
# glance --os-image-api-version 1 image-create --name "url_cirros" --copy-from "http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img" --disk-format qcow2 --container-format bare --progress
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2015-12-29T07:39:04.000000 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 17d4fc05-df9f-4d02-ba73-fb6b93d524bf |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | url_cirros |
| owner | 05b2b44dafd446059e0d5bc90c99800c |
| protected | False |
| size | 13200896 |
| status | queued |
| updated_at | 2015-12-29T07:39:04.000000 |
| virtual_size | None |
+------------------+--------------------------------------+
root@controller:/var/lib/glance/images# glance image-show 17d4fc05-df9f-4d02-ba73-fb6b93d524bf
+------------------+--------------------------------------------------------------------+
| Property | Value |
+------------------+--------------------------------------------------------------------+
| checksum | 133eae9fb1c98f45894a4e60d8736619 |
| container_format | bare |
| created_at | 2015-12-29T07:39:04Z |
| direct_url | file:///var/lib/glance/images/17d4fc05-df9f-4d02-ba73-fb6b93d524bf |
| disk_format | qcow2 |
| id | 17d4fc05-df9f-4d02-ba73-fb6b93d524bf |
| min_disk | 0 |
| min_ram | 0 |
| name | url_cirros |
| owner | 05b2b44dafd446059e0d5bc90c99800c |
| protected | False |
| size | 13200896 |
| status | active |
| tags | [] |
| updated_at | 2015-12-29T07:39:10Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------------------------------------+
# glance --os-image-api-version 1 help image-create
usage: glance image-create [--id <IMAGE_ID>] [--name <NAME>] [--store <STORE>]
[--disk-format <DISK_FORMAT>]
[--container-format <CONTAINER_FORMAT>]
[--owner <TENANT_ID>] [--size <SIZE>]
[--min-disk <DISK_GB>] [--min-ram <DISK_RAM>]
[--location <IMAGE_URL>] [--file <FILE>]
[--checksum <CHECKSUM>] [--copy-from <IMAGE_URL>]
[--is-public {True,False}]
[--is-protected {True,False}]
[--property <key=value>] [--human-readable]
[--progress]
Optional arguments:
--id <IMAGE_ID> ID of image to reserve.
--name <NAME> Name of image.
--store <STORE> Store to upload image to.
--disk-format <DISK_FORMAT>
Disk format of image. Acceptable formats: ami, ari,
aki, vhd, vmdk, raw, qcow2, vdi, and iso.
--container-format <CONTAINER_FORMAT>
Container format of image. Acceptable formats: ami,
ari, aki, bare, and ovf.
--owner <TENANT_ID> Tenant who should own image.
--size <SIZE> Size of image data (in bytes). Only used with '--
location' and '--copy_from'.
--min-disk <DISK_GB> Minimum size of disk needed to boot image (in
gigabytes).
--min-ram <DISK_RAM> Minimum amount of ram needed to boot image (in
megabytes).
--location <IMAGE_URL>
URL where the data for this image already resides. For
example, if the image data is stored in swift, you
could specify 'swift+http://tenant%3Aaccount:key@auth_
url/v2.0/container/obj'. (Note: '%3A' is ':' URL
encoded.)
--file <FILE> Local file that contains disk image to be uploaded
during creation. Alternatively, images can be passed
to the client via stdin.
--checksum <CHECKSUM>
Hash of image data used Glance can use for
verification. Provide a md5 checksum here.
--copy-from <IMAGE_URL>
Similar to '--location' in usage, but this indicates
that the Glance server should immediately copy the
data and store it in its configured image store.
--is-public {True,False}
Make image accessible to the public.
--is-protected {True,False}
Prevent image from being deleted.
--property <key=value>
Arbitrary property to associate with image. May be
used multiple times.
--human-readable Print image size in a human-friendly format.
--progress Show upload progress bar.