From 6d39c193f732a1dce745ee477cf87526c3d67906 Mon Sep 17 00:00:00 2001 From: Jerry Cai Date: Mon, 15 Jun 2015 14:12:57 +0800 Subject: [PATCH] instance flavor need to map to 'cpus' instead of 'vcpus' instance flavor need to map to 'cpus' instead of 'vcpus' Change-Id: I4fa60bf77979fbf995a278ff1d4ad883637a3254 Closes-Bug: #1464960 --- nova-powervc/powervc/nova/driver/compute/manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nova-powervc/powervc/nova/driver/compute/manager.py b/nova-powervc/powervc/nova/driver/compute/manager.py index 6e80855..212a5e6 100644 --- a/nova-powervc/powervc/nova/driver/compute/manager.py +++ b/nova-powervc/powervc/nova/driver/compute/manager.py @@ -347,8 +347,9 @@ class PowerVCCloudManager(manager.Manager): flavor = self._get_flavor_from_instance(ctx, pvc_instance, db_instance) # Use the instance properties from PowerVC to be accurate - if pvc_instance.get('vcpus') is not None: - vcpus = int(math.ceil(float(pvc_instance.get('vcpus')))) + if pvc_instance.get('cpus') is not None: + # The flavor's 'vcpus' are mapped to PowerVC 'cpus' property + vcpus = int(pvc_instance.get('cpus')) else: vcpus = flavor.get('vcpus')