Versions Compared

Key

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

...

AuthorDescriptionDate
Rajesh BattalaInitial Revision 
Devdeep SinghIncorporating comments. Added details on api or db changes if any. Added use cases (In progress)03/12/2014

Glossary

Instance/vm - Virtual machine running on a hypervisor. The terms may be used interchangeably.

...

This feature is implemented for Windows Server 2012 R2 and Hyper-V 2012 R2 (Core).

Use cases

  • Live migrate volumes of a virtual machine from one storage pool to another. It could be because
    • The storage pool has to be brought down for maintenance.
    • Move the volumes to a storage pool which gives better performance/IOs etc.
  • Live migrating a virtual machine with its volume on local storage to another host within or across cluster. The administrator doesn't want to bring down the services running on that virtual machine and the host has to be brought down for maintenance.
  • Live migrating a virtual machine with its volume on shared storage to another host in a different cluster.
    • The administrator doesn't want to bring down the services running on that virtual machine and the host on which the instance is running has to be brought down for maintenance. Additionally, the cluster is running low on available capacity.
    • Live migrating a virtual machine with its volume to other hosts in different cluster to better distribute the load across hosts/clusters.

Architecture and Design description

...

  • Volume service gets a request for migrating a volume to another storage pool.
  • It dispatches a call (copyAsync) to the data motion service for migrating the volume.
  • Data motion service checks which data motion strategy can handle migration of a volume to another pool.
  • Data motion strategy (AncientDataMotionStrategy) issues a request (MigrateVolumeCommand) to the hypervisor resource (HypervDirectConnectedResource) to migrate the volume to a given storage pool.
  • HypervDirectConnectedResource serializes the request and forwards the command to the Hyper-V agent running on the host for migrating the volume.
  • The Hyper-V agent handles the MigrateVolumeCommand command. The command holds the information on
    • Which volume has to be live migrated.
    • The vm to which the volume is attached.
    • The destination pool for the volume.
  • The agent lists all the volumes of the vm and identifies which volume needs to be migrated. It sends sets the updated path; from pool details; for the volume and issues a wmi request for migrating the volume.
  • On success or failure of the operation, a response is send to the management server.
  • On receiving the MigrationVolumeAnswer answer from the agent; the data motion strategy checks for success or failure of the operation.
    • On success the volume path is updated and volume moved out of migrating state.
    • On failure, the volume is moved out of migrating state and the failure logged and reported.
Migrating virtual machine with volume
  • Virtual machine manager puts the vm to be migrated in 'Migrating' state and calls the volume service passing a volume to data store map. The map tells which volume of the vm needs to be migrated to which storage pool.
  • Volume service puts the volumes to be migrated in 'Migrating' state and calls the data motion service.
  • Data motion service checks which data motion strategy can handle migration of a vm and its volume. 'HypervStorageMotionStrategy' (a new strategy that is implemented for the hypervisor) returns true that it can handle the migration request for the hypervisor and request is forwarded to it.
  • HypervStorageMotionStrategy issues a request (MigrateWithStorageCommand) to the hypervisor resource (source host) to migrate the vm with its volumes. The resource forwards it to the Hyper-V agent.
  • The Hyper-V agent handles the MigrateWithStorageCommand. The command holds the following information
    • The vm to be migrated.
    • The destination host for the vm.
    • Volume to pool mapping; that is; which volume of the vm needs to be placed on which destination pool.
  • The agent sets the new volume path for each volume of a vm and issues a wmi request for migrating the vm with its volumes to the destination host.
  • On success or failure of the operation, a response is send to the management server.
  • On receiving the answer from the agent; the storage motion strategy checks for success or failure of the operation.
    • On success the volume path is updated and volume and vm moved out of migrating state.
    • On failure, the volume and vm is moved out of migrating state and the failure logged and reported.
Database modifications

In the hypervisor_capabilities table, the entry for Hyper-V 2012 R2 is updated to allow storage migration. In column, storage_migration_supported, the value is set to 1 to allow storage motion for Hyper-V.

Web Services APIs

No new apis are added for this feature. Existing apis; explained in Storage motion in cloudstack; will enable storage motion for Hyper-V too. List of apis used for storage motion

...