[Openstack nova]: No valid host found for resize

Updated on September 5, 2023

On my OpenStack setup with 2-nodes, 1-controller+compute and 1-compute node, I got the error message “No valid host was found. No valid host found for resize” during resize of a VM. Below are the detailed message in nova-api.log nova-scheduler.log & nova-conductor.log:

# vim /var/log/nova/nova-api.log

2023-03-23 10:45:19.441 3219 INFO nova.api.openstack.wsgi [req-4d2542f9-38f4-4900-88d9-b1c987651ebf 3e1f37952b4a4a819c965e6d17628fa4 1f738744ee4141f0a1e4af7b0fe6456d - default default] HTTP exception thrown: No valid host was found. No valid host found for resize
# vim /var/log/nova/nova-conductor.log

2023-03-23 10:46:58.826 4363 WARNING nova.scheduler.utils [req-cef009a6-4ac5-494b-b32f-eb6359b4fdf8 3e1f37952b4a4a819c965e6d17628fa4 1f738744ee4141f0a1e4af7b0fe6456d - default default] Failed to compute_task_migrate_server: No valid host was found. There are not enough hosts available.
Traceback (most recent call last):

File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 235, in inner
return func(*args, **kwargs)

File "/usr/lib/python2.7/site-packages/nova/scheduler/manager.py", line 214, in select_destinations
allocation_request_version, return_alternates)

File "/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py", line 96, in select_destinations
allocation_request_version, return_alternates)

File "/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py", line 265, in _schedule
claimed_instance_uuids)

File "/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py", line 302, in _ensure_sufficient_hosts
raise exception.NoValidHost(reason=reason)

NoValidHost: No valid host was found. There are not enough hosts available.
: NoValidHost_Remote: No valid host was found. There are not enough hosts available.
2023-03-23 10:46:58.844 4363 WARNING nova.scheduler.utils [req-cef009a6-4ac5-494b-b32f-eb6359b4fdf8 3e1f37952b4a4a819c965e6d17628fa4 1f738744ee4141f0a1e4af7b0fe6456d - default default] [instance: 3aaeb488-ab1a-4243-949a-8da62af0c4a0] Setting instance to STOPPED state.: NoValidHost_Remote: No valid host was found. There are not enough hosts available.
vim /etc/nova/nova-scheduler.log

2023-03-23 10:45:16.163 4395 INFO nova.scheduler.host_manager [req-4d2542f9-38f4-4900-88d9-b1c987651ebf 3e1f37952b4a4a819c965e6d17628fa4 1f738744ee4141f0a1e4af7b0fe6456d - default default] Host filter ignoring hosts: compute1

How to solve No valid host was found. No valid host found for resize?

When you try to resize a VM, OpenStack will attempt to migrate it to best available host (If you have multiple hosts in your architecture). You can follow to enable OpenStack instance live resizing and migration. Let’s follow below steps to find solution to our problem:

Step 1: Make sure all the compute service list is up and enabled.

# openstack compute service list
+----+----------------+------------------------+----------+---------+-------+----------------------------+
| ID | Binary         | Host        | Zone     | Status  | State | Updated At                 |
+----+----------------+------------------------+----------+---------+-------+----------------------------+
|  3 | nova-console   | controller1 | internal | enabled | up    | 2023-09-05T08:39:16.000000 |
|  4 | nova-conductor | controller1 | internal | enabled | up    | 2023-09-05T08:39:17.000000 |
|  5 | nova-scheduler | controller1 | internal | enabled | up    | 2023-09-05T08:39:17.000000 |
|  6 | nova-compute   | controller1 | nova     | enabled | up    | 2023-09-05T08:39:10.000000 |
|  7 | nova-compute   | compute11   | nova     | enabled | up    | 2023-09-05T08:39:14.000000 |
+----+----------------+------------------------+----------+---------+-------+----------------------------+
Nova returns “No valid host was found” Error

By default, a Compute service is disabled after 10 consecutive build failures on it. This is to ensure that new build requests are not routed to a broken Compute service. If it is the case, make sure to fix the source of the failures, then re-enable it:

Step 2: Make sure enough resources are available to schedule a resize.

In my case, out of 2 compute nodes, one didn’t had the enough resource for additional VM, but the other node which was already running the VM had enough to resize it. Still the resize didn’t work because, OpenStack was trying to migrate it to other hosts and it was failing!

OpenStack resize VM to same host

By default OpenStack is not allowed to resize VM’s to the same host.

Step 3: Add the below configuration in /etc/nova/nova.conf file under DEFAULT section of the node the VM is running.

allow_resize_to_same_host = True

Step 4: Restart nova service on controller

# systemctl restart openstack-nova-compute openstack-nova-api openstack-nova-console openstack-nova-conductor openstack-nova-scheduler openstack-nova-novncproxy

Step 5: Restart nova service on the node (if compute) the above configurations was added.

# systemctl restart openstack-nova-compute

Now, your VM shall be resized without any error.

Was this article helpful?

Related Articles

Leave a Comment