nova-scheduler fails schedule an instance with odd number of pinned vCPU's

Solution Verified - Updated -

Issue

I have an issue after configuring CPU isolation and pinning on a test platform.

  • The compute has 32 CPU's per host from which 24 have been isolated and configured as vcpu_pin_set in nova.conf of the compute host:
vcpu_pin_set=2,18,10,26,3,19,11,27,4,20,12,28,5,21,13,29,6,22,14,30,7,23,15,31

Also isolated them in grub config to be not used by the system.

  • created a flavor to use 11 vCPUs:
nova flavor-create mytest auto 8192 0 11
nova flavor-key mytest set hw:cpu_policy=dedicated
  • finally boot an instance:
nova boot --flavor mytest --image cirros --availability-zone zone1 myVM
  • Result "No valid host was found. There are not enough hosts available." :
# nova show c0f12248-68c2-42e8-b4b4-cfcbcc19b254
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property                             | Value                                                                                                                                                                                                      |
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                                                                                                                                                                     |
| OS-EXT-AZ:availability_zone          | zone1                                                                                                                                                                                                      |
| OS-EXT-SRV-ATTR:host                 | -                                                                                                                                                                                                          |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                                                                                                                                                                          |
| OS-EXT-SRV-ATTR:instance_name        | instance-0000002e                                                                                                                                                                                          |
| OS-EXT-STS:power_state               | 0                                                                                                                                                                                                          |
| OS-EXT-STS:task_state                | -                                                                                                                                                                                                          |
| OS-EXT-STS:vm_state                  | error                                                                                                                                                                                                      |
| OS-SRV-USG:launched_at               | -                                                                                                                                                                                                          |
| OS-SRV-USG:terminated_at             | -                                                                                                                                                                                                          |
| accessIPv4                           |                                                                                                                                                                                                            |
| accessIPv6                           |                                                                                                                                                                                                            |
| config_drive                         |                                                                                                                                                                                                            |
| created                              | 2016-06-01T07:22:57Z                                                                                                                                                                                       |
| fault                                | {"message": "No valid host was found. There are not enough hosts available.", "code": 500, "details": "  File \"/usr/lib/python2.7/site-packages/nova/conductor/manager.py\", line 671, in build_instances |
|                                      |     request_spec, filter_properties)                                                                                                                                                                       |
|                                      |   File \"/usr/lib/python2.7/site-packages/nova/scheduler/utils.py\", line 337, in wrapped                                                                                                                  |
|                                      |     return func(*args, **kwargs)                                                                                                                                                                           |
|                                      |   File \"/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py\", line 52, in select_destinations                                                                                             |
|                                      |     context, request_spec, filter_properties)                                                                                                                                                              |
|                                      |   File \"/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py\", line 37, in __run_method                                                                                                    |
|                                      |     return getattr(self.instance, __name)(*args, **kwargs)                                                                                                                                                 |
|                                      |   File \"/usr/lib/python2.7/site-packages/nova/scheduler/client/query.py\", line 34, in select_destinations                                                                                                |
|                                      |     context, request_spec, filter_properties)                                                                                                                                                              |
|                                      |   File \"/usr/lib/python2.7/site-packages/nova/scheduler/rpcapi.py\", line 120, in select_destinations                                                                                                     |
|                                      |     request_spec=request_spec, filter_properties=filter_properties)                                                                                                                                        |
|                                      |   File \"/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py\", line 156, in call                                                                                                                |
|                                      |     retry=self.retry)                                                                                                                                                                                      |
|                                      |   File \"/usr/lib/python2.7/site-packages/oslo_messaging/transport.py\", line 90, in _send                                                                                                                 |
|                                      |     timeout=timeout, retry=retry)                                                                                                                                                                          |
|                                      |   File \"/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py\", line 350, in send                                                                                                       |
|                                      |     retry=retry)                                                                                                                                                                                           |
|                                      |   File \"/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py\", line 341, in _send                                                                                                      |
|                                      |     raise result                                                                                                                                                                                           |
|                                      | ", "created": "2016-06-01T07:22:57Z"}                                                                                                                                                                      |
| flavor                               | mytest (5e992e63-a277-4e31-9b55-6c9a937fd5e3)                                                                                                                                                              |
| hostId                               |                                                                                                                                                                                                            |
| id                                   | c0f12248-68c2-42e8-b4b4-cfcbcc19b254                                                                                                                                                                       |
| image                                | cirros (b646c75d-fc4e-4803-b353-f534ca20c38c)                                                                                                                                                              |
| key_name                             | -                                                                                                                                                                                                          |
| metadata                             | {}                                                                                                                                                                                                         |
| name                                 | myVM                                                                                                                                                                                                       |
| os-extended-volumes:volumes_attached | []                                                                                                                                                                                                         |
| status                               | ERROR                                                                                                                                                                                                      |
| tenant_id                            | 7893a743d02f4c6a9879c42f20ef6943                                                                                                                                                                           |
| updated                              | 2016-06-01T07:22:57Z                                                                                                                                                                                       |
| user_id                              | 6825ae4da59a40d79f34faa95b5eb0a2                                                                                                                                                                           |
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  • The same works with an even number of vCPUs

Environment

  • Red Hat OpenStack Platform 7.0
  • nova < openstack-nova-2015.1.2-18.el7ost

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content