From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHIK3-0001W6-F7 for qemu-devel@nongnu.org; Fri, 30 Jan 2015 15:37:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHIJy-0006kt-MG for qemu-devel@nongnu.org; Fri, 30 Jan 2015 15:37:47 -0500 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:33952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHIJy-0006kk-He for qemu-devel@nongnu.org; Fri, 30 Jan 2015 15:37:42 -0500 Received: by mail-oi0-f52.google.com with SMTP id h136so36507465oig.11 for ; Fri, 30 Jan 2015 12:37:40 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <54CBD9C8.2040909@redhat.com> Date: Fri, 30 Jan 2015 20:37:40 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] vm live storage migration approach. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yaodong Yang Cc: qemu-devel On Fri, Jan 30, 2015 at 8:13 PM, Yaodong Yang wrote: > An follow up questions. > > Suppose I have a running VM with two virtual disks, I would like to migrate > the vm from host A to host B. Both host A and host B have their own isolated > storage devices. Is there anyway to migrate the vm's memory, two virtual > disk images and other states together from host A to host B? Can > drive_mirror command itself finish this job? I noticed that drive_mirror > only mirror for one virtual disk and require both the source and destination > share the same storage namespace. I do not know how to migrate the whole VM > (memory, storage, network ) together from host A to host B, given that host > A and host B have NO shared storage resource. > > Could you show me an example, if possible? > > I know "migrate -b" works well for this purpose. But the downside is > "migrate -b" does not mirror Write Requests to both host A and host B during > migration. In this case, "migrate -b" has a higher VM downtime during the > migration. Hi Yaodong, The answers to these questions are in libvirt's source code. It orchestrates live migration between two hosts. Multiple independent drive_mirror jobs can run. That's how you handle multiple disks. The regular migrate command (without -b) can be used if drive_mirror is in place and fully synced. Libvirt sets up an NBD server on the destination host. The source host runs drive_mirror to copy over the contents of the disk images. Once the drive_mirror command has completed syncing data the regular 'migrate' command can be used to send device state and RAM over to the destination host. See qemuMigrationDriveMirror() in libvirt. migrate -b is a legacy feature that is being replaced by drive_mirror. Stefan