@@ -103,8 +103,8 @@ def test_create_server_with_numa_topology(self):
103
103
nodes.
104
104
"""
105
105
106
- host_info = fakelibvirt .HostInfo (cpu_nodes = 2 , cpu_sockets = 1 ,
107
- cpu_cores = 2 , cpu_threads = 2 )
106
+ host_info = fakelibvirt .HostInfo (
107
+ cpu_nodes = 2 , cpu_sockets = 1 , cpu_cores = 2 , cpu_threads = 2 )
108
108
self .start_compute (host_info = host_info , hostname = 'compute1' )
109
109
110
110
extra_spec = {'hw:numa_nodes' : '2' }
@@ -119,6 +119,41 @@ def test_create_server_with_numa_topology(self):
119
119
self .assertNotIn ('cpu_topology' , inst .numa_topology .cells [0 ])
120
120
self .assertNotIn ('cpu_topology' , inst .numa_topology .cells [1 ])
121
121
122
+ def test_create_server_with_numa_topology_and_cpu_topology_and_pinning (
123
+ self ):
124
+ """Create a server with two NUMA nodes.
125
+
126
+ This should pass and result in a guest NUMA topology with two NUMA
127
+ nodes, pinned cpus and numa affined memory.
128
+ """
129
+
130
+ host_info = fakelibvirt .HostInfo (
131
+ cpu_nodes = 2 , cpu_sockets = 1 , cpu_cores = 4 , cpu_threads = 1 ,
132
+ kB_mem = (1024 * 1024 * 16 )) # 16 GB
133
+ self .start_compute (host_info = host_info , hostname = 'compute1' )
134
+
135
+ extra_spec = {
136
+ 'hw:numa_nodes' : '2' ,
137
+ 'hw:cpu_max_sockets' : '2' ,
138
+ 'hw:cpu_max_cores' : '2' ,
139
+ 'hw:cpu_max_threads' : '8' ,
140
+ 'hw:cpu_policy' : 'dedicated' ,
141
+ 'hw:mem_page_size' : 'any'
142
+ }
143
+ flavor_id = self ._create_flavor (vcpu = 8 , extra_spec = extra_spec )
144
+ self ._run_build_test (flavor_id , end_status = 'ERROR' )
145
+
146
+ # FIXME(sean-k-mooney): The instance should boot but
147
+ # it fails due to https://bugs.launchpad.net/nova/+bug/1910466
148
+ msg = "IndexError: list index out of range"
149
+ self .assertIn (msg , self .stdlog .logger .output )
150
+ # ctx = nova_context.get_admin_context()
151
+ # inst = objects.Instance.get_by_uuid(ctx, server['id'])
152
+ # self.assertEqual(2, len(inst.numa_topology.cells))
153
+ # self.assertLessEqual(inst.vcpu_model.topology.sockets, 2)
154
+ # self.assertLessEqual(inst.vcpu_model.topology.cores, 2)
155
+ # self.assertLessEqual(inst.vcpu_model.topology.threads, 8)
156
+
122
157
def test_create_server_with_numa_fails (self ):
123
158
"""Create a two NUMA node instance on a host with only one node.
124
159
0 commit comments