“Glance组件验证”的版本间的差异

来自CloudWiki
跳转至: 导航搜索
(创建页面,内容为“===引用环境变量=== source /etc/keystone/admin-openrc.sh ===下载源镜像=== wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img…”)
 
 
(未显示同一用户的1个中间版本)
第6行: 第6行:
  
 
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
 
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
 +
 +
[root@controller xiandian]# mv cirros-0.3.4-x86_64-disk.img ~
 +
 +
[root@controller xiandian]# cd
  
 
   
 
   
第12行: 第16行:
 
使用 QCOW2 磁盘格式, bare 容器格式上传镜像到镜像服务并设置公共可见,这样所有的项目都可以访问它:
 
使用 QCOW2 磁盘格式, bare 容器格式上传镜像到镜像服务并设置公共可见,这样所有的项目都可以访问它:
  
openstack image create "cirros" \
+
openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
  --file cirros-0.3.4-x86_64-disk.img \
+
 
  --disk-format qcow2 --container-format bare \
+
 
  --public
+
<nowiki>+------------------+------------------------------------------------------+
+------------------+------------------------------------------------------+
+
| Field            | Value                                                |
| Property        | Value                                                |
 
 
+------------------+------------------------------------------------------+
 
+------------------+------------------------------------------------------+
| checksum        | 133eae9fb1c98f45894a4e60d8736619                     |
+
| checksum        | ee1eca47dc88f4879d8a229cc70a07c6                     |
 
| container_format | bare                                                |
 
| container_format | bare                                                |
| created_at      | 2015-03-26T16:52:10Z                                 |
+
| created_at      | 2019-03-21T05:27:21Z                                 |
 
| disk_format      | qcow2                                                |
 
| disk_format      | qcow2                                                |
| file            | /v2/images/cc5c6982-4910-471e-b864-1098015901b5/file |
+
| file            | /v2/images/ea99fe7e-ed7b-4d7a-bcc9-0d4376b19cf5/file |
| id              | cc5c6982-4910-471e-b864-1098015901b5                 |
+
| id              | ea99fe7e-ed7b-4d7a-bcc9-0d4376b19cf5                 |
 
| min_disk        | 0                                                    |
 
| min_disk        | 0                                                    |
 
| min_ram          | 0                                                    |
 
| min_ram          | 0                                                    |
 
| name            | cirros                                              |
 
| name            | cirros                                              |
| owner            | ae7a98326b9c455588edd2656d723b9d                     |
+
| owner            | a36a537500d44b3b920480207bc30eec                     |
 
| protected        | False                                                |
 
| protected        | False                                                |
 
| schema          | /v2/schemas/image                                    |
 
| schema          | /v2/schemas/image                                    |
| size            | 13200896                                             |
+
| size            | 13287936                                             |
 
| status          | active                                              |
 
| status          | active                                              |
 
| tags            |                                                      |
 
| tags            |                                                      |
| updated_at      | 2015-03-26T16:52:10Z                                 |
+
| updated_at      | 2019-03-21T05:27:23Z                                 |
 
| virtual_size    | None                                                |
 
| virtual_size    | None                                                |
 
| visibility      | public                                              |
 
| visibility      | public                                              |
 
+------------------+------------------------------------------------------+
 
+------------------+------------------------------------------------------+
 
+
</nowiki>
更多关于命令:`glance image-create`的参数信息,请参考``OpenStack Command-Line Interface Reference``中的`Image service command-line client <http://docs.openstack.org/cli-reference/openstack.html#openstack-image-create>`部分。
 
 
 
更多镜像磁盘和容器格式信息,参考 ``OpenStack虚拟机镜像指南``中的`镜像的磁盘及容器格式 <http://docs.openstack.org/image-guide/image-formats.html>`__ 部分。
 
  
 
   
 
   
注解
+
注解: OpenStack 是动态生成 ID 的,因此您看到的输出会与示例中的命令行输出不相同。
  
OpenStack 是动态生成 ID 的,因此您看到的输出会与示例中的命令行输出不相同。
+
确认镜像的上传并验证属性:
  
确认镜像的上传并验证属性:
+
openstack image list
  
$ openstack image list
+
<nowiki>+--------------------------------------+--------+--------+
+--------------------------------------+--------+--------+
 
 
| ID                                  | Name  | Status |
 
| ID                                  | Name  | Status |
 
+--------------------------------------+--------+--------+
 
+--------------------------------------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros | active |
+
| ea99fe7e-ed7b-4d7a-bcc9-0d4376b19cf5 | cirros | active |
 
+--------------------------------------+--------+--------+
 
+--------------------------------------+--------+--------+
 +
</nowiki>
  
 
参考文档:https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/glance-verify.html
 
参考文档:https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/glance-verify.html

2019年5月4日 (六) 14:09的最新版本

引用环境变量

source /etc/keystone/admin-openrc.sh


下载源镜像

wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

[root@controller xiandian]# mv cirros-0.3.4-x86_64-disk.img ~

[root@controller xiandian]# cd


注解:如果您的发行版里没有包含wget,请安装它

使用 QCOW2 磁盘格式, bare 容器格式上传镜像到镜像服务并设置公共可见,这样所有的项目都可以访问它:

openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public


+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6                     |
| container_format | bare                                                 |
| created_at       | 2019-03-21T05:27:21Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/ea99fe7e-ed7b-4d7a-bcc9-0d4376b19cf5/file |
| id               | ea99fe7e-ed7b-4d7a-bcc9-0d4376b19cf5                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros                                               |
| owner            | a36a537500d44b3b920480207bc30eec                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 13287936                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2019-03-21T05:27:23Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+


注解: OpenStack 是动态生成 ID 的,因此您看到的输出会与示例中的命令行输出不相同。

确认镜像的上传并验证属性:

openstack image list

+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| ea99fe7e-ed7b-4d7a-bcc9-0d4376b19cf5 | cirros | active |
+--------------------------------------+--------+--------+

参考文档:https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/glance-verify.html