mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8118. Root volume migration fails with 'No such disk device' in case of vCenter 5.5 setup.
If an exact match is being done while locating disk chain by name, don't trim snapshot postfix appended to the disk name.
This commit is contained in:
parent
521258bafb
commit
ddcae8a930
@ -3205,7 +3205,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
||||
}
|
||||
|
||||
private int getVirtualDiskInfo(VirtualMachineMO vmMo, String srcDiskName) throws Exception {
|
||||
Pair<VirtualDisk, String> deviceInfo = vmMo.getDiskDevice(srcDiskName, true);
|
||||
Pair<VirtualDisk, String> deviceInfo = vmMo.getDiskDevice(srcDiskName, false);
|
||||
if (deviceInfo == null) {
|
||||
throw new Exception("No such disk device: " + srcDiskName);
|
||||
}
|
||||
|
||||
@ -1931,10 +1931,13 @@ public class VirtualMachineMO extends BaseMO {
|
||||
|
||||
DatastoreFile dsSrcFile = new DatastoreFile(vmdkDatastorePath);
|
||||
String srcBaseName = dsSrcFile.getFileBaseName();
|
||||
String trimmedSrcBaseName = trimSnapshotDeltaPostfix(srcBaseName);
|
||||
|
||||
srcBaseName = trimSnapshotDeltaPostfix(srcBaseName);
|
||||
|
||||
s_logger.info("Look for disk device info from volume : " + vmdkDatastorePath + " with trimmed base name: " + srcBaseName);
|
||||
if (matchExactly) {
|
||||
s_logger.info("Look for disk device info from volume : " + vmdkDatastorePath + " with base name: " + srcBaseName);
|
||||
} else {
|
||||
s_logger.info("Look for disk device info from volume : " + vmdkDatastorePath + " with trimmed base name: " + trimmedSrcBaseName);
|
||||
}
|
||||
|
||||
if (devices != null && devices.size() > 0) {
|
||||
for (VirtualDevice device : devices) {
|
||||
@ -1957,7 +1960,7 @@ public class VirtualMachineMO extends BaseMO {
|
||||
return new Pair<VirtualDisk, String>((VirtualDisk)device, deviceNumbering);
|
||||
}
|
||||
} else {
|
||||
if (backingBaseName.contains(srcBaseName)) {
|
||||
if (backingBaseName.contains(trimmedSrcBaseName)) {
|
||||
String deviceNumbering = getDeviceBusName(devices, device);
|
||||
|
||||
s_logger.info("Disk backing : " + diskBackingInfo.getFileName() + " matches ==> " + deviceNumbering);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user