Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,26 @@ public static void syncVolumeToRootFolder(DatacenterMO dcMo, DatastoreMO ds, Str
s_logger.info("Fixup folder-synchronization. move " + fileDsFullPath + " -> " + targetPath);
ds.moveDatastoreFile(fileDsFullPath, dcMo.getMor(), ds.getMor(), targetPath, dcMo.getMor(), true);

if (folderName != null) {
String[] files = ds.listDirContent(folderName);
if (files == null || files.length == 0) {
ds.deleteFolder(folderName, dcMo.getMor());
try {
if (folderName != null) {
String[] files = ds.listDirContent(folderName);
if (files == null || files.length == 0) {
ds.deleteFolder(folderName, dcMo.getMor());
}
}
} catch (Exception e) {
if (e.getMessage().toLowerCase().startsWith("server returned http response code: 500 for url: ") &&
e.getMessage().contains(vmName)) {
String link = "https://github.com/apache/cloudstack/pull/6283";
String message = String.format("Failed to list folder content of VM [name: %s] due to: [%s]. For more information about this error, or "
+ "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 "
+ "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, "
+ "it was successful. If you want to know why this error occurs in VMWare, please contact VMWare's technical support.",
vmName, e.getMessage(), link);
s_logger.warn(message, e);
} else {
s_logger.error(String.format("Failed to sync volume [%s] of VM [%s] due to: [%s].", vmdkName, vmName, e.getMessage()), e);
throw e;
}
}
}
Expand Down