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 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:

...