OpenStack+Ceph+热迁移+++六、测试是否运行正常

六、测试是否运行正常

查看nova各服务

openstack compute service list

root@controller ~]# . admin-openrc 
[root@controller ~]# openstack compute service list
+----+------------------+------------+----------+---------+-------+----------------------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated At                 |
+----+------------------+------------+----------+---------+-------+----------------------------+
|  1 | nova-conductor   | controller | internal | enabled | up    | 2017-11-28T15:20:58.000000 |
|  2 | nova-consoleauth | controller | internal | enabled | up    | 2017-11-28T15:21:07.000000 |
|  3 | nova-scheduler   | controller | internal | enabled | up    | 2017-11-28T15:21:05.000000 |
|  6 | nova-compute     | compute1   | nova     | enabled | up    | 2017-11-28T15:21:04.000000 |
|  7 | nova-compute     | compute2   | nova     | enabled | up    | 2017-11-28T15:21:04.000000 |
|  8 | nova-compute     | cinder     | nova     | enabled | up    | 2017-11-28T15:20:57.000000 |
+----+------------------+------------+----------+---------+-------+----------------------------+

查看cinder服务

cinder service-list

[root@controller ~]# cinder service-list
+------------------+-------------+------+---------+-------+----------------------------+-----------------+
|      Binary      |     Host    | Zone |  Status | State |         Updated_at         | Disabled Reason |
+------------------+-------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler |  controller | nova | enabled |   up  | 2017-11-28T15:22:17.000000 |        -        |
|  cinder-volume   |    cinder   | nova | enabled |  down | 2017-11-28T12:13:07.000000 |        -        |
|  cinder-volume   | cinder@ceph | nova | enabled |   up  | 2017-11-28T15:22:18.000000 |        -        |
+------------------+-------------+------+---------+-------+----------------------------+-----------------+

发现有个down掉的,不碍事我们删掉它眼不见心不烦

先更改状态为disable

cinder service-disable  cinder cinder-volume

[root@controller ~]# cinder service-disable  cinder cinder-volume
+--------+---------------+----------+
|  Host  |     Binary    |  Status  |
+--------+---------------+----------+
| cinder | cinder-volume | disabled |
+--------+---------------+----------+
[root@controller ~]# cinder service-list
+------------------+-------------+------+----------+-------+----------------------------+-----------------+
|      Binary      |     Host    | Zone |  Status  | State |         Updated_at         | Disabled Reason |
+------------------+-------------+------+----------+-------+----------------------------+-----------------+
| cinder-scheduler |  controller | nova | enabled  |   up  | 2017-11-28T16:03:21.000000 |        -        |
|  cinder-volume   |    cinder   | nova | disabled |  down | 2017-11-28T16:02:58.000000 |        -        |
|  cinder-volume   | cinder@ceph | nova | enabled  |   up  | 2017-11-28T16:03:19.000000 |        -        |
+------------------+-------------+------+----------+-------+----------------------------+-----------------+

通过数据库直接删了它

update services set deleted=1 where host='cinder' and topic='cinder-volume';

[root@controller ~]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 457
Server version: 10.1.12-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use cinder;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [cinder]> update services set deleted=1 where host='cinder' and topic='cinder-volume';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [cinder]> exit
Bye

[root@controller ~]# cinder service-list
+------------------+-------------+------+---------+-------+----------------------------+-----------------+
|      Binary      |     Host    | Zone |  Status | State |         Updated_at         | Disabled Reason |
+------------------+-------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler |  controller | nova | enabled |   up  | 2017-11-28T16:04:21.000000 |        -        |
|  cinder-volume   | cinder@ceph | nova | enabled |   up  | 2017-11-28T16:04:29.000000 |        -        |
+------------------+-------------+------+---------+-------+----------------------------+-----------------+

删掉了,舒服多了


—————————————————————————————————————————————————————————


通过控制台创建一个云硬盘



在node1节点上执行

rbd --pool volumes ls

[root@node1 ~]# rbd --pool volumes ls
volume-555f10eb-1a35-40a4-a60f-cfefaab2b1d4
没毛病是在ceph上

—————————————————————————————————————————————————————————


上传一个镜像

先把以前那个img的转成raw

qemu-img convert -f qcow2 -O raw cirros-0.3.0-x86_64-disk.img cirros-0.3.0-x86_64-disk.raw

[root@controller ~]qemu-img convert -f qcow2 -O raw cirros-0.3.0-x86_64-disk.img cirros-0.3.0-x86_64-disk.raw
[root@controller ~]# ls
admin-openrc  anaconda-ks.cfg  cirros-0.3.0-x86_64-disk.img  demo-openrc
[root@controller ~]# qemu-img convert -f qcow2 -O raw cirros-0.3.0-x86_64-disk.img cirros-0.3.0-x86_64-disk.raw

上传镜像到镜像服务

openstack image create "raw" \

 --file cirros-0.3.0-x86_64-disk.raw \
 --disk-format raw --container-format bare \
 --public

[root@controller ~]# openstack image create "raw" \
>   --file cirros-0.3.0-x86_64-disk.raw \
>   --disk-format raw --container-format bare \
>   --public
+------------------+----------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                    |
+------------------+----------------------------------------------------------------------------------------------------------+
| checksum         | 35cadb3cc5458a9c7a1fa4d08ba9e593                                                                         |
| container_format | bare                                                                                                     |
| created_at       | 2017-11-28T19:24:20Z                                                                                     |
| disk_format      | raw                                                                                                      |
| file             | /v2/images/1039ef83-c618-4900-98b0-df61c3d7b132/file                                                     |
| id               | 1039ef83-c618-4900-98b0-df61c3d7b132                                                                     |
| min_disk         | 0                                                                                                        |
| min_ram          | 0                                                                                                        |
| name             | raw                                                                                                      |
| owner            | 3cdd57cd88014ef3a85d63ae0a0dcb60                                                                         |
| properties       | direct_url='rbd://46ac86e8-1efe-403c-b735-587f9d76a905/images/1039ef83-c618-4900-98b0-df61c3d7b132/snap' |
| protected        | False                                                                                                    |
| schema           | /v2/schemas/image                                                                                        |
| size             | 41126400                                                                                                 |
| status           | active                                                                                                   |
| tags             |                                                                                                          |
| updated_at       | 2017-11-28T19:25:37Z                                                                                     |
| virtual_size     | None                                                                                                     |
| visibility       | public                                                                                                   |
+------------------+----------------------------------------------------------------------------------------------------------+

在node1节点上执行

rbd --pool images ls

[root@node1 ~]# rbd --pool images ls
1039ef83-c618-4900-98b0-df61c3d7b132


—————————————————————————————————————————————————————————


通过控制台创建一个虚拟机



在node1节点上执行

rbd --pool vms ls

[root@node1 ~]# rbd --pool vms ls
44b8eae7-7866-4b52-b2ad-9929d8dc3c3f_disk

—————————————————————————————————————————————————————————

你也可以试试连接云硬盘和虚拟机








  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值