参照社区标准:https://docs.openstack.org/python-glanceclient/latest/cli/details.html

示例:

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:标识镜像名称,如果是更新的镜像,需要和之前镜像名称一致

  • file:本地的镜像文件绝对路径

  • disk format:镜像格式,虚机镜像必须为raw

  • visibility:对于公共镜像,需设置为pubilic,对所有人可见

  • protected:对于公共镜像,需设置为True,防止误操作删除

  • property

    • hw_qemu_guest_agent:是否支持QGA,对于虚机镜像通常都支持

    • hw_vif_multiqueue_enabled:是否支持网卡多队列,镜像中已经预置好脚本,可根据需要打开

    • zabbix_enabled 是否需要打开zabbix agent
    • 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: 显示上传进度

posted on 2018-09-04 15:24  gushiren 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/gushiren/p/9584660.html

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