OpenStack镜像服务基本操作
查询Glance服务状态
#glance-control all status
[root@controller ~]# glance-control all status
glance-api (pid ) is running...
glance-registry (pid ) is running...
glance-scrubber is stopped
查询glance-api版本
# glance-api --version
[root@controller ~]# glance-api --version
2014.1.
查询glance-control版本
# glance-control --version
[root@controller ~]# glance-control --version
2014.1.
下面的命令作用是启动相关服务,并设置为开机启动。
# service openstack-glance-api start
# service openstack-glance-registry start
# chkconfig openstack-glance-api on
# chkconfig openstack-glance-registry on
下载CirrOS镜像文件
# mkdir /tmp/images
# cd /tmp/images/
# wget http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
查看文件信息
# file cirros-0.3.4-x86_64-disk.img
[root@controller ~]# file cirros-0.3.-x86_64-disk.img
cirros-0.3.-x86_64-disk.img: Qemu Image, Format: Qcow , Version:
使用命令行创建镜像
# glance image-create --name "cirros-0.3.4-x86_64-disk" --disk-format qcow2 --container-format bare --is-public True --progress < cirros-0.3.4-x86_64-disk.img
[root@controller ~]# glance image-create --name "cirros-0.3.4-x86_64-disk" --disk-format qcow2 --container-format bare --is-public True --progress < cirros-0.3.-x86_64-disk.img
[=============================>] %
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | --26T19:: |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | c0508642-29f2-4d57-b7ca-7417668e1908 |
| is_public | True |
| min_disk | |
| min_ram | |
| name | cirros-0.3.-x86_64-disk |
| owner | 18e38545a20f4fbb8dba8944118d43bc |
| protected | False |
| size | |
| status | active |
| updated_at | --26T19:: |
| virtual_size | None |
+------------------+--------------------------------------+
创建成功后,可以登录界面,查看镜像信息

