From c65175aa40324ad7b326364ba9f959c9f236dfb2 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 31 Aug 2010 13:05:42 -0700 Subject: [PATCH] bug 6048: Check createvolume's return status 6048: resolved fixed --- server/src/com/cloud/storage/StorageManagerImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 53395a5a130..6ea715d25ed 100644 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -901,8 +901,9 @@ public class StorageManagerImpl implements StorageManager { return vols; } catch (Exception e) { - s_logger.error("Unexpected exception ", e); - + if (s_logger.isDebugEnabled()) { + s_logger.debug(e.getMessage()); + } if (rootCreated != null) { destroyVolume(rootCreated); } @@ -915,6 +916,9 @@ public class StorageManagerImpl implements StorageManager { public long createUserVM(Account account, VMInstanceVO vm, VMTemplateVO template, DataCenterVO dc, HostPodVO pod, ServiceOfferingVO offering, DiskOfferingVO diskOffering, List avoids, long size) { List volumes = create(account, vm, template, dc, pod, offering, diskOffering, avoids, size); + if( volumes == null || volumes.size() == 0) { + throw new CloudRuntimeException("Unable to create volume for " + vm.getName()); + } for (VolumeVO v : volumes) { long volumeId = v.getId();