mirror of https://github.com/apache/cloudstack.git
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 bca015306e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
c8a437b782
commit
ba00a1a081
|
|
@ -3031,7 +3031,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
throw new Exception(msg);
|
||||
}
|
||||
mgr.prepareSecondaryStorageStore(secStoreUrl);
|
||||
ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl);
|
||||
ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnSpecificHost(secStoreUrl, tgtHyperHost);
|
||||
if (morSecDs == null) {
|
||||
String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl;
|
||||
throw new Exception(msg);
|
||||
|
|
@ -3384,6 +3384,18 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
return morDatastore;
|
||||
}
|
||||
|
||||
public synchronized ManagedObjectReference prepareSecondaryDatastoreOnSpecificHost(String storeUrl, VmwareHypervisorHost hyperHost) throws Exception {
|
||||
String storeName = getSecondaryDatastoreUUID(storeUrl);
|
||||
URI uri = new URI(storeUrl);
|
||||
|
||||
ManagedObjectReference morDatastore = hyperHost.mountDatastore(false, uri.getHost(), 0, uri.getPath(), storeName.replace("-", ""));
|
||||
|
||||
if (morDatastore == null)
|
||||
throw new Exception("Unable to mount secondary storage on host. storeUrl: " + storeUrl);
|
||||
|
||||
return morDatastore;
|
||||
}
|
||||
|
||||
private static String getSecondaryDatastoreUUID(String storeUrl) {
|
||||
return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue