Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

2. fine-grained interface. Not only add a VMSnapshotStrategy interface, but also add certain methods on the storage driver.
The VMSnapshotStrategy interface will be the same as option 1.
Will add the following methods on storage driver:
/* volumesBelongToVM is the list of volumes of the VM that created on this storage, storage vendor can either take one snapshot for this volumes in one shot, or take snapshot for each volume separately
The pre-condition: vm is unquiesced.
It will return a Boolean to indicate, do need unquiesce vm or not.
In the default storage driver, it will return false.
*/
boolean takeVMSnapshot(List<VolumeInfo> volumesBelongToVM, VMSnapshot vmSnapshot);
Boolean revertVMSnapshot(List<VolumeInfo> volumesBelongToVM, VMSnapshot vmSnapshot);
Boolean deleteVMSnapshot(List<VolumeInfo> volumesBelongToVM, VMSnapshot vmSNapshot);

Wiki MarkupThe work flow will be: createVMSnapshot api \ -> VMSnapshotManagerImpl: creatVMSnapshot \ -> VMSnapshotStrategy: takeVMSnapshot \ -> storage driver:takeVMSnapshot In the implementation of VMSnapshotStrategy's takeVMSnapshot, the pseudo code looks like:
HypervisorHelper.quiesceVM(vm);
val volumes = vm.getVolumes();
val maps = new Map\[driver, list[VolumeInfo]\]();
Volumes.foreach(volume => maps.put(volume.getDriver, volume :: maps.get(volume.getdriver())))
val needUnquiesce = true;
maps.foreach((driver, volumes) => needUnquiesce = needUnquiesce && driver.takeVMSnapshot(volumes))

By default, the quiesceVM in HypervisorHelper will actually take vm snapshot through hypervisor.

...

a checkbox: "quiesce" added on taking volume snapshot

2. API changes:

a new parameter: quiescevm, added in createVMSnapshot api

a new parameter: quiescevm, added in createSnapshot api

a new parameter: caps, added in ListStoragePools api, which can indicate the capabilities of storage pool. For example, if the storage pool supports "quiesce volume snapshot", it should return "VOLUME_SNAPSHOT_QUIESCEVM" = "true", then UI can show up "quiesce vm" when taking volume snapshot if the volume is created on this storage pool.

3. mgt server code changes:

refactor VMSnapshotManagerImpl, move the code into StorageStrategyFactory and VMSnapshotHelper

add a new helper function called: HypervisorHelper, which quiesceVm and unquiesceVm public interface VMSnapshotHelper {, which has quiesceVm and unquiesceVm methods

The result 

1. For VM snapshot:

  If "quiesce" is choose by user:

     For vmware, vm snapshot will quiesce vm, otherwise, won;t

     For xenserver, this option won't take effect, as current code doesn't use xenserver's snapshot-with-quiesce api at all.

2. For volume snapshot:

    the "quiesce" option won;t take effect, for both vmware and xenserver, will change our current code a lot to implement it if possible.

3. If primary storage is not coming from default storage supported by cloudstack, such as NetApp, above statement is not true. Different storage provider can choose to implement "quiesce" differently.