博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
openstack之镜像管理
阅读量:7124 次
发布时间:2019-06-28

本文共 6777 字,大约阅读时间需要 22 分钟。

概览

[root@cc07 fast-pulsar]# glance help  | grep image              [--os-image-url OS_IMAGE_URL]              [--os-image-api-version OS_IMAGE_API_VERSION]    image-create        Create a new image.    image-create-via-import                        EXPERIMENTAL: Create a new image via image import.    image-deactivate    Deactivate specified image.    image-delete        Delete specified image.    image-download      Download a specific image.    image-import        Initiate the image import taskflow.    image-list          List images you can access.    image-reactivate    Reactivate specified image.    image-show          Describe a specific image.    image-stage         Upload data for a specific image to staging.    image-tag-delete    Delete the tag associated with the given image.    image-tag-update    Update an image with the given tag.    image-update        Update an existing image.    image-upload        Upload data for a specific image.    location-add        Add a location (and related metadata) to an image.    location-delete     Remove locations (and related metadata) from an image.    location-update     Update metadata of an image's location.    member-create       Create member for a given image.    member-delete       Delete image member.    member-list         Describe sharing permissions by image.    member-update       Update the status of a member for a given image.  --os-image-url OS_IMAGE_URL                        Defaults to env[OS_IMAGE_URL]. If the provided image                        url contains a version number and `--os-image-api-                        picked as the image api version to use.  --os-image-api-version OS_IMAGE_API_VERSIONRun `glance --os-image-api-version 1 help` for v1 help

列出镜像

[root@cc07 ~]# glance image-list+--------------------------------------+----------------------------------------+| ID                                   | Name                                   |+--------------------------------------+----------------------------------------+| c9c21ea6-c74d-43cb-8e93-e100a718cc78 | centos-vmvare                          || 069d5dab-6384-437a-9a0d-02301558ecb8 | centos7                                || 0276832c-03c1-48d5-9164-6dfd4771cf66 | CentOS7-Ironic-10-10                   || 1bb24b50-8b06-4894-a396-dada6ba3def2 | centos7withCloudInit.qcow2             || 7c63c10f-d543-4b85-99a0-446f43624edf | centos7_10G                            || 568362bf-680b-4289-a142-90dc1f0d9685 | centos7_official                       || 81a2af08-8e14-43f5-8d9a-48f7628e630d | Chinacloud-WIN2K8R2-64bit-DC-20G.qcow2 || 181adf3e-beb7-4bb6-b776-d690863e951e | cirros_vhd                             || c17a8330-7b5d-4e9b-9887-c842b363bbf0 | dfsadfa                                || 7c59f7d3-512e-42de-b598-812e88657f53 | gagag345                               || 083ec459-d4e5-4da8-8b5f-c76b247e63a4 | k8s-base-image                         || 29436d00-e6e5-402e-8a59-c10f89bc5a09 | linux_legacy                           || fa6e0fea-5a5e-48b9-8ba0-fb9d5b53582f | test-xulang111                         || 5833c05e-56a7-439b-a0b2-567925dea539 | test-xulang12                          || 7dbda9ff-b13f-410b-8152-2c27c6bba4b6 | test-xulang1g                          || 3c819f4c-15ad-417d-93eb-cb600648ee5d | ubuntu-deploy.initramfs                || 1a56dae5-196d-4d21-aea8-d89efc994643 | ubuntu-deploy.kernel                   || ad4ef384-03c0-4f5b-87a7-fec8d942ce85 | ubuntuDemoIronic                       || b2814a9e-f4a1-48d7-9268-2cb8cc17dce9 | win2012                                || 5339fad1-546c-4f63-8dbf-6a40a0e9737e | win2k8_r2_x64                          || b29574d0-6f9c-405d-9a42-47441ad4f11e | windows2007                            || 71b6fbee-5f71-458e-8bfb-39c1d5c2779f | windows2012_inject_pwd                 || 28f3f44c-b3f7-4d01-b100-75ec63ed919b | windows2k3r2                           || bb93f6fc-0790-43c9-ac82-b1835ebcc1df | xulang                                 |+--------------------------------------+----------------------------------------+

