Merge "VMware: updates resource provider trait list"

This commit is contained in:
Zuul
2024-10-16 19:04:53 +00:00
committed by Gerrit Code Review
2 changed files with 9 additions and 0 deletions
@@ -2144,6 +2144,9 @@ class VMwareAPIVMTestCase(test.NoDBTestCase,
}
inventory = self.pt.data(self.node_name).inventory
self.assertEqual(expected, inventory)
traits = self.pt.data(self.node_name).traits
# nova with vmware only supports HW_ARCH_X86_64
self.assertEqual(traits, {'HW_ARCH_X86_64'})
def test_invalid_datastore_regex(self):
+6
View File
@@ -23,6 +23,7 @@ import os
import re
import os_resource_classes as orc
import os_traits as ot
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import units
@@ -529,6 +530,11 @@ class VMwareVCDriver(driver.ComputeDriver):
# where cpu traits are added. In the vmware world, this is where we
# would add nested providers representing tenant VDC and similar.
# nova with vmware only supports HW_ARCH_X86_64
cpu_arch_trait = 'HW_ARCH_X86_64'
if cpu_arch_trait in ot.get_traits('HW_ARCH_'):
provider_tree.add_traits(nodename, cpu_arch_trait)
def prepare_for_spawn(self, instance):
"""Perform pre-checks for spawn."""
self._vmops.prepare_for_spawn(instance)