openstack 命令行管理glance - 镜像管理 (备忘)

(my_new_env) likailiang@pubbeta1-nova10:~$ glance -h |grep image
              [--os-image-url OS_IMAGE_URL] [-U OS_IMAGE_URL]
              [--os-image-api-version OS_IMAGE_API_VERSION]
    add                 DEPRECATED! Use image-create instead.
    delete              DEPRECATED! Use image-delete instead.
    details             DEPRECATED! Use image-list instead.
    image-create        Create a new image.
    image-delete        Delete specified image(s).
    image-download      Download a specific image.
    image-list          List images you can access.
    image-members       DEPRECATED! Use member-list instead.
    image-show          Describe a specific image.
    image-update        Update a specific image.
    index               DEPRECATED! Use image-list instead.
    member-create       Share a specific image with a tenant.
    member-delete       Remove a shared image from a tenant.
    member-images       DEPRECATED! Use member-list instead.
    member-list         Describe sharing permissions by image or tenant.
    show                DEPRECATED! Use image-show instead.
    update              DEPRECATED! Use image-update instead.
                        image-url instead.
                        image-url instead.
                        image-url instead.
  --os-image-url OS_IMAGE_URL
                        DEPRECATED! Use --os-image-url.
  --os-image-api-version OS_IMAGE_API_VERSION

创建镜像:

# glance image-create --name centos5.8_x86_64 --disk-format=qcow2 --container-format=bare --is-public=True --file=/tmp/centos5.8_x86_64_growroot_1.2_20131231.qcow2

列出当前可用镜像以及镜像信息

(my_new_env) likailiang@pubbeta1-nova10:~$ glance image-list 
(my_new_env) likailiang@pubbeta1-nova10:~$ glance details

查询某个镜像详细信息方法

glance image-show

下载镜像(注意文件重定向)

# glance image-download--file /tmp/ centos5.8_x86_64.qcow2   2aad80bf-6fbb-4348-bb20-2c07dbf4f687

删除镜像

# nova image-delete cirros

参考:https://blog.csdn.net/signmem/article/details/19420025

你可能感兴趣的:(OpenStack)