mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Restore single backed-up volume on a live instance attaches the volume as a Raw image making it unreadable (#10844)
This commit is contained in:
parent
52d986081b
commit
d55aa70f7e
@ -26,6 +26,7 @@ import com.cloud.host.Status;
|
||||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.hypervisor.Hypervisor;
|
||||
import com.cloud.storage.ScopeType;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.storage.StoragePoolHostVO;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.VolumeVO;
|
||||
@ -280,6 +281,7 @@ public class NASBackupProvider extends AdapterBase implements BackupProvider, Co
|
||||
restoredVolume.setPoolId(dataStore.getPoolId());
|
||||
restoredVolume.setPath(restoredVolume.getUuid());
|
||||
restoredVolume.setState(Volume.State.Copying);
|
||||
restoredVolume.setFormat(Storage.ImageFormat.QCOW2);
|
||||
restoredVolume.setSize(backedUpVolumeSize);
|
||||
restoredVolume.setDiskOfferingId(volume.getDiskOfferingId());
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ public class LibvirtRestoreBackupCommandWrapper extends CommandWrapper<RestoreBa
|
||||
private static final String MOUNT_COMMAND = "sudo mount -t %s %s %s";
|
||||
private static final String UMOUNT_COMMAND = "sudo umount %s";
|
||||
private static final String FILE_PATH_PLACEHOLDER = "%s/%s";
|
||||
private static final String ATTACH_DISK_COMMAND = " virsh attach-disk %s %s %s --cache none";
|
||||
private static final String ATTACH_DISK_COMMAND = " virsh attach-disk %s %s %s --driver qemu --subdriver qcow2 --cache none";
|
||||
private static final String CURRRENT_DEVICE = "virsh domblklist --domain %s | tail -n 3 | head -n 1 | awk '{print $1}'";
|
||||
private static final String RSYNC_COMMAND = "rsync -az %s %s";
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user