mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5508. Vmware - When there are multiple secondary stores, the newly added secondary store is not being selected for backing up snapshots.
If the snapshot being backed up is a a delta snapshot, pick the image store where the parent snapshot is stored. Otheriwse pick a random image store.
This commit is contained in:
parent
a9ca480354
commit
289c8a09ea
|
|
@ -219,7 +219,12 @@ public class SnapshotServiceImpl implements SnapshotService {
|
|||
// the same store as its parent since
|
||||
// we are taking delta snapshot
|
||||
private DataStore findSnapshotImageStore(SnapshotInfo snapshot) {
|
||||
if (snapshot.getParent() == null) {
|
||||
Boolean fullSnapshot = true;
|
||||
Object payload = snapshot.getPayload();
|
||||
if (payload != null) {
|
||||
fullSnapshot = (Boolean)payload;
|
||||
}
|
||||
if (fullSnapshot) {
|
||||
return dataStoreMgr.getImageStore(snapshot.getDataCenterId());
|
||||
} else {
|
||||
SnapshotInfo parentSnapshot = snapshot.getParent();
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ import org.apache.log4j.Logger;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.hypervisor.Hypervisor;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.storage.CreateSnapshotPayload;
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
import com.cloud.storage.Snapshot;
|
||||
|
|
@ -108,7 +110,8 @@ public class XenserverSnapshotStrategy extends SnapshotStrategyBase {
|
|||
|
||||
boolean fullBackup = true;
|
||||
SnapshotDataStoreVO parentSnapshotOnBackupStore = snapshotStoreDao.findLatestSnapshotForVolume(snapshot.getVolumeId(), DataStoreRole.Image);
|
||||
if (parentSnapshotOnBackupStore != null) {
|
||||
HypervisorType hypervisorType = snapshot.getBaseVolume().getHypervisorType();
|
||||
if (parentSnapshotOnBackupStore != null && hypervisorType == Hypervisor.HypervisorType.XenServer) { // CS does incremental backup only for XenServer
|
||||
int _deltaSnapshotMax = NumbersUtil.parseInt(configDao.getValue("snapshot.delta.max"),
|
||||
SnapshotManager.DELTAMAX);
|
||||
int deltaSnap = _deltaSnapshotMax;
|
||||
|
|
|
|||
Loading…
Reference in New Issue