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

来源:互联网 发布:level2免费版软件 编辑:程序博客网 时间:2024/06/01 09:52

六、测试是否运行正常

查看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 -pEnter password: Welcome to the MariaDB monitor.  Commands end with ; or \g.Your MariaDB connection id is 457Server version: 10.1.12-MariaDB MariaDB ServerCopyright (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 namesYou can turn off this feature to get a quicker startup with -ADatabase changedMariaDB [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: 0MariaDB [cinder]> exitBye[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 lsvolume-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 ~]# lsadmin-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 ls1039ef83-c618-4900-98b0-df61c3d7b132


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


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



在node1节点上执行

rbd --pool vms ls

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

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

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








原创粉丝点击