查看镜像列表
# glance image-list
[root@controller ~]# glance image-list
+--------------------------------------+--------------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------------------------+-------------+------------------+------------+--------+
| b3f9088f-ca51-4a03-ab9a-66e9c4baacce | cirros | qcow2 | bare | | active |
| c0508642-29f2-4d57-b7ca-7417668e1908 | cirros-0.3.-x86_64-disk | qcow2 | bare | | active |
| b408a7da-7fff--8f17-9e48f34553ef | cirros-test | qcow2 | bare | | active |
| c6e2e980-935c--94ae-0595988065d2 | Cloud_Centos6.5_64bit | qcow2 | bare | | active |
| 54e5faa2--40de-89ce-4511623ce649 | Cloud_win7_64bit | qcow2 | bare | | active |
+--------------------------------------+--------------------------+-------------+------------------+------------+--------+
查看镜像的详细信息
参数可以是镜像id或者镜像名称
# glance image-show Cloud_Centos6.5_64bit
[root@controller ~]# glance image-show Cloud_Centos6.5_64bit
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | d6e6a71c69f1996350970489f9513402 |
| container_format | bare |
| created_at | --22T10:: |
| deleted | False |
| disk_format | qcow2 |
| id | c6e2e980-935c--94ae-0595988065d2 |
| is_public | False |
| min_disk | |
| min_ram | |
| name | Cloud_Centos6.5_64bit |
| owner | 18e38545a20f4fbb8dba8944118d43bc |
| protected | False |
| size | |
| status | active |
| updated_at | --22T10:: |
+------------------+--------------------------------------+
更改镜像
如果需要改变镜像启动硬盘最低要求值(min-disk)时,min-disk默认单位为G
更新镜像信息
# glance image-update --min-disk=1 cirros-0.3.4-x86_64-disk
[root@controller ~]# glance image-update --min-disk= cirros-0.3.-x86_64-disk
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | --26T19:: |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | c0508642-29f2-4d57-b7ca-7417668e1908 |
| is_public | True |
| min_disk | |
| min_ram | |
| name | cirros-0.3.-x86_64-disk |
| owner | 18e38545a20f4fbb8dba8944118d43bc |
| protected | False |
| size | |
| status | active |
| updated_at | --26T19:: |
| virtual_size | None |
+------------------+--------------------------------------+
删除镜像
# glance image-delete cirros-0.3.4-x86_64-disk
[root@controller ~]# glance image-delete cirros-0.3.-x86_64-disk
[root@controller ~]#
[root@controller ~]# glance image-list
+--------------------------------------+-----------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+-----------------------+-------------+------------------+------------+--------+
| b3f9088f-ca51-4a03-ab9a-66e9c4baacce | cirros | qcow2 | bare | | active |
| b408a7da-7fff--8f17-9e48f34553ef | cirros-test | qcow2 | bare | | active |
| c6e2e980-935c--94ae-0595988065d2 | Cloud_Centos6.5_64bit | qcow2 | bare | | active |
| 54e5faa2--40de-89ce-4511623ce649 | Cloud_win7_64bit | qcow2 | bare | | active |
+--------------------------------------+-----------------------+-------------+------------------+------------+--------+
end
OpenStack镜像服务基本操作的更多相关文章
- OpenStack 镜像服务 Glance部署(六)
Glance介绍 创建虚拟机我们需要有glance的支持,因为glance是提供镜像的服务. Glance有两个比较重要的服务: Glance-api:接受云系统镜像的构建.删除.读取请求 Glanc ...
- OpenStack 镜像服务 Glance部署(七)
创建虚拟机我们需要有glance的支持,因为glance是提供镜像的服务. Glance有两个比较重要的服务: Glance-api:接受云系统镜像的构建.删除.读取请求 Glance-Registr ...
- openstack镜像服务(glance)
1.Use the database access client to connect to the database server as the root user: $ mysql -u root ...
- 云计算管理平台之OpenStack镜像服务glance
一.glance简介 openstack中的glance服务是用来存储在openstack上启动虚拟机所需镜像:它主要用于发现.注册及检索虚拟机镜像:它通过提供RESTful风格的api对外提供服务: ...
- 【openstack N版】——镜像服务glance
一.openstack镜像服务glance 1.1 glance介绍 glance主要是由三部分组成 glance-api:接收云系统镜像的创建,删除,读取请求,类似nova-api,通过其他模块(g ...
- Openstack(八)部署镜像服务glance
8.1glance镜像服务介绍 Glance是OpenStack镜像服务组件,glance服务默认监听在9292端口,其接收REST API请求,然后通过其他模块(glance-registry及im ...
- Openstack glance 镜像服务 (五)
Openstack glance 镜像服务 (五) 引用: 官方文档glance安装 https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/ ...
- OpenStack-Ocata版+CentOS7.6 云平台环境搭建 — 4.镜像服务(glance)
节点配置信息说明: 控制节点:controller: IP:192.168.164.128 hostname&hosts:likeadmin 计算加点:Nova: IP:192.168.164 ...
- 4.openstack之mitaka搭建glance镜像服务
部署镜像服务 一:安装和配置服务 1.建库建用户 mysql -u root -p CREATE DATABASE glance; GRANT ALL PRIVILEGES ON glance.* T ...
随机推荐
- Map 知识整理
首先是HashMap的学习,理解散列的概念以及相关的实现,并且会学习HashMap的源码,理解为什么HashMap的速度如此之快. 声明:参考到的资料在下方列出. 1.<Java编程思想> ...
- shell dict 操作
shell 读取文件,利用dict 合并第一列 . #!/bin/bash result_file="a" declare -A mydict total=`cat ${resul ...
- about unit test
Use unify unit test framework CPPUnit 1.12.1/Visual stdio Unit is a class or a function Test per maj ...
- VS版本号定义、规则和相关的Visual Studio插件
软件版本号主要标识了软件的版本,通过其可以了解软件.类库文件的当前版本,使得软件版本控制有所依据. 我们就Windows系统和.NET Framework的编号规则来看,软件版本号的定义结构一般是这样 ...
- 20165308 2017-2018-2 《Java程序设计》第四周学习总结
20165308 2017-2018-2 <Java程序设计>第四周学习总结 知识点 第五章 1.子类声明中通常用关键字extend来定义一个子类. 2.子类和父类在同一包中的继承性,继承 ...
- 谈谈 数据中心SOA 架构
为什么要讨论 数据中心SOA 架构呢? 请参考我写的另外一篇文章 <论 微服务 和 Entity Framework 对数据的割裂> https://www.cnblogs.com ...
- 使用 localeCompare 函数对中文进行排序
localeCompare 函数可对中文进行排序. 性能相关 当比较大量字符串时, 比如比较大量数组时, 最好创建一个Intl.Collator 对象并使用compare 属性所提供的函数. mdn介 ...
- :nth-of-type(n) 与 :nth-child(n) 区别
:nth-of-type(n):选择器匹配同类型中的第n个同级兄弟元素. :nth-child(n):选择器匹配父元素中的第n个子元素.
- windows python监听文件触发脚本
from watchdog.events import * class FileEventHandler(FileSystemEventHandler): def __init__(self): Fi ...
- 【java】标示符
java的标示符由数字0-9,字母a-zA-Z,_$组成.(java是严格区分大小写的) 标示符的规则: 1.不能以数字开头 2.不能使用关键字 一般的命名规则: 包名:多个单词组成时,所有字母全部小 ...