查询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镜像服务基本操作的更多相关文章

  1. OpenStack 镜像服务 Glance部署(六)

    Glance介绍 创建虚拟机我们需要有glance的支持,因为glance是提供镜像的服务. Glance有两个比较重要的服务: Glance-api:接受云系统镜像的构建.删除.读取请求 Glanc ...

  2. OpenStack 镜像服务 Glance部署(七)

    创建虚拟机我们需要有glance的支持,因为glance是提供镜像的服务. Glance有两个比较重要的服务: Glance-api:接受云系统镜像的构建.删除.读取请求 Glance-Registr ...

  3. openstack镜像服务(glance)

    1.Use the database access client to connect to the database server as the root user: $ mysql -u root ...

  4. 云计算管理平台之OpenStack镜像服务glance

    一.glance简介 openstack中的glance服务是用来存储在openstack上启动虚拟机所需镜像:它主要用于发现.注册及检索虚拟机镜像:它通过提供RESTful风格的api对外提供服务: ...

  5. 【openstack N版】——镜像服务glance

    一.openstack镜像服务glance 1.1 glance介绍 glance主要是由三部分组成 glance-api:接收云系统镜像的创建,删除,读取请求,类似nova-api,通过其他模块(g ...

  6. Openstack(八)部署镜像服务glance

    8.1glance镜像服务介绍 Glance是OpenStack镜像服务组件,glance服务默认监听在9292端口,其接收REST API请求,然后通过其他模块(glance-registry及im ...

  7. Openstack glance 镜像服务 (五)

    Openstack glance 镜像服务 (五) 引用: 官方文档glance安装 https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/ ...

  8. OpenStack-Ocata版+CentOS7.6 云平台环境搭建 — 4.镜像服务(glance)

    节点配置信息说明: 控制节点:controller: IP:192.168.164.128 hostname&hosts:likeadmin 计算加点:Nova: IP:192.168.164 ...

  9. 4.openstack之mitaka搭建glance镜像服务

    部署镜像服务 一:安装和配置服务 1.建库建用户 mysql -u root -p CREATE DATABASE glance; GRANT ALL PRIVILEGES ON glance.* T ...

随机推荐

  1. js---通配符选择器

    原味转自:http://blog.sina.com.cn/s/blog_6e001be701017kaz.html 1.选择器 (1)通配符: $("input[id^='code']&qu ...

  2. 下面的程序段创建了BufferedReader类的对象in,以便读取本机c盘my文件夹下的文件1.txt。File构造函数中正确的路径和文件名的表示是( )。

    下面的程序段创建了BufferedReader类的对象in,以便读取本机c盘my文件夹下的文件1.txt.File构造函数中正确的路径和文件名的表示是(    ). ./表示当前项目的路径../表示当 ...

  3. LeetCode - Convert BST to Greater Tree

    Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original B ...

  4. JS 数组常用的方法

    数组常用的方法: x.toString()方法:任何对象都有toString方法.        将任何对象转为字符串. 一般不主动调用,系统在需要时自动调用 x.valueOf()方法:同toStr ...

  5. CSVN部署安装,实现web管理svn

    系统环境:centos7最小化安装 下载这个文件并解压 https://pan.baidu.com/s/1miwdBc8 tar zxvf jdk-8u91-linux-x64.gz mv jdk1. ...

  6. href和src区别

    href常见于link a 元素, 是Hypertext Reference的缩写,表示超文本引用.用来建立当前元素和文档之间的链接. href引用css文件时,浏览器会识别该文档为css文档,就会并 ...

  7. FastAdmin 新年福袋进行中

    FastAdmin 新年福袋进行中 2019新年福袋活动正在进行中 https://www.fastadmin.net/act/20190101/springfestival.html

  8. IDEA基本設置

    2.界面字体大小设置 File菜单->Settings->Appearance->Override default fonts by(not recommended):Name:宋体 ...

  9. Redis 多个数据库

    注意:Redis支持多个数据库,并且每个数据库的数据是隔离的不能共享,并且基于单机才有,如果是集群就没有数据库的概念. Redis是一个字典结构的存储服务器,而实际上一个Redis实例提供了多个用来存 ...

  10. taro 列表渲染

    元素的 key 在他的兄弟元素之间应该唯一 数组元素中使用的 key 在其兄弟之间应该是独一无二的.然而,它们不需要是全局唯一的.当我们生成两个不同的数组时,我们可以使用相同的 key key 的取值 ...