[libvirt] [PATCH v2] libvirt support to force convergence of live guest migration

Hello, 'am sending this updated patch as an attachment (as I was having some issues with my smtp server and git send-email setup). Thanks, Vinod

Chegu Vinod wrote:
Hello, 'am sending this updated patch as an attachment (as I was having some issues with my smtp server and git send-email setup). Thanks, Vinod
Subject: [PATCH v2] libvirt support to force convergence of live guest migration
Changes since RFC (i.e. v1) patch : - Incorporated feedback from Jiri Denemark
Looks like you addressed all of Jiri's comments from V1, except for the name of the VIR_MIGRATE_AUTO_CONVERGE flag. But I don't have a better suggestion either.
Busy enterprise workloads hosted on large sized VM's tend to dirty memory faster than the transfer rate achieved via live guest migration. Despite some good recent improvements (& using dedicated 10Gig NICs between hosts) the live migration may NOT converge.
Recently support was added in qemu (version 1.6) to allow a user to choose if they wish to force convergence of their migration via a new migration capability : "auto-converge". This feature allows for qemu to auto-detect lack of convergence and trigger a throttle-down of the VCPUs.
This patch includes the libvirt support needed to trigger this feature. (Testing is in progress)
Signed-off-by: Chegu Vinod <chegu_vinod@hp.com> --- include/libvirt/libvirt.h.in | 1 + src/qemu/qemu_migration.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_migration.h | 3 ++- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 1 + tools/virsh-domain.c | 7 +++++++
As mentioned earlier, this needs documented in virsh.pod, similar to the virsh.pod changes Jiri made when introducing the VIR_MIGRATE_COMPRESSED flag in commit ecfff1da. Regards, Jim

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Chegu Vinod, I have tested your updated patch on s390x platform. My migration tests are finished successfully. On 07.02.2014 00:44, Chegu Vinod wrote:
Hello, 'am sending this updated patch as an attachment (as I was having some issues with my smtp server and git send-email setup). Thanks, Vinod
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
- -- Mit freundlichen Grüßen / Kind regards Daniel Hansel IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTDKQ8AAoJEJszBMQcau4W5GoQAJEdzJ/SLDdEBCGnpgayJiPx qc3YmNiBavIEx+q+rcjnBWyskZSDC/SJ/oY+vSchXSLB9QP6PcyNyqk6vlCYLZDR F5cdvbRm1HdV/5U7dEmAZis4QaY1Ia1WvuqUtpMCqGIq66y+vOBunzUqFq+tRcqM pTSMi8h6VRdIcIjwRVzq0/uxaTvjOPinc/8nGzI89pn0IrWFZXnzbFkWt0WK4iCs EjkzFUPXvC06Uh3wCQjt5f9UJhY1n4hODh8MitKX0glh92aNVHrHlq5W04lMBtkT ciEcnuQd0amW8nKEUBnny81+mZ3Ps18aOwN/6GKe7EPZsM4EkI3s7u956mtB1K4h VrWbaomKeA3A9E3+EcJz9xm6MoVDZ3UTm+yoiJafaCgFxtUQoLQBJ9/cyVDdYQqB dNXWhUCpPPkMJD0OMkecgKZK8Bh6B2+qMj+VW9POnl7ehele54Hj+i5GvvxR6hjk /TjCQQKIH1tDLA6BR6lYGLMhCyHgqKlyooZVQGOeHr0PKD/Q2CWr4PB++GBcbrKe RtsTzGJh60lBdy21AvVlSnMG/kWlHIqsrkSIyZFAY/OMux34CrKT5OyK6PYWqEIx 3/eVfMP+uojQRwn5015qZjCLCGsQReNr4bRNQPD7UgtQb67JRwJD4wKyttj5ghn2 RL86r7h7/5Uv/zrlQNE/ =pO88 -----END PGP SIGNATURE-----

