forbidden traits in flavor not honored

Bug #2063364 reported by birbilakos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

For compatibility reasons of some older VMs, I've used the following cpu_mode and cpu_models definition in one of the compute nodes nova.conf:
[libvirt]
inject_partition = -2
inject_password = False
inject_key = False
virt_type = kvm
live_migration_with_native_tls = true
live_migration_scheme = tls
live_migration_inbound_addr = 172.29.236.114
hw_disk_discard = ignore
disk_cachemodes =
cpu_mode = custom
cpu_models = IvyBridge

In terms of flavor definition, I've set the following trait:
openstack flavor set --property traits:HW_CPU_X86_AVX512BW=forbidden flavor.test

I know for sure that HW_CPU_X86_AVX512BW is not supported in IvyBridge so my understanding is that this trait definition should suffice to select the specific compute node. In fact I have verified that placement service does NOT return the specific compute when quering for the specific trait (and instead returns all other nodes).
Yet, when scheduling an instance using this flavor, I get the following error.

Traceback (most recent call last): File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/nova/conductor/manager.py", line 1654, in schedule_and_build_instances host_lists = self._schedule_instances(context, request_specs[0], File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/nova/conductor/manager.py", line 942, in _schedule_instances host_lists = self.query_client.select_destinations( File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/nova/scheduler/client/query.py", line 41, in select_destinations return self.scheduler_rpcapi.select_destinations(context, spec_obj, File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/nova/scheduler/rpcapi.py", line 160, in select_destinations return cctxt.call(ctxt, 'select_destinations', **msg_args) File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/oslo_messaging/rpc/client.py", line 190, in call result = self.transport._send( File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/oslo_messaging/transport.py", line 123, in _send return self._driver.send(target, ctxt, message, File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 689, in send return self._send(target, ctxt, message, wait_for_reply, timeout, File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 681, in _send raise result nova.exception_Remote.NoValidHost_Remote: No valid host was found. Traceback (most recent call last): File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/oslo_messaging/rpc/server.py", line 244, in inner return func(*args, **kwargs) File "/openstack/venvs/nova-28.0.0/lib/python3.10/site-packages/nova/scheduler/manager.py", line 243, in select_destinations raise exception.NoValidHost(reason="") nova.exception.NoValidHost: No valid host was found.

This seems like a bug of the trait selection logic of nova.

openstack ansible version is 2023.2

birbilakos (birbilis)
description: updated
Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Hey,

Despite I do see this was deployed with OpenStack-Ansible, it feels this has very little to do with deployment method, but rather service itself.

With that I will transfer this bug to Nova project, so that they could assist you.

affects: openstack-ansible → nova
Revision history for this message
birbilakos (birbilis) wrote :

Thank you so much Dmitriy! My bad for clearly not assigning it to the correct project.

Revision history for this message
Marcin Wilk (wilkmarcin) wrote :

@birbilakos

Is it a typo in the bug description or did you set the 'traits' property on the image instead of the flavor? And which one (the image or the flavor) was used to create a VM?

From your bug description:
"In terms of flavor definition, I've set the following trait:
openstack image set --property traits:HW_CPU_X86_AVX512BW=forbidden flavor.test"

Whereas the command above sets a property on the image 'flavor.test'.

But you also say:
"Yet, when scheduling an instance using this flavor, I get the following error.(...)"

Or can you provide outputs from the:
openstack flavor show <flavor used to create a VM>
openstack image show <image used to create a VM>

and the 'openstack server create' command you used.

Revision history for this message
birbilakos (birbilis) wrote (last edit ):

Yes, this was a typo.
It should have said:
openstack flavor set --property traits:HW_CPU_X86_AVX512BW=forbidden flavor.test instead (updated in the first post also).

$ openstack flavor show flavor.test
+----------------------------+----------------------------------------+
| Field | Value |
+----------------------------+----------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| access_project_ids | ['87a83841a4e24c68999ca1b87dc05593'] |
| description | None |
| disk | 150 |
| id | 84044547-1b01-4a13-869c-853c44944de6 |
| name | flavor.test |
| os-flavor-access:is_public | False |
| properties | traits:HW_CPU_X86_AVX512BW='forbidden' |
| ram | 122880 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 8 |
+----------------------------+----------------------------------------+

Creating a VM when using this flavor returns 'No valid host was found'

description: updated
Revision history for this message
birbilakos (birbilis) wrote :

Anyone that can help with this issue?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.