Browse Source

Fixes vNUMA resize negative test

When an asymmetric NUMA topology is required, all the NUMA
cells have to be explicitly described.

Nova will reject a request to build / resize an instance if it doesn't
fit into the available NUMA topology. If the compute nodes only have
1 NUMA node, an instance spanning 2 NUMA nodes cannot be built.

Change-Id: I054ad6f567771f12ccf92f690ecd9bb18c4fa532
tags/0.1.0
Claudiu Belu 2 years ago
parent
commit
45e252c159
2 changed files with 30 additions and 2 deletions
  1. 5
    0
      oswin_tempest_plugin/config.py
  2. 25
    2
      oswin_tempest_plugin/tests/scenario/test_vnuma.py

+ 5
- 0
oswin_tempest_plugin/config.py View File

@@ -56,6 +56,11 @@ HyperVGroup = [
56 56
                 default=False,
57 57
                 help="RemoteFX feature is enabled and supported on the "
58 58
                      "compute nodes."),
59
+    cfg.IntOpt('available_numa_nodes',
60
+               default=1,
61
+               help="The maximum number of NUMA cells the compute nodes "
62
+                    "have. If it's less than 2, resize negative tests for "
63
+                    "vNUMA will be skipped."),
59 64
 ]
60 65
 
61 66
 

+ 25
- 2
oswin_tempest_plugin/tests/scenario/test_vnuma.py View File

@@ -13,11 +13,16 @@
13 13
 #    License for the specific language governing permissions and limitations
14 14
 #    under the License.
15 15
 
16
+import testtools
17
+
18
+from oswin_tempest_plugin import config
16 19
 from oswin_tempest_plugin.tests._mixins import migrate
17 20
 from oswin_tempest_plugin.tests._mixins import optional_feature
18 21
 from oswin_tempest_plugin.tests._mixins import resize
19 22
 from oswin_tempest_plugin.tests import test_base
20 23
 
24
+CONF = config.CONF
25
+
21 26
 
22 27
 class HyperVvNumaTestCase(test_base.TestBase,
23 28
                           migrate._MigrateMixin,
@@ -32,5 +37,23 @@ class HyperVvNumaTestCase(test_base.TestBase,
32 37
     _BIGGER_FLAVOR = {'ram': 128, 'extra_specs': {'hw:numa_nodes': '1'}}
33 38
 
34 39
     # NOTE(claudiub): Hyper-V does not support asymmetric NUMA topologies.
35
-    _FEATURE_FLAVOR = {'ram': '128', 'extra_specs': {
36
-        'hw:numa_nodes': '2', 'hw:numa_mem.0': '128'}}
40
+    # The resize should fail in this case.
41
+    _BAD_FLAVOR = {'ram': 64, 'extra_specs': {
42
+        'hw:numa_nodes': '2', 'hw:numa_mem.0': '64', 'hw:numa_cpus.0': '0'}}
43
+
44
+    @testtools.skipUnless(CONF.hyperv.available_numa_nodes > 1,
45
+                          'At least 2 NUMA nodes are required.')
46
+    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
47
+                          'Resize is not available.')
48
+    def test_resize_negative(self):
49
+        new_flavor = self._create_new_flavor(self._get_flavor_ref(),
50
+                                             self._BAD_FLAVOR)
51
+
52
+        # NOTE(claudiub): all NUMA nodes have to be properly defined.
53
+        vcpus = [i for i in range(1, int(new_flavor['vcpus']))]
54
+        extra_specs = {'hw:numa_mem.1': str(int(new_flavor['ram']) - 64),
55
+                       'hw:numa_cpus.1': ','.join(vcpus)}
56
+        self.admin_flavors_client.set_flavor_extra_spec(
57
+            new_flavor['id'], **extra_specs)
58
+
59
+        self._check_resize(new_flavor['id'], expected_fail=True)

Loading…
Cancel
Save