On Thu, Feb 06, 2014 at 15:44:36 -0800, Chegu Vinod wrote:
Hello, 'am sending this updated patch as an attachment (as I was having some issues with my smtp server and git send-email setup). Thanks, Vinod
Subject: [PATCH v2] libvirt support to force convergence of live guest migration
Changes since RFC (i.e. v1) patch : - Incorporated feedback from Jiri Denemark
Busy enterprise workloads hosted on large sized VM's tend to dirty memory faster than the transfer rate achieved via live guest migration. Despite some good recent improvements (& using dedicated 10Gig NICs between hosts) the live migration may NOT converge.
Recently support was added in qemu (version 1.6) to allow a user to choose if they wish to force convergence of their migration via a new migration capability : "auto-converge". This feature allows for qemu to auto-detect lack of convergence and trigger a throttle-down of the VCPUs.
This patch includes the libvirt support needed to trigger this feature. (Testing is in progress)
Signed-off-by: Chegu Vinod <chegu_vinod@hp.com> --- include/libvirt/libvirt.h.in | 1 + src/qemu/qemu_migration.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_migration.h | 3 ++- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 1 + tools/virsh-domain.c | 7 +++++++ 6 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 295d551..c0fc08b 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -1200,6 +1200,7 @@ typedef enum { VIR_MIGRATE_OFFLINE = (1 << 10), /* offline migrate */ VIR_MIGRATE_COMPRESSED = (1 << 11), /* compress data during migration */ VIR_MIGRATE_ABORT_ON_ERROR = (1 << 12), /* abort migration on I/O errors happened during migration */ + VIR_MIGRATE_AUTO_CONVERGE = (1 << 13), /* force convergence */ } virDomainMigrateFlags;
Since VIR_MIGRATE_AUTO_CONVERGE is a source-only flag now (destination host does not do anything if it sees it), we should not even send it there. Otherwise migration with this flag set would be impossible to a host with older libvirtd that does not support this new flag. It is the same situation as with VIR_MIGRATE_ABORT_ON_ERROR. Otherwise the patch is good. And since it took me so long to look at this patch (I was sick and then I forgot about it), I fixed this for you. ACK with the following patch squashed in and pushed. Jirka diff --git i/src/libvirt.c w/src/libvirt.c index 2201b07..c5c3136 100644 --- i/src/libvirt.c +++ w/src/libvirt.c @@ -4408,7 +4408,8 @@ virDomainMigrateVersion1(virDomainPtr domain, if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) flags |= VIR_MIGRATE_PAUSED; - destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR; + destflags = flags & ~(VIR_MIGRATE_ABORT_ON_ERROR | + VIR_MIGRATE_AUTO_CONVERGE); /* Prepare the migration. * @@ -4538,7 +4539,8 @@ virDomainMigrateVersion2(virDomainPtr domain, if (ret == 0 && info.state == VIR_DOMAIN_PAUSED) flags |= VIR_MIGRATE_PAUSED; - destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR; + destflags = flags & ~(VIR_MIGRATE_ABORT_ON_ERROR | + VIR_MIGRATE_AUTO_CONVERGE); VIR_DEBUG("Prepare2 %p flags=%lx", dconn, destflags); ret = dconn->driver->domainMigratePrepare2 @@ -4710,7 +4712,8 @@ virDomainMigrateVersion3Full(virDomainPtr domain, if (ret == 0 && state == VIR_DOMAIN_PAUSED) flags |= VIR_MIGRATE_PAUSED; - destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR; + destflags = flags & ~(VIR_MIGRATE_ABORT_ON_ERROR | + VIR_MIGRATE_AUTO_CONVERGE); VIR_DEBUG("Prepare3 %p flags=%x", dconn, destflags); cookiein = cookieout; diff --git i/src/qemu/qemu_migration.c w/src/qemu/qemu_migration.c index cbb3d2f..57e2436 100644 --- i/src/qemu/qemu_migration.c +++ w/src/qemu/qemu_migration.c @@ -3627,7 +3627,8 @@ static int doPeer2PeerMigrate2(virQEMUDriverPtr driver, if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) flags |= VIR_MIGRATE_PAUSED; - destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR; + destflags = flags & ~(VIR_MIGRATE_ABORT_ON_ERROR | + VIR_MIGRATE_AUTO_CONVERGE); VIR_DEBUG("Prepare2 %p", dconn); if (flags & VIR_MIGRATE_TUNNELLED) { @@ -3820,7 +3821,8 @@ doPeer2PeerMigrate3(virQEMUDriverPtr driver, if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) flags |= VIR_MIGRATE_PAUSED; - destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR; + destflags = flags & ~(VIR_MIGRATE_ABORT_ON_ERROR | + VIR_MIGRATE_AUTO_CONVERGE); VIR_DEBUG("Prepare3 %p", dconn); cookiein = cookieout;
participants (4)
-
Chegu Vinod
-
Daniel Hansel
-
Jim Fehlig
-
Jiri Denemark