summaryrefslogtreecommitdiff
path: root/nova/virt/powervm
diff options
context:
space:
mode:
authorDan Smith <danms@us.ibm.com>2013-03-04 19:27:17 -0500
committerDan Smith <danms@us.ibm.com>2013-03-06 17:31:08 -0500
commitf163bffa55d770e70725751f53212792b9de128b (patch)
tree715bfc1b899a713d8d3517e7ebf5a71e38739f62 /nova/virt/powervm
parent2f414f316cb71d0ab8987e56b928697b5d267674 (diff)
downloadnova-f163bffa55d770e70725751f53212792b9de128b.tar.gz
Remove uses of instance['instance_type'] from powervm driver.
This is one change in a series aimed at removing the use of instance-linked instance_type objects, in favor of the decoupled type data in system_metadata. See bug 1140119 for more details. Change-Id: I885a807d00f7f909665da6e7a3382295a43258c9
Diffstat (limited to 'nova/virt/powervm')
-rw-r--r--nova/virt/powervm/blockdev.py5
-rwxr-xr-xnova/virt/powervm/driver.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/nova/virt/powervm/blockdev.py b/nova/virt/powervm/blockdev.py
index 75f90e327f..c8d58d939d 100644
--- a/nova/virt/powervm/blockdev.py
+++ b/nova/virt/powervm/blockdev.py
@@ -20,6 +20,7 @@ import re
from oslo.config import cfg
+from nova.compute import instance_types
from nova.compute import task_states
from nova.image import glance
from nova.openstack.common import excutils
@@ -174,8 +175,8 @@ class PowerVMLocalVolumeAdapter(PowerVMDiskAdapter):
# calculate root device size in bytes
# we respect the minimum root device size in constants
- size_gb = max(instance['instance_type']['root_gb'],
- constants.POWERVM_MIN_ROOT_GB)
+ instance_type = instance_types.extract_instance_type(instance)
+ size_gb = max(instance_type['root_gb'], constants.POWERVM_MIN_ROOT_GB)
size = size_gb * 1024 * 1024 * 1024
try:
diff --git a/nova/virt/powervm/driver.py b/nova/virt/powervm/driver.py
index 7484e91b65..c388eecfd9 100755
--- a/nova/virt/powervm/driver.py
+++ b/nova/virt/powervm/driver.py
@@ -19,6 +19,7 @@ import time
from oslo.config import cfg
+from nova.compute import instance_types
from nova.image import glance
from nova.openstack.common import log as logging
from nova.virt import driver
@@ -276,7 +277,8 @@ class PowerVMDriver(driver.ComputeDriver):
"""
lpar_obj = self._powervm._create_lpar_instance(instance)
- new_lv_size = instance['instance_type']['root_gb']
+ instance_type = instance_types.extract_instance_type(instance)
+ new_lv_size = instance_type['root_gb']
old_lv_size = disk_info['old_lv_size']
if 'root_disk_file' in disk_info:
disk_size = max(int(new_lv_size), int(old_lv_size))