查询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. SimpleDateFormat未抛出ParseException

    关于SimpleDateFormat的不严格性[技术探讨]今天一组员写了几段Java代码,发现如下问题:        SimpleDateFormat sdf = new SimpleDateFor ...

  2. getpwnam,getgrnam,getpwent,crypt等函数

    [root@bogon code]# cat a.c #include<stdio.h> #include<pwd.h> int main() { struct passwd ...

  3. What is Zeebe?

    转自:https://zeebe.io/what-is-zeebe/ Zeebe is a workflow engine for microservices orchestration. This ...

  4. lamp安装总结

    1.安装准备   建一个目录用于存放各软件包的压缩文件, 如我把我的源码文件都放在了 /software目录下 切换到/software目录下,执行 wget http://dev.mysql.com ...

  5. 项目中更新pip 问题。更新后还是老版本

    (venv) E:\renyuwang\venv\Scripts>python -m pip install --upgrade pipRequirement already up-to-dat ...

  6. DevExpress Cpicturebox或者Dev控件 PictureEdit 按比例的缩放加载图片

    方法一:     如果要加载的图片的长宽比不是太过失衡, 1.可以改变picturebox的SizeMode属性为 PictureBoxSizeMode.StretchImage, 2.或者Dev控件 ...

  7. What happens to our code? JavaScript 代码是怎样执行的

    1. 我们的代码第一步会被parser 语法分析程序分析. 如果没有报错之后 2. 生产SyntaxTree, 我们的代码会转换成machine code 3. 最终 我们的代码会被运行出来. 下面的 ...

  8. zabbix--3.0--2

    zabbix页面注意事项  1. 工作中使用zabbix常遇到的问题:生产一台机器告警了顺手关闭了,然后忘记打开了 2.监控项这里,也尽量不禁用,而是删除.能删除就删除 3.使用触发器的过程中,有时候 ...

  9. [转]MyBatis中resultType与resultMap区别

    MyBatis中关于resultType和resultMap的具体区别如下: MyBatis中在查询进行select映射的时候,返回类型可以用resultType,也可以用resultMap.resu ...

  10. mysql之 事务prepare 与 commit 阶段分析

    打开binlog选项后,执行事务提交命令时,就会进入两阶段提交模式.两阶段提交分为prepare阶段和commit两个阶段.流程如下 :这里面涉及到两个重要的参数:innodb_flush_log_a ...