Pass CONF proc weight to LPAR builder
Fix code to pass the configured uncapped_proc_weight to the pypowervm VM standardizer. Without this, it was defaulting to the value in pypowervm versus the drivers CONF value (which happened to be the same.) Change-Id: I00cfc66612a59225558e9eff5636fe824a929566
This commit is contained in:
@@ -59,6 +59,14 @@ class TestVMBuilder(test.TestCase):
|
||||
self.host_w = mock.MagicMock()
|
||||
self.lpar_b = vm.VMBuilder(self.host_w, self.adpt)
|
||||
|
||||
def test_conf_values(self):
|
||||
# Test driver CONF values are passed to the standardizer
|
||||
self.flags(uncapped_proc_weight=75, proc_units_factor=.25,
|
||||
group='powervm')
|
||||
lpar_bldr = vm.VMBuilder(self.host_w, self.adpt)
|
||||
self.assertEqual(75, lpar_bldr.stdz.uncapped_weight)
|
||||
self.assertEqual(.25, lpar_bldr.stdz.proc_units_factor)
|
||||
|
||||
def test_format_flavor(self):
|
||||
"""Perform tests against _format_flavor."""
|
||||
instance = objects.Instance(**powervm.TEST_INSTANCE)
|
||||
|
||||
@@ -210,7 +210,8 @@ class VMBuilder(object):
|
||||
self.adapter = adapter
|
||||
self.host_w = host_w
|
||||
self.stdz = lpar_bldr.DefaultStandardize(
|
||||
self.host_w, proc_units_factor=CONF.powervm.proc_units_factor)
|
||||
self.host_w, uncapped_weight=CONF.powervm.uncapped_proc_weight,
|
||||
proc_units_factor=CONF.powervm.proc_units_factor)
|
||||
|
||||
def lpar_builder(self, instance, flavor):
|
||||
"""Returns the pypowervm LPARBuilder for a given Nova flavor.
|
||||
|
||||
Reference in New Issue
Block a user