<fix>[storage]: sync memory volume size before snapshot
@@ -34,10 +34,7 @@ import org.zstack.header.storage.snapshot.*;
import org.zstack.header.storage.snapshot.group.*;
import org.zstack.header.tag.SystemTagVO;
import org.zstack.header.tag.SystemTagVO_;
-import org.zstack.header.vm.AfterReimageVmInstanceExtensionPoint;
-import org.zstack.header.vm.VmInstanceInventory;
-import org.zstack.header.vm.VmInstanceVO;
-import org.zstack.header.vm.VmJustBeforeDeleteFromDbExtensionPoint;
+import org.zstack.header.vm.*;
import org.zstack.header.volume.*;
import org.zstack.identity.AccountManager;
import org.zstack.identity.QuotaUtil;
@@ -757,6 +754,12 @@ public class VolumeSnapshotManagerImpl extends AbstractService implements
}
});
+ if (volumeVO.getType().equals(VolumeType.Memory)) {
+ volumeSize = Q.New(VmInstanceVO.class)
+ .select(VmInstanceVO_.memorySize)
+ .eq(VolumeVO_.vmInstanceUuid, volumeVO.getVmInstanceUuid())
+ .findValue();
+ } else {
flow(new NoRollbackFlow() {
String __name__ = "sync-root-volume-size";
@Override
@@ -789,7 +792,7 @@ public class VolumeSnapshotManagerImpl extends AbstractService implements
return !PrimaryStorageType.valueOf(storageVO.getType()).isSupportCreateVolumeSnapshotCheckCapacity();
}
});
-
+ }
flow(new NoRollbackFlow() {
String __name__ = "check-primary-storage-capacity";
