openstack上传镜像到glance

以qcow2模板为例

1. 上传镜像qcow2文件到服务器。


2. 先转换qcow2格式为raw,例如:
qemu-img convert -f qcow2 -O raw win2012r2.qcow2 win2012r2.raw


3. 再将raw镜像上传到glance,例如:
Windows镜像上传:
glance image-create --name "win2012r2" --file win2012r2.raw --disk-format raw --container-format bare --progress --property os_type=windows

Linux镜像上传:
glance image-create --name "CentOS7.6" --file CentOS7.6.raw --disk-format raw --container-format bare --progress

 

注:windows镜像模板制作可提前打补丁尤其是勒索补丁;centos制作可提前升级内核与应用版本,如openssh版本

 

posted @ 2022-12-06 13:53  咿呀哒喏  阅读(179)  评论(0编辑  收藏  举报