File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,26 @@ def test_create_server_with_emulator_threads_isolate(self):
147
147
self .assertTrue (
148
148
numa_topology .cpu_pinning .isdisjoint (
149
149
numa_topology .cpuset_reserved ))
150
- # FIXME(artom) We've not actually powered on the emulator threads core
150
+ self ._assert_cpu_set_state (numa_topology .cpuset_reserved ,
151
+ expected = 'online' )
152
+
153
+ def test_start_stop_server_with_emulator_threads_isolate (self ):
154
+ server = self ._create_server (
155
+ flavor_id = self .isolate_flavor_id ,
156
+ expected_state = 'ACTIVE' )
157
+ # Let's verify that the pinned CPUs are now online
158
+ self ._assert_server_cpus_state (server , expected = 'online' )
159
+ instance = objects .Instance .get_by_uuid (self .ctxt , server ['id' ])
160
+ numa_topology = instance .numa_topology
161
+ # Make sure we've pinned the emulator threads to a separate core
162
+ self .assertTrue (numa_topology .cpuset_reserved )
163
+ self .assertTrue (
164
+ numa_topology .cpu_pinning .isdisjoint (
165
+ numa_topology .cpuset_reserved ))
166
+ self ._assert_cpu_set_state (numa_topology .cpuset_reserved ,
167
+ expected = 'online' )
168
+ # Stop and assert we've powered down the emulator threads core as well
169
+ server = self ._stop_server (server )
151
170
self ._assert_cpu_set_state (numa_topology .cpuset_reserved ,
152
171
expected = 'offline' )
153
172
Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ def power_up(instance: objects.Instance) -> None:
82
82
return
83
83
84
84
cpu_dedicated_set = hardware .get_cpu_dedicated_set_nozero () or set ()
85
- pcpus = instance .numa_topology .cpu_pinning
85
+ pcpus = instance .numa_topology .cpu_pinning .union (
86
+ instance .numa_topology .cpuset_reserved )
86
87
powered_up = set ()
87
88
for pcpu in pcpus :
88
89
if pcpu in cpu_dedicated_set :
@@ -102,7 +103,8 @@ def power_down(instance: objects.Instance) -> None:
102
103
return
103
104
104
105
cpu_dedicated_set = hardware .get_cpu_dedicated_set_nozero () or set ()
105
- pcpus = instance .numa_topology .cpu_pinning
106
+ pcpus = instance .numa_topology .cpu_pinning .union (
107
+ instance .numa_topology .cpuset_reserved )
106
108
powered_down = set ()
107
109
for pcpu in pcpus :
108
110
if pcpu in cpu_dedicated_set :
You can’t perform that action at this time.
0 commit comments