下载镜像

glance image-download --file ./centos7-kvm-1g.qcow2 7dbda9ff-b13f-410b-8152-2c27c6bba4b6

上传镜像

上传iso 镜像(qemu)

openstack image create --container-format bare --disk-format iso --property hypervisor_type=qemu --public --file CentOS-6.9-x86_64-bin-DVD1.iso --name ISO_CentOS6.9

 

上传qcow2镜像(qemu):

[root@cc31 fast-pulsar]# glance image-create --disk-format qcow2 --property hypervisor_type=qemu --container-format bare --file ./centos7-kvm-1g.qcow2  --min-disk=1 --property os-type=linux --name centos7_kvm_1g+------------------+--------------------------------------+| Property         | Value                                |+------------------+--------------------------------------+| checksum         | 64d7c1cd2b6f60c92c14662941cb7913     || container_format | bare                                 || created_at       | 2018-10-31T01:47:08Z                 || disk_format      | qcow2                                || hypervisor_type  | qemu                                 || id               | 683b57e2-1875-4b94-af34-4a3eb6a1c6e9 || min_disk         | 1                                    || min_ram          | 0                                    || name             | centos7_kvm_1g                       || os-type          | linux                                || owner            | 093e788ff69e40cb85edad8fac58c5d1     || protected        | False                                || size             | 13167616                             || status           | active                               || tags             | []                                   || updated_at       | 2018-10-31T01:47:10Z                 || virtual_size     | None                                 || visibility       | private                              |+------------------+--------------------------------------+

上传vmware镜像

glance image-create --disk-format vmdk --property hypervisor_type=vmware --container-format bare --file ./centos6Tomcat.qcow2 --is-public=True --min-disk=20 --property os-type=linux --property vmware_disktype=thin --propertyvmware_adaptertype=lsiLogicsas --name centos6-vmdk-oracle11g

上传windows镜像

glance image-create --disk-format vmdk --property hypervisor_type=vmware --property vmware_adaptertype=lsiLogicsas --property vmware_disktype=preallocated --property vmware_ostype=winNetEnterprise64Guest --container-format bare --file ./windows2008server-flat.vmdk --is-public=True --min-disk=25 --property os-type=windows --name vmdk_windows2008_iis_new2 --property vmware_ostype=winNetEnterprise64Guest --property vmware_disktype=preallocated --property vmware_adaptertype=lsiLogicsas导入windows镜像;property vmware_disktype=preallocated否则会黑屏
 

删除镜像

glance image-delete 683b57e2-1875-4b94-af34-4a3eb6a1c6e9

 

转载地址:http://xkael.baihongyu.com/

你可能感兴趣的文章
制作U盘启动盘重装macOS High Sierra
查看>>
微信小程序全局状态管理,并提供Vuex的开发体验
查看>>
Node.js+Mysql+Vue+ElementUI 实现登录注册注销功能
查看>>
常用的js排序算法
查看>>
Linux安装JDK
查看>>
NJ4X源码阅读分析笔记系列(二)—— nj4x-ts初步分析
查看>>
前端笔记(四) ES6常用语法
查看>>
Babel 快速入门
查看>>
kube-scheduler的代码逻辑和二次开发
查看>>
数据结构与算法(动态规划与贪婪算法) --javascript语言描述
查看>>
【360天】我爱刷题系列119(2018.01.31)
查看>>
netty
查看>>
【JavaScript 基础知识】一篇关于 JavaScript 一些知识点的总结 —— 持续更新
查看>>
你需要知道的 webpack 配置
查看>>
Android技术提升
查看>>
bind, apply, call
查看>>
Servlet 3.0 异步处理详解
查看>>
动画机制总结
查看>>
长长的望远镜
查看>>
在给予react的ANTD中如何改变某些固定项?
查看>>