Search code examples
openstackubuntu-20.04openstack-nova

openstack nova resize fail : nova.exception.NoValidHost: No valid host was found


I have got a VM in VMware on which openstack is installed. Openstack has two instances (2GB,1VCPU and 4GB,4VCPU). I changed the size of one of the instance having 4GB, 4VCPU to 8 GB using nova resize and it worked. Now I need RAM atleast 16 GB and VCPUs 6 but the resize command finishes way too early (within seconds) without generating error and RAM size has not upgraded.

I finally found following error in nova-conductor.log

nova.exception.NoValidHost: No valid host was found. 
: nova.exception_Remote.NoValidHost_Remote: No valid host was found. 
2022-05-09 10:57:11.622 56 WARNING nova.scheduler.utils [req-31c98f42-d465-4773-9b4a-3474aef85a1c 10f23c55b2ce420aa1e757062f3874f8 c458f62c51d249ef9bf2b9f11c4ddb98 - default default] [instance: 7b0e27e4-8c78-4dc5-bf38-3cfc02d356d8] Setting instance to ACTIVE state.: nova.exception_Remote.NoValidHost_Remote: No valid host was found. 
2022-05-09 11:01:46.757 55 WARNING nova.scheduler.utils [req-cfa535cc-c19f-4b75-8fde-224d8f3610d5 10f23c55b2ce420aa1e757062f3874f8 c458f62c51d249ef9bf2b9f11c4ddb98 - default default] Failed to compute_task_migrate_server: No valid host was found. 
Traceback (most recent call last):

  File "/var/lib/kolla/venv/lib/python3.8/site-packages/oslo_messaging/rpc/server.py", line 241, in inner
return func(*args, **kwargs)

  File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/scheduler/manager.py", line 209, in select_destinations
raise exception.NoValidHost(reason="")

nova.exception.NoValidHost: No valid host was found. 
: nova.exception_Remote.NoValidHost_Remote: No valid host was found. 
2022-05-09 11:01:46.759 55 WARNING nova.scheduler.utils [req-cfa535cc-c19f-4b75-8fde-224d8f3610d5 10f23c55b2ce420aa1e757062f3874f8 c458f62c51d249ef9bf2b9f11c4ddb98 - default default] [instance: 7b0e27e4-8c78-4dc5-bf38-3cfc02d356d8] Setting instance to ACTIVE state.: nova.exception_Remote.NoValidHost_Remote: No valid host was found.

I have read in some articles that changing ram_allocation_ratio and cpu_allocation_ratio will work but I dont know exactly how I should change it in my case. My VM where openstack is deployed has 25 GB Ram and 16 processor cores while the host machine has 32 GB RAM and 32 logical processors (16 cores). How can I modify these variables or is there something else I am missing?

EDIT: I was able to solve the problem by analyzing the output of openstack hypervisor stats show. The flavor I was using to extend the size was demanding more disk space (80G) then the one showed in hypervisor stats (47G). By extending the size of VM and then directory /var/lib (since i am using docker style deployment), the issue resolved.


Solution

  • Have you set the reserved_host_memory_mb in nova.conf?

    What's the version about your deployed openstack?

    The default ram_allocation_ratio is 1.5, and you could set it to 2 or more, then check whether the error No valid host was found. fixed or not. This is the Sample Configuration File.

    Get your hypervisor stats details by openstack hypervisor stats show. Make sure that system resource sufficiently, maybe there is some limit in your environment such as ports, disk or others.

    Update for others reference:

    The root cause is that the flavor with which instance was created has disk capacity 80G, but only get free_disk_gb is 47 by hypervisor stats. And OP fixed it by extend the host(hypervisor)'s disk capacity.