部署一台新计算节点之后,执行下面命令注册到cells,否则该compute不会被nova-scheduler调度,也就无法创建instance了。

su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
执行回显没有报错,但是一直没有发现unmapped computes:

Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 2591a44a-a8ea-421e-bde0-f0e3087db102
Found 0 unmapped computes in cell: 2591a44a-a8ea-421e-bde0-f0e3087db102

查看controller节点上nova-scheduler的日志也没有报错。谷哥度娘也不好查。。因为没有错误信息啊。。。

查看了一下这台新计算节点的/var/log/nova/nova-compute.log之后,发现很多错误:

……

2020-08-18 11:08:24.471 23823 ERROR nova.compute.manager qemu_img_info = disk_api.get_disk_info(path)
2020-08-18 11:08:24.471 23823 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/virt/disk/api.py", line 136, in get_disk_info
2020-08-18 11:08:24.471 23823 ERROR nova.compute.manager return images.qemu_img_info(path)
2020-08-18 11:08:24.471 23823 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/virt/images.py", line 57, in qemu_img_info
2020-08-18 11:08:24.471 23823 ERROR nova.compute.manager raise exception.DiskNotFound(location=path)
2020-08-18 11:08:24.471 23823 ERROR nova.compute.manager DiskNotFound: No disk at /var/lib/libvirt/images/VM03.qcow2

这是nova.compute.manager在检查虚机状况。这些错误信息和添加compute node到cells并没有啥关系啊~~(其实关系很大)这台计算节点在部署OpenStack之前,就是作为KVM宿主机使用的,上面有不少虚机,并没有被删掉。索性检查一下哪些虚机不用了就删掉了。然后,就没有再报错了。突然闪出来几条下面的日志:

ERROR nova.compute.manager [req-a8d5a5a7-6156-473a-b15e-4700d771c33c - - - - -] No compute node record for host compute-208: ComputeHostNotFound_Remote: Compute host compute-208 could not be found.
WARNING nova.compute.resource_tracker [req-a8d5a5a7-6156-473a-b15e-4700d771c33c - - - - -] No compute node record for compute-208:compute-208: ComputeHostNotFound_Remote: Compute host compute-208 could not be found.
2020-08-18 11:09:30.227 23823 INFO nova.compute.resource_tracker [req-a8d5a5a7-6156-473a-b15e-4700d771c33c - - - - -] Compute node record created for compute-208:compute-208 with uuid: be769c7f-8f7d-4f09-a5e0-9b46f977d9a3

我擦。。看来有戏啊。。然后在controller上再次执行 discover_hosts命令,果然成功了!

Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 2591a44a-a8ea-421e-bde0-f0e3087db102
Checking host mapping for compute host 'compute-208': be769c7f-8f7d-4f09-a5e0-9b46f977d9a3
Creating host mapping for compute host 'compute-208': be769c7f-8f7d-4f09-a5e0-9b46f977d9a3
Found 1 unmapped computes in cell: 2591a44a-a8ea-421e-bde0-f0e3087db102

总结:

在执行discover_hosts命令的时候,应该会检查“Compute node record ”,不存在就不会添加到cells。而计算节点Instance有报错,看样子不会创建“计算节点记录”。
————————————————
版权声明:本文为CSDN博主「itachi-uchiha」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/avatar_2009/article/details/108072927

发表评论

邮箱地址不会被公开。 必填项已用*标注