在OpenStack中主要为实例提供公共镜像服务能力以及镜像/虚拟机快照管理功能,属于OpenStack的核心组件之一。
不同CPU架构的计算节点使用的镜像不同,因此混合部署环境下需要能区分x86_64和ARM两种体系的镜像文件,Glance本身支持通过设置镜像文件的元数据property:architecture属性设置镜像文件。
虚拟机创建过程中,选择某一architecture属性的镜像后,在Nova scheduler调度过程中自动选择匹配镜像architecture的节点创建虚拟机。
典型场景:
openstack image create
openstack image set
在控制节点执行以下操作:
1
|
source /etc/keystone/admin-openrc |
1 2 |
wget https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-aarch64-disk.img --no-check-certificate wget https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img --no-check-certificate |
1
|
openstack image create "cirros-0.4.0-x86_64" --file ./cirros-0.4.0-x86_64-disk.img --property architecture=x86_64 --disk-format qcow2 --container-format bare --public |
1 2 |
openstack image create "cirros-0.4.0-aarch64" --file ./cirros-0.4.0-aarch64-disk.img --disk-format qcow2 --container-format bare --public openstack image set --property architecture=aarch64 cirros-0.4.0-aarch64 |
1 2 |
openstack image show cirros-0.4.0-x86_64 openstack image show cirros-0.4.0-aarch64 |