No valid host was found. There are not enough hosts available-----openstack建虚拟机直接报错

一、问题现象:

本次环境中只有一个计算节点,创建虚拟机直接报错,使用nova show 看到报错如下图:

"message": "No valid host was found. There are not enough hosts available.", "code": 500

二、解决思路:

1、查看计算节点的nova-compute 日志,发现如下日志:

2019-11-21 19:47:09.484 8 ERROR nova.scheduler.client.report [req-cbc37e88-16be-4b5b-be98-d889cd1b01dc - - - - -] [req-a5a6d438-3f63-49aa-9dd2-98d061b122b4] Failed to create resource provider record in placement API for UUID d878a164-6499-43d4-9772-b77107a1bb8c. Got 409: {"errors": [

{"status": 409, "request_id": "req-a5a6d438-3f63-49aa-9dd2-98d061b122b4", "detail": "There was a conflict when trying to complete your request.\n\n Conflicting resource provider name: compute1 already exists. ", "title": "Conflict"}

2019-11-21 19:47:09.485 8 ERROR nova.compute.manager [req-cbc37e88-16be-4b5b-be98-d889cd1b01dc - - - - -] Error updating resources for node compute1.: ResourceProviderCreationFailed: Failed to create resource provider compute1

发现ResourceProviderCreationFailed: Failed to create resource provider compute1 ,发现resource Provider 创建失败。怀疑数据库resource provider 表没有建出来,继续查看nova-nova-scheduler.log。

2、查看nova-scheduler.log

2019-11-21 20:18:43.360 29 INFO nova.filters [req-448bd5fa-ddc8-45d9-9b8b-a63bdb691335 e0111848d3904a7288df61cac5163f4f 9be97009f556459cb1814232dbedb4a3 - default default] Filter RetryFilter returned 0 hosts
2019-11-21 20:18:43.362 29 INFO nova.filters [req-448bd5fa-ddc8-45d9-9b8b-a63bdb691335 e0111848d3904a7288df61cac5163f4f 9be97009f556459cb1814232dbedb4a3 - default default] Filtering removed all hosts for the request with instance ID 'c9542c1c-191e-49f2-815a-fdcacc081af6'. Filter results: ['RetryFilter: (start: 0, end: 0)']

3、进数据查看数据库表

mysql> use nova_api;
mysql[nova_api] > select * from resource_providers;
+---------------------+---------------------+----+--------------------------------------+----------+------------+----------+------------------+--------------------+
| created_at | updated_at | id | uuid | name | generation | can_host | root_provider_id | parent_provider_id |
+---------------------+---------------------+----+--------------------------------------+----------+------------+----------+------------------+--------------------+
| 2019-11-21 06:17:39 | 2019-11-21 06:17:41 | 3 | 16d1bd53-7919-4fef-9a11-a0e98c149823 | compute1 | 1 | NULL | 3 | NULL |
+---------------------+---------------------+----+--------------------------------------+----------+------------+----------+------------------+--------------------+
1 row in set (0.00 sec)

发现有数据。重新创建虚拟机,依然会发生报错,

4、尝试将compute节点从nova service-list中删除,并重新加入到集群中

# 停掉compute节点的nova-compute 服务
nova service-delete <计算节点的uuid> # 开启计算节点的nova-compute服务,让计算节点重新注册

尝试创建虚拟机,发现还是报错。返回去,查看nova-compute的日志发现 There was a conflict when trying to complete your request.\n\n Conflicting resource provider name: compute1 already exists. 。提示矛盾。

5、再次进入数据库,执行 select * from resource_providers;

mysql> use nova_api;
mysql[nova_api] > select * from resource_providers;
+---------------------+---------------------+----+--------------------------------------+----------+------------+----------+------------------+--------------------+
| created_at | updated_at | id | uuid | name | generation | can_host | root_provider_id | parent_provider_id |
+---------------------+---------------------+----+--------------------------------------+----------+------------+----------+------------------+--------------------+
| 2019-11-21 06:17:39 | 2019-11-21 06:17:41 | 3 | 16d1bd53-7919-4fef-9a11-a0e98c149823 | compute1 | 1 | NULL | 3 | NULL |
+---------------------+---------------------+----+--------------------------------------+----------+------------+----------+------------------+--------------------+
1 row in set (0.00 sec)

发现新注册的计算节点,但是resource_providers的uuid 没有发生变化,怀疑是注册compute节点的时候,并没有更新resource_providers,尝试删除resource_providers;

6、查找官网,找到了操作 resource_providers的openstack命令,执行如下操作。

相关文档:https://docs.openstack.org/osc-placement/latest/cli/index.html

相关软件包:https://cbs.centos.org/kojifiles/packages/python-osc-placement/1.3.0/1.el7/noarch/python2-osc-placement-1.3.0-1.el7.noarch.rpm

# 安装osc-placement 软件包,生成命令行工具

# 执行如下命令:
export OS_PLACEMENT_API_VERSION=1.10
openstack allocation candidate list --resource VCPU=1 # 查看当前resource provider
[root@control1 ~]# openstack resource provider list
+--------------------------------------+----------+------------+
| uuid | name | generation |
+--------------------------------------+----------+------------+
| 16d1bd53-7919-4fef-9a11-a0e98c149823 | compute1 | 2 |
+--------------------------------------+----------+------------+ # 停止计算节点nova-compute服务
# 从service 中删除compute1
nova service-delete <uuid> # 删除当前resource provider
openstack resource provider delete 16d1bd53-7919-4fef-9a11-a0e98c149823 # 重启nova-compute服务,让其自动注册
# 查看当前resource provider
[root@control1 ~]# openstack resource provider list
+--------------------------------------+----------+------------+
| uuid | name | generation |
+--------------------------------------+----------+------------+
| b32cd7b5-26c6-4998-97f1-79fa2315871b | compute1 | 2 |
+--------------------------------------+----------+------------+ # # 执行如下命令,验证是否更新了数据
export OS_PLACEMENT_API_VERSION=1.10
openstack allocation candidate list --resource VCPU=1

执行创建云主机,云主机成功创建。

No valid host was found. There are not enough hosts available-----openstack建虚拟机直接报错的更多相关文章

  1. RDO Stack: No valid host was found. There are not enough hosts available.

    Issue: When you launch an instance in Newton, you may find that the instance cannot be started due t ...

  2. openstack No valid host was found. There are not enough hosts available.

    root@dell-PowerEdge-T30:~# gedit /var/log/nova/nova-conductor.logroot@dell-PowerEdge-T30:~# gedit /v ...

  3. No valid host was found. There are not enough hosts available

  4. Does not contain a valid host:port authority: Master:8031 (configuration property 'yarn.resourcemanager.resource-tracker.address')

    问题解决: 这个错误是:yarn里面的配置的格式有错误:如: <property> <name>yarn.resourcemanager.address</name> ...

  5. Does not contain a valid host;port authority解决方法

    ERRORorg.apache.hadoop.hdfs.server.namenode.NameNode: java.lang.IllegalArgumentException: Does not c ...

  6. IllegalArgumentException: Does not contain a valid host:port authority: master:8031

    java.lang.IllegalArgumentException: Does not contain a valid host:port authority: master:8031 (confi ...

  7. kettle添加hadoop cluster时报错Caused by: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: hadoop:password@node56:9000

    完整报错是: Caused by: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: ...

  8. hadoop错误:Does not contain a valid host:port authority

    hadoop环境部署完,执行hdfs zkfc -formatZK命令时,提示如上图所示错误 错误内容: [root@study_1_1 hadoop]# hdfs zkfc -formatZK Ex ...

  9. 启动hadoop报does not contain a valid host:port authority:node2_1:9000

    报错:启动hadoop报does not contain a valid host:port authority:node2_1:9000 原因:主机的hostname不合法,修改为不包含着‘.’ ' ...

随机推荐

  1. ABAP ole操作1

    转自:https://www.cnblogs.com/jxzhu/p/8708686.html OLE整理: 1.定义,分别对应EXCEL,workbook(工作簿),sheet(页),单元格 DAT ...

  2. 通过本地Agent监控Azure sql database

    背景: 虽然Azure sql database有DMVs可以查看DTU等使用情况,但记录有时间限制,不会一直保留.为了更好监控Azure_sql_database上各个库的DTU使用情况.数据库磁盘 ...

  3. 利用python求解物理学中的双弹簧质能系统详解

    利用python求解物理学中的双弹簧质能系统详解 本文主要给大家介绍了关于利用python求解物理学中双弹簧质能系统的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧. 物理的 ...

  4. ubuntu 18.04下greenplum安装笔记(二)安装Greenplum的失败的尝试

    之前对Linux环境进行了搭建,现在开始进行Greenplum的正式安装. 下载 进Greenplum的官网:https://greenplum.org/download/ 可以发现,对于ubuntu ...

  5. 安卓模拟器Android SDK 4.0.3 R2安装完整图文教程

    在最新的Android 4.0.3 R2模拟器中,已经加入了GPU支持,可以支持OpenGL ES 2.0标准,让开发者可以借助模拟器来测试自己的OpenGL游戏.在去年新增了摄像头支持之后,现在的新 ...

  6. MFC BASE64加解密 算法

    unsigned char * base64 = (unsigned char *)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ...

  7. AWS 核心服务概述(二)

    目录 AWS网络服务 VPC Direct Connect Route53 AWS 计算服务 EC2 EMR(Elastic MapReduce) AWS Lambda Auto Scaling El ...

  8. Win 10环境下6sV2.1模型编译心得

    最新版本6sV2.1模型是通过FORTRAN95编写的,2017年11月代码编写完成,2018年11月发布在模型官网上.通常我们在使用过程中都是调用模型的.exe可执行文件,而下载下来的是FORTRA ...

  9. charles 高级批量请求

    本文参考:charles 高级批量请求 这个我感觉有点鸡肋,真正的批量请求,推荐使用JMter charles 高级批量请求就是下面这种简单的设置的 简单的使用还是可以的; 比如简单的测试下,向某一个 ...

  10. (CVE-2017-7494)Samba远程代码执行[Linux]

    简介 此漏洞是针对开启了共享的smb服务 漏洞利用 启动msfconsole search is_known_pipename   搜索此模块 use exploit/linux/samba/is_k ...