Skip to content

Commit ba00a1a

Browse files
Sateesh Chodapuneediyadvr
authored andcommitted
CLOUDSTACK-7803 Storage live migration of instance may not happen if instance has ISO attached.
BUG-ID:CLOUDSTACK-7803 Summary:Ensure secondary storage is mounted on target host. Reviewed-By:Rajesh Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org> (cherry picked from commit bca0153) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent c8a437b commit ba00a1a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3031,7 +3031,7 @@ protected Answer execute(MigrateWithStorageCommand cmd) {
30313031
throw new Exception(msg);
30323032
}
30333033
mgr.prepareSecondaryStorageStore(secStoreUrl);
3034-
ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl);
3034+
ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnSpecificHost(secStoreUrl, tgtHyperHost);
30353035
if (morSecDs == null) {
30363036
String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl;
30373037
throw new Exception(msg);
@@ -3384,6 +3384,18 @@ public synchronized ManagedObjectReference prepareSecondaryDatastoreOnHost(Strin
33843384
return morDatastore;
33853385
}
33863386

3387+
public synchronized ManagedObjectReference prepareSecondaryDatastoreOnSpecificHost(String storeUrl, VmwareHypervisorHost hyperHost) throws Exception {
3388+
String storeName = getSecondaryDatastoreUUID(storeUrl);
3389+
URI uri = new URI(storeUrl);
3390+
3391+
ManagedObjectReference morDatastore = hyperHost.mountDatastore(false, uri.getHost(), 0, uri.getPath(), storeName.replace("-", ""));
3392+
3393+
if (morDatastore == null)
3394+
throw new Exception("Unable to mount secondary storage on host. storeUrl: " + storeUrl);
3395+
3396+
return morDatastore;
3397+
}
3398+
33873399
private static String getSecondaryDatastoreUUID(String storeUrl) {
33883400
return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString();
33893401
}

0 commit comments

Comments
 (0)