Determine instance cores from public flavors API
Fixes bug 1078371 Previously the flavor vcpus used in the CPU utilization metering was available from the nova DB instance representation. Now that we retrieve the on-host instances from the public nova API as opposed to the DB, we need to retrieve the flavor vcpus from the flavors API. Note that it's a known issue with nova that a flavor associated with a running instance can be deleted and re-created with the same ID but a different resource configuration (in this case, a different number of cores would led to an incorrect CPU util calculation). This will be addressed in a future nova patch. Change-Id: I093acb94a4818f671782a3cb4e2c846f29b8cec5
This commit is contained in:
@@ -59,7 +59,7 @@ class TestLibvirtBase(test_base.TestCase):
|
||||
setattr(self.instance, 'OS-EXT-SRV-ATTR:instance_name',
|
||||
self.instance.name)
|
||||
self.instance.id = 1
|
||||
self.instance.flavor = {'name': 'm1.small', 'id': 2}
|
||||
self.instance.flavor = {'name': 'm1.small', 'id': 2, 'vcpus': 1}
|
||||
flags.FLAGS.compute_driver = 'libvirt.LibvirtDriver'
|
||||
flags.FLAGS.connection_type = 'libvirt'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user