glance上传映像(支持压缩)

来源:互联网 发布:java urlencode 中文 编辑:程序博客网 时间:2024/06/06 05:35

制作一个系统镜像上传到/mnt/image目录下:
centos6.5.img
$ glance image-create –name centos6.5 –disk-format=raw –container-format=bare –is-public=True –file=/mnt/image/centos6.5.img.tar.gz


解释:
–name NAME 上传完镜像在openstack中显示的名称;
–disk-format DISK_FORMAT 镜像格式;openstack支持的格式详情请看官方介绍;
–container-format CONTAINER_FORMAT 图片的容器格式,可以是ami,ari,aki,ovf,bare默认是bare
–owner TENANT_ID 那个租户可以使用此镜像
–size SIZE 这个镜像的大小
–min-disk DISK_GB 这个镜像启动最小需要的大小;
–min-ram DISK_RAM 启动这个镜像需要的最小内存;
–location IMAGE_URL 在web界面中可以使用url地址上传镜像,目前支持http协议的;
–file FILE 镜像所在本地目录;
–checksum CHECKSUM 镜像数据验证;
–is-public [True|False] 是否共享此镜像;共享后其他用户也可以使用此镜像启动instance;


root@node-9:/#  glance image-create --name centos6.5 --disk-format=raw --container-format=bare --is-public=True --file=centos-6.4.img
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 4f85e668c78f52b800b6d85d48000d0e     |
| container_format | bare                                 |
| created_at       | 2016-02-29T19:50:10                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | raw                                  |
| id               | e56aea41-b4ae-4837-9ccf-2dfed4f7afde |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | centos6.5                            |
| owner            | 5dc9e00331a4419baac8bf0817ba0cf3     |
| protected        | False                                |
| size             | 10737418240                          |
| status           | active                               |
| updated_at       | 2016-02-29T19:52:34                  |
| virtual_size     | None                                 |
+------------------+--------------------------------------+
root@node-9:/#



http://blog.chinaunix.net/uid-28863090-id-4203358.html

0 0
原创粉丝点击