Revert "Store correct VirtCPUTopology"

This reverts commit 8358936a24.

The bug patch being reverted was trying to fix is not a bug bug at all
but is actually by design. The NUMA cell CPU
topology was meant to carry information about threads that we want to
expose to the single cell based on how it was fitted with regards to
threading on the host, so that we can expose this information to the
guest OS if possible for optimal performance.

The final topology exposed to the guest takes this information into
account as well as any request for particular topology passed in by the
user and decides on the final solution. There is no reason to store this
as it will be different for different hosts.

We want to revert this as it is really not something that we want to be
doing, and will make it easier to cleanly fix 1501358.

Change-Id: Iae06c468c076337b9d6e85d0d0dc85a063b827d1
Partial-bug: 1501358
Partial-bug: 1467927
This commit is contained in:
Nikola Dipanov 2015-09-30 16:24:28 +01:00
parent 150406679c
commit 46e98cfeb8
3 changed files with 0 additions and 32 deletions

View File

@ -4478,33 +4478,6 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.assertEqual(conf.cpu.cores, 1)
self.assertEqual(conf.cpu.threads, 1)
@mock.patch.object(host.Host, "has_min_version", return_value=True)
def test_get_guest_cpu_config_numa_topology(self, mock_has_min_version):
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
instance_ref = objects.Instance(**self.test_instance)
instance_ref.flavor.vcpus = 2
instance_ref.numa_topology = objects.InstanceNUMATopology(cells=[
objects.InstanceNUMACell(
id=0,
cpuset=set([0, 1]),
memory=1024,
cpu_pinning={})])
image_meta = objects.ImageMeta.from_dict(self.test_image_meta)
disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type,
instance_ref,
image_meta)
self.assertIsNone(instance_ref.numa_topology.cells[0].cpu_topology)
drvr._get_guest_config(instance_ref,
_fake_network_info(self.stubs, 1),
image_meta, disk_info)
topo = instance_ref.numa_topology.cells[0].cpu_topology
self.assertIsNotNone(topo)
self.assertEqual(topo.cores * topo.sockets * topo.threads,
instance_ref.flavor.vcpus)
def test_get_guest_cpu_topology(self):
instance_ref = objects.Instance(**self.test_instance)
instance_ref.flavor.vcpus = 8

View File

@ -708,7 +708,6 @@ def _pack_instance_onto_cores(available_siblings, instance_cell, host_cell_id):
pinning = zip(sorted(instance_cell.cpuset),
itertools.chain(*sliced_sibs))
# NOTE(sfinucan) - this may be overriden later on by the drivers
topology = (instance_cell.cpu_topology or
objects.VirtCPUTopology(sockets=1,
cores=len(sliced_sibs),

View File

@ -3203,10 +3203,6 @@ class LibvirtDriver(driver.ComputeDriver):
topology = hardware.get_best_cpu_topology(
flavor, image_meta, numa_topology=instance_numa_topology)
if instance_numa_topology:
for cell in instance_numa_topology.cells:
cell.cpu_topology = topology
cpu.sockets = topology.sockets
cpu.cores = topology.cores
cpu.threads = topology.threads