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
This commit is contained in:
Jerry Cai 2015-06-15 14:12:57 +08:00
parent 73362092e6
commit 6d39c193f7
1 changed files with 3 additions and 2 deletions

View File

@ -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')