Skip to content

Commit f9262b6

Browse files
authored
Merge pull request #56 from shapeblue/sb10-ammendment
[VMWare] error when detaching volume (apache#6283)
2 parents 98b20db + 43cc933 commit f9262b6

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,26 @@ public static void syncVolumeToRootFolder(DatacenterMO dcMo, DatastoreMO ds, Str
178178
s_logger.info("Fixup folder-synchronization. move " + fileDsFullPath + " -> " + targetPath);
179179
ds.moveDatastoreFile(fileDsFullPath, dcMo.getMor(), ds.getMor(), targetPath, dcMo.getMor(), true);
180180

181-
if (folderName != null) {
182-
String[] files = ds.listDirContent(folderName);
183-
if (files == null || files.length == 0) {
184-
ds.deleteFolder(folderName, dcMo.getMor());
181+
try {
182+
if (folderName != null) {
183+
String[] files = ds.listDirContent(folderName);
184+
if (files == null || files.length == 0) {
185+
ds.deleteFolder(folderName, dcMo.getMor());
186+
}
187+
}
188+
} catch (Exception e) {
189+
if (e.getMessage().toLowerCase().startsWith("server returned http response code: 500 for url: ") &&
190+
e.getMessage().contains(vmName)) {
191+
String link = "https://github.com/apache/cloudstack/pull/6283";
192+
String message = String.format("Failed to list folder content of VM [name: %s] due to: [%s]. For more information about this error, or "
193+
+ "to know why ACS tries to check folder content, please check this link [%s]. This error apparently only occurs with datastores that use the NFS protocol and "
194+
+ "in specific versions of VMWare. Users using VMFS or VMWare versions greater than 6.7 have not reported this error. If the operation performed is a volume detach, "
195+
+ "it was successful. If you want to know why this error occurs in VMWare, please contact VMWare's technical support.",
196+
vmName, e.getMessage(), link);
197+
s_logger.warn(message, e);
198+
} else {
199+
s_logger.error(String.format("Failed to sync volume [%s] of VM [%s] due to: [%s].", vmdkName, vmName, e.getMessage()), e);
200+
throw e;
185201
}
186202
}
187203
}

0 commit comments

Comments
 (0)