bug 10005: create directory before copying volume

status 10005: resolved fixed
This commit is contained in:
anthony 2011-05-24 14:12:07 -07:00
parent 9d758866af
commit 08ea2498d3
1 changed files with 4 additions and 4 deletions

View File

@ -5051,6 +5051,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
SR primaryStoragePool = getStorageRepository(conn, poolTO);
String srUuid = primaryStoragePool.getUuid(conn);
if (toSecondaryStorage) {
// Create the volume folder
if (!createSecondaryStorageFolder(conn, remoteVolumesMountPath, volumeFolder)) {
throw new InternalErrorException("Failed to create the volume folder.");
}
VDI vdi = VDI.getByUuid(conn, volumeUUID);
String pUuid = getVhdParent(conn, srUuid, vdi.getUuid(conn), IsISCSI(primaryStoragePool.getType(conn)));
if( pUuid != null ) {
@ -5068,10 +5072,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
removeSR(conn, secondaryStorage);
}
} else {
// Create the volume folder
if (!createSecondaryStorageFolder(conn, remoteVolumesMountPath, volumeFolder)) {
throw new InternalErrorException("Failed to create the volume folder.");
}
String uuid = copy_vhd_to_secondarystorage(conn, mountpoint, volumeUUID, srUuid);
return new CopyVolumeAnswer(cmd, true, null, null, uuid);
}