summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/fake.py1
-rw-r--r--nova/virt/xenapi/volume_utils.py29
2 files changed, 18 insertions, 12 deletions
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
index a46f3fd80..7877b5905 100644
--- a/nova/virt/xenapi/fake.py
+++ b/nova/virt/xenapi/fake.py
@@ -102,6 +102,7 @@ def create_vdi(name_label, read_only, sr_ref, sharable):
'location': '',
'xenstore_data': '',
'sm_config': {},
+ 'VBDs': {},
})
diff --git a/nova/virt/xenapi/volume_utils.py b/nova/virt/xenapi/volume_utils.py
index 4482e465c..8d1d6fb81 100644
--- a/nova/virt/xenapi/volume_utils.py
+++ b/nova/virt/xenapi/volume_utils.py
@@ -152,18 +152,23 @@ class VolumeHelper(HelperBase):
logging.warn(exc)
raise StorageError('Unable to get record of VDI %s on' % vdis[0])
else:
- return session.get_xenapi().VDI.introduce(
- vdi_rec['uuid'],
- vdi_rec['name_label'],
- vdi_rec['name_description'],
- vdi_rec['SR'],
- vdi_rec['type'],
- vdi_rec['sharable'],
- vdi_rec['read_only'],
- vdi_rec['other_config'],
- vdi_rec['location'],
- vdi_rec['xenstore_data'],
- vdi_rec['sm_config'])
+ try:
+ vdi_ref = session.get_xenapi().VDI.introduce(
+ vdi_rec['uuid'],
+ vdi_rec['name_label'],
+ vdi_rec['name_description'],
+ vdi_rec['SR'],
+ vdi_rec['type'],
+ vdi_rec['sharable'],
+ vdi_rec['read_only'],
+ vdi_rec['other_config'],
+ vdi_rec['location'],
+ vdi_rec['xenstore_data'],
+ vdi_rec['sm_config'])
+ except cls.XenAPI.Failure, exc:
+ logging.warn(exc)
+ raise StorageError('Unable to introduce VDI for SR %s'
+ % sr_ref)
@classmethod
@defer.inlineCallbacks