Dan Kenigsberg has submitted this change and it was merged.

Change subject: pool: live storage migration implementation
......................................................................


pool: live storage migration implementation

This patch introduces the support for the live storage migration in
VDSM. The following new VM verbs are exposed:

 result = diskReplicateStart(vmId, srcDisk, dstDisk)
 result = diskReplicateFinish(vmId, srcDisk, dstDisk)

The srcDisk and dstDisk are in the DriveSpecVolume format, e.g.:

 driveSpecVolume = {
     'device': 'disk',
     'domainID': <sdUUID>,
     'poolID': <spUUID>,
     'imageID': <imgUUID>,
     'volumeID': <volUUID>,
 }

The srcDisk describes the current image used by the VM and dstDisk
describes the final image destination after the migration is completed.
In diskReplicateStart srcDisk and dstDisk must be different, on
diskReplicateFinish if srcDisk is different from the dstDisk then the
live storage migration is completed, otherwise if srcDisk is equal to
the dstDisk then the live storage migration is aborted and the VM falls
back on the srcDisk (this can also be exploited for live cloning a VM).

The possible returned errors are:

- noVM(1): the VM is not present
- imageErr(13): the image is not present
- replicaErr(55): the replication request failed (e.g.: there is another
  replication ongoing, there is no ongoing replication to stop, etc.)
- unavail(40): the replication is not ready to switch to the destination
  (the streaming process is ongoing), retry later. In the future this
  information will be monitored with an HSM task.
- changeDisk(41): the final operation to switch to the destination
  failed and the VM falls back to the source.

To copy the volume chain the following SPM verbs are now exposed:

 taskId = cloneImageStructure(spUUID, sdUUID, imgUUID, dstSdUUID)
 taskId = syncImageData(spUUID, sdUUID, imgUUID, dstSdUUID, syncType)

The general purpose of these verbs is to expose advanced options to
perform the copy of an image from a source storage domain (sdUUID) to
a destination storage domain (dstSdUUID).
The cloneImageStructure operation is preparing a new identical volume
chain on the destination (dstSdUUID). The syncImageData operation is
performing the real copy (copying the data) from the source volume chain
to the destination.

The 'syncType' parameter supports the following options:

 SYNC_VOLUMES_ALL  # All the volumes are synchronized
 SYNC_VOLUMES_INTERNAL  # Only the internal volumes are synchronized
 SYNC_VOLUMES_LEAF  # Only the leaf volume is synchronized

The returned errors are the regular storage domain errors with a special
emphasis for the ones already returned by copyImage and moveImage.

An example of a full live storage migration flow is:

 ... live snapshot on srcDisk ...

 SPM: cloneImageStructure(spUUID, sdUUID, imgUUID, dstSdUUID)
 ... wait for the imageSync task to finish ...

 VMHOST: diskReplicateStart(srcDisk, dstDisk)

 SPM: syncImageData(spUUID, sdUUID, imgUUID, dstSdUUID,
                    SYNC_VOLUMES_INTERNAL)
 ... wait for the imageSync task to finish ...

 VMHOST: diskReplicateFinish(srcDisk, dstDisk)

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=865384
Signed-off-by: Federico Simoncelli <[email protected]>
Change-Id: I91e641cb1d25feb8a406aa7ad07415587a7ac290
---
M vdsm.spec.in
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm/define.py
M vdsm/libvirtvm.py
M vdsm/storage/hsm.py
M vdsm/storage/image.py
M vdsm/storage/sp.py
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
M vdsm_cli/vdsClient.py
11 files changed, 618 insertions(+), 118 deletions(-)

Approvals:
  Ayal Baron: Looks good to me, approved
  Allon Mureinik: Verified
  Dan Kenigsberg: 


--
To view, visit http://gerrit.ovirt.org/5252
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I91e641cb1d25feb8a406aa7ad07415587a7ac290
Gerrit-PatchSet: 17
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Royce Lv <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to