参照社区标准:https://docs.openstack.org/python-glanceclient/latest/cli/details.htmlhtml
示例:python
glance image-create \ --name "centos72-zabbix" \ --file /var/yt/centos72-zabbix.dsk \ --disk-format raw \ --container-format bare \ --visibility public \ --protected True \ --property hw_qemu_guest_agent=yes \ --property os_type="linux" \ --property os_distro="centos" \ --property os_version="7.2" \ --property hw_vif_multiqueue_enabled=true \ --property zabbix_enabled=true \ --progress
name:标识镜像名称,若是是更新的镜像,须要和以前镜像名称一致linux
file:本地的镜像文件绝对路径ubuntu
disk format:镜像格式,虚机镜像必须为rawwindows
visibility:对于公共镜像,需设置为pubilic,对全部人可见centos
protected:对于公共镜像,需设置为True,防止误操做删除centos7
propertyspa
hw_qemu_guest_agent:是否支持QGA,对于虚机镜像一般都支持操作系统
hw_vif_multiqueue_enabled:是否支持网卡多队列,镜像中已经预置好脚本,可根据须要打开code
os_type:操做系统类型,只能选择windows或linux
os_distro:操做系统发行版,需参考https://docs.openstack.org/glance/latest/admin/useful-image-properties.html
os_version:操做系统版本,如centos系列的6.x 7.x,ubuntu系列的14.04 16.04,windows系列的2008 R2等
progress: 显示上传进度