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 ...
随机推荐
- 简单说明 Virtual DOM 为啥快
Virtual DOM 就是用 JS 的对象来描述 DOM 结构的一个 DOM 树.如: var element = { tagName: 'ul', // 节点标签名 props: { // DOM ...
- LG5056 【模板】插头dp
题意 题目背景 ural 1519 陈丹琦<基于连通性状态压缩的动态规划问题>中的例题 题目描述 给出n*m的方格,有些格子不能铺线,其它格子必须铺,形成一个闭合回路.问有多少种铺法? 输 ...
- whistle.js连接ios手机中https步骤
1:对于安卓直接扫码安装https的证书: 对于ios 连接电脑发出的wifi,打开whistle,配置代理之后(一定要保证先链接电脑发出的wifi,且配置代理) 用Safari打开网址:http: ...
- oracle Awr报告
Select DBID,INSTANCE_NUMBER,SNAP_ID,TO_CHAR(END_INTERVAL_TIME,'YYYY-MM-DD HH24:MM:SS') AS END_TIME,T ...
- Babelfish 基本试用
测试使用docker 部署 docker-compose文件 注意网络模型选择的host,同时配置了opentracing 服务 version: "3" services: b ...
- L老师 Shader编程教程 学习
Shader "VoidGame/FixedShader" { Properties{ //颜色 _Color("Color",Color)=(1,1,1,1) ...
- 开通mysql root 用户远程访问权限(转)
基于安全考虑root账户一般只能本地访问,但是在开发过程中可能需要打开root的远程访问权限.下面是基本的步骤:1.登录到mysql中,为root进行远程访问的授权,执行下面的命令: mysql> ...
- LOJ 2585 「APIO2018」新家 ——线段树分治+二分答案
题目:https://loj.ac/problem/2585 算答案的时候要二分! 这样的话,就是对于询问位置 x ,二分出一个最小的 mid 使得 [ x-mid , x+mid ] 里包含所有种类 ...
- mysql性能分析show profile/show profiles
MySQL性能分析show profiles show profile 和 show profiles 语句可以展示当前会话(退出session后,profiling重置为0) 中执行语句的资源使用情 ...
- flume-ng-sql-source实现oracle增量数据读取
一.下载编译flume-ng-sql-source 下载地址:https://github.com/keedio/flume-ng-sql-source.git ,安装说明文档编译和拷贝jar包 嫌麻 ...