8.2. 从本地文件导入
您必须首先将镜像上传到中央位置的存储,然后将镜像复制到远程站点。
确保您的镜像文件采用 RAW 格式。如果镜像不是 raw 格式,则必须在将镜像导入到镜像服务前转换它:
file cirros-0.5.1-x86_64-disk.img qemu-img convert -f qcow2 -O raw cirros-0.5.1-x86_64-disk.img cirros-0.5.1-x86_64-disk.raw
$ file cirros-0.5.1-x86_64-disk.img cirros-0.5.1-x86_64-disk.img: QEMU QCOW2 Image (v3), 117440512 bytes $ qemu-img convert -f qcow2 -O raw cirros-0.5.1-x86_64-disk.img cirros-0.5.1-x86_64-disk.raw
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将镜像导入到中央站点的默认后端:
openstack image create \ --disk-format raw --container-format bare \ --name cirros --file cirros-0.5.1-x86_64-disk.raw \ --store central
openstack image create \ --disk-format raw --container-format bare \ --name cirros --file cirros-0.5.1-x86_64-disk.raw \ --store central
Copy to Clipboard Copied! Toggle word wrap Toggle overflow