Updated Branches: refs/heads/4.3 6558ceea7 -> 8b0a46502
CLOUDSTACK-5122. [VMware] During upgrade from 4.1 system vms don't come up with 'ROOT-x-y VMDK file not found' exception. During VM start, if VM already exists and CS finds a matching disk in storage for each of the existing disk then the VM is reconfigured with VM's existing disk information. This existing disk information for a VM is got from vCenter. CS checks if a matching disk exists in storage by checking if there is a disk in storage whose name atleast partially matches with the name of the existing disk. Post 4.1, Volume path has been changed to ROOT-<instanceId> from ROOT-<instanceId>-<volumeId>. Hence in case of an upgraded setup (pre 4.1 to 4.2) during search for an existing disk in storage even though ROOT-<instanceId>-<volumeId> has been deleted, CS does a postive match of the old existing disk because of the partial match with the new disk ROOT-<instanceId> that exists in storage. And so when VM is being powered on by vCenter it looks for ROOT-<instanceId>-<volumeId> and fails to power on. Solution - While looking for a VM's matching disk in storage, instead of checking if a disk with a partial match exists check if a disk with the exact name exists. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8b0a4650 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8b0a4650 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8b0a4650 Branch: refs/heads/4.3 Commit: 8b0a46502a749f1665a76c0b0de2c2595f09eff0 Parents: 6558cee Author: Likitha Shetty <[email protected]> Authored: Fri Nov 22 16:43:17 2013 +0530 Committer: Likitha Shetty <[email protected]> Committed: Mon Nov 25 14:47:13 2013 +0530 ---------------------------------------------------------------------- .../cloud/hypervisor/vmware/mo/VirtualMachineDiskInfoBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b0a4650/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineDiskInfoBuilder.java ---------------------------------------------------------------------- diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineDiskInfoBuilder.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineDiskInfoBuilder.java index 41c6db6..8c7db34 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineDiskInfoBuilder.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineDiskInfoBuilder.java @@ -88,7 +88,7 @@ public class VirtualMachineDiskInfoBuilder { for(String backing : chain) { DatastoreFile file = new DatastoreFile(backing); - if(file.getFileBaseName().contains(diskBackingFileBaseName)) + if(file.getFileBaseName().equals(diskBackingFileBaseName)) return true; }
