潇湘夜雨移动版

主页 > 系统 > 云计算与云原生 >

openstack-havana云平台实验(4)

[root@node1 ~(keystone_admin)]# glance image-list
/usr/lib/python2.6/site-packages/glanceclient/client.py:26: DeprecationWarning: `version` keyword is being deprecated. Please pass the version as part of the URL. http://$HOST:$PORT/v$VERSION_NUMBER
 DeprecationWarning)
+----+------+-------------+------------------+------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+----+------+-------------+------------------+------+--------+
+----+------+-------------+------------------+------+--------+
 
2.2 创建映像文件
为了使用方便,这里采用CirrOS项目制作的映像文件,其也经常被拿来测试Openstack的部署。其地址为https://launchpad.net/cirros,可以按需下载所想尝试使用的版本。这里以cirros-0.3.0-i386-disk.img和cirros-0.3.0-x86_64-disk.img为例。
# mkdir /stackimages
# cd /stackimages
# wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-i386-disk.img
# wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
[root@node1 stackimages(keystone_admin)]# qemu-img info cirros-0.3.0-i386-disk.img #查看映像信息
image: cirros-0.3.0-i386-disk.img
file format: qcow2
virtual size: 39M (41126400 bytes)
disk size: 8.7M
cluster_size: 65536
[root@node1 stackimages(keystone_admin)]#  qemu-img info cirros-0.3.0-x86_64-disk.img 
image: cirros-0.3.0-x86_64-disk.img
file format: qcow2
virtual size: 39M (41126400 bytes)
disk size: 9.3M
cluster_size: 65536
 
接下上传cirros两个映像文件。
 
[root@node1 stackimages(keystone_admin)]# glance image-create --name=cirros-0.3.0-i386 --disk-format=qcow2 --container-format=bare < /stackimages/cirros-0.3.0-i386-disk.img 
/usr/lib/python2.6/site-packages/glanceclient/client.py:26: DeprecationWarning: `version` keyword is being deprecated. Please pass the version as part of the URL. http://$HOST:$PORT/v$VERSION_NUMBER
 DeprecationWarning)
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 90169ba6f09b5906a7f0755bd00bf2c3     |
| container_format | bare                                 |
| created_at       | 2016-10-03T03:15:02                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | b142e3c1-98a2-41cb-9049-146d44e7d184 |
| is_public        | False                                |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros-0.3.0-i386                    |
| owner            | a8fbb58fe9c24de38d3290573ecf565a     |
| protected        | False                                |
| size             | 9159168                              |
| status           | active                               |
| updated_at       | 2016-10-03T03:15:02                  |
+------------------+--------------------------------------+
[root@node1 stackimages(keystone_admin)]# glance image-create --name=cirros-0.3.0-x86_64 --disk-format=qcow2 --container-format=bare < /stackimages/cirros-0.3.0-x86_64-disk.img 
/usr/lib/python2.6/site-packages/glanceclient/client.py:26: DeprecationWarning: `version` keyword is being deprecated. Please pass the version as part of the URL. http://$HOST:$PORT/v$VERSION_NUMBER
 DeprecationWarning)
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 50bdc35edb03a38d91b1b071afb20a3c     |
| container_format | bare                                 |
| created_at       | 2016-10-03T03:15:35                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | b538f4f8-b2b9-45cd-ac64-60969baac32b |
| is_public        | False                                |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros-0.3.0-x86_64                  |
| owner            | a8fbb58fe9c24de38d3290573ecf565a     |
| protected        | False                                |
| size             | 9761280                              |
| status           | active                               |
| updated_at       | 2016-10-03T03:15:35                  |
+------------------+--------------------------------------+
[root@node1 stackimages(keystone_admin)]# glance image-list #查看已上传的映像文件
/usr/lib/python2.6/site-packages/glanceclient/client.py:26: DeprecationWarning: `version` keyword is being deprecated. Please pass the version as part of the URL. http://$HOST:$PORT/v$VERSION_NUMBER
 DeprecationWarning)
+--------------------------------------+---------------------+-------------+------------------+---------+--------+
| ID                                   | Name                | Disk Format | Container Format | Size    | Status |
+--------------------------------------+---------------------+-------------+------------------+---------+--------+
| b142e3c1-98a2-41cb-9049-146d44e7d184 | cirros-0.3.0-i386   | qcow2       | bare             | 9159168 | active |
| b538f4f8-b2b9-45cd-ac64-60969baac32b | cirros-0.3.0-x86_64 | qcow2       | bare             | 9761280 | active |
+--------------------------------------+---------------------+-------------+------------------+---------+--------+
 
  (责任编辑:liangzh)