From: "Jayesh Salvi" Subject: Re: live saving of domU Date: Wed, 10 May 2006 20:29:06 -0500 Message-ID: <871640aa0605101829m1736134bi9c167a6f74f8aeb8@mail.gmail.com> References: <871640aa0605100840t14a9f9deqf5c9be99f56917b7@mail.gmail.com> <20060510163213.GF4954@leeni.uk.xensource.com> <44621BDD.9060401@us.ibm.com> <871640aa0605101206h2742f0d1o70c356bad797747c@mail.gmail.com> <44623F3A.9040308@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1070071670==" Return-path: In-Reply-To: <44623F3A.9040308@us.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Liguori Cc: xen-devel , Ewan Mellor List-Id: xen-devel@lists.xenproject.org --===============1070071670== Content-Type: multipart/alternative; boundary="----=_Part_221_2505356.1147310946609" ------=_Part_221_2505356.1147310946609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 5/10/06, Anthony Liguori wrote: > > Jayesh Salvi wrote: > > > > > > On 5/10/06, *Anthony Liguori* > > wrote: > > > > Guests are aware of the physical addresses of the memory that's bee= n > > allocated to them. Because of this, to save a domain's state in a > > restorable way you need the guest to "canonicalize" itself. The > only > > way to do this today is through a suspend operation which happens > > to be > > a subop of shutdown. Shutdowns are non-recoverable so you cannot > use > > this as a snapshotting mechanism. > > > > > > Thanks, that was informative. But the shutdown you are refering to > > here is not the traditional shutdown of domU right? I mean 'xm > > shutdown' will do proper shutdown of domU OS, the shutdown you are > > referring while doing 'xm save' is different from that, I hope! > > From the perspective of the hypervisor, there isn't a significant > difference between doing an "xm shutdown" or an "xm save". Don't read > too much into that though b/c the vast majority of both operations are > performed in userspace. Unfortunately, this lack of distinction in the > hypervisor is what currently prevents light weight check pointing. > > You could, theoritically, add another entry point in the guest kernel > and use some xenstore magic to force the domain to spin in a loop after > canonicalizing, pause it, switch a register value, then unpause it. > Something like (in psuedo-code): > > while (eax =3D=3D 0) halt; > > Right after canonicalizing. Then pause, and do a > getvcpuinfo/setvcpuinfo to change eax to 1. Then unpause. If you added > another suspend entry point you could probably even avoid tearing down > the devices... While reading more on the topic of backup of virtual machines, I came acros= s the problems and solutions in VMWare world. You can check out the VMWare consolidated backup (VCB) feature introduced in ESX server. ( http://blog.baeke.info/blog/_archives/2006/3/23/1836968.html). The VCB addresses some different problems of backups in virtual environment= , but points relevant to our current thread of conversation: VCB does give a mechanism to quiesce the virtual machine. The virtual disk is mounted on something called junction point, there is some windows specific snapshot mechanism using which the snapshot of the disk is taken. Then traditional softwares are used to do backup this shapshot / junction point. >From this I guess, sooner or later we will need such quisceing mechanism working in Xen. On a little different note, it is amusing to note that VMWare has to do som= e tricky dance of junction point/snapshot, etc. May be VMWare virtual machine= s principally use loopback file systems for virtual disk - that's why they have problem in viewing the same file system from dom0 and domU (consistent or inconsistent). Xen allows devices to be used as boot disk. Hence the fil= e system is visible from dom0 and domU the same way (at least RO from dom0). = I might be wrong. Correct me if you think so. Regards, > > Anthony Liguori > > > The closest thing you can achieve is a localhost migration. There > are > > some caveats to this, of course. The first is that you need to > > have as > > much memory as the domain has available since you'll have a copy > > of the > > domain created briefly while the migration takes > > place. Migrations are > > also quite intrusive since they involve tearing down and bringing > > up all > > the devices. > > > > I've gotten a lot of requests for light weight > checkpointing. AFAIK, > > noone is actually working on it though. > > > > Regards, > > > > Anthony Liguori > > > > > If you had a way to snapshot the storage at the same time as the > > VM, then you > > > could make live snapshotting of VMs work properly. As it is, > > this is not > > > integrated into Xend at the moment, and not supported because of > > the danger of > > > filesystem corruption if you don't know what you are doing. > > > > > > Ewan. > > > > > > _______________________________________________ > > > Xen-devel mailing list > > > Xen-devel@lists.xensource.com Xen-devel@lists.xensource.com> > > > http://lists.xensource.com/xen-devel > > > > > > > > > > > > > -- > > Jayesh > > -----------------------------------------------------------------------= - > > Everything you can imagine is real > > --=20 Jayesh ------------------------------------------------------------------------ Everything you can imagine is real ------=_Part_221_2505356.1147310946609 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

On 5/10/06, Anthony Liguori <alig= uori@us.ibm.com> wrote:
Jayesh Salvi wrote:
>
>
> On 5/10/06, *Anthony Liguori* &= lt;aliguori@us.ibm.com
> &= lt;mailto:aliguori@us.ibm.com>= ;> wrote:
>
>     Guests are aware of the physical a= ddresses of the memory that's been
>     allocate= d to them.  Because of this, to save a domain's state in a
>= ;     restorable way you need the guest to "canoni= calize" itself.  The only
>     way to do this today is through a suspend = operation which happens
>     to be
> =     a subop of shutdown.  Shutdowns are non-recove= rable so you cannot use
>     this as a snapshott= ing mechanism.
>
>
> Thanks, that was informative. But the shutdown you= are refering to
> here is not the traditional shutdown of domU right= ? I mean 'xm
> shutdown' will do proper shutdown of domU OS, the shut= down you are
> referring while doing 'xm save' is different from that, I hope!
From the perspective of the hypervisor, there isn't a significant
= difference between doing an "xm shutdown" or an "xm save&quo= t;.  Don't read
too much into that though b/c the vast majority of both operations are<= br>performed in userspace.  Unfortunately, this lack of distincti= on in the
hypervisor is what currently prevents light weight check point= ing.

You could, theoritically, add another entry point in the guest kerneland use some xenstore magic to force the domain to spin in a loop aftercanonicalizing, pause it, switch a register value, then unpause it.
Something like (in psuedo-code):

while (eax =3D=3D 0) halt;

R= ight after canonicalizing.  Then pause, and do a
getvcpuinfo/s= etvcpuinfo to change eax to 1.  Then unpause.  If you a= dded
another suspend entry point you could probably even avoid tearing d= own
the devices...

While reading more on the topic of = backup of virtual machines, I came across the problems and solutions in VMW= are world. You can check out the VMWare consolidated backup (VCB) feature i= ntroduced in ESX server. ( ht= tp://blog.baeke.info/blog/_archives/2006/3/23/1836968.html).

The= VCB addresses some different problems of backups in virtual environment, b= ut points relevant to our current thread of conversation:
VCB does give a mechanism to quiesce the virtual machine. The virtual d= isk is mounted on something called junction point, there is some windows sp= ecific snapshot mechanism using which the snapshot of the disk is taken. Th= en traditional softwares are used to do backup this shapshot / junction poi= nt.

From this I guess, sooner or later we will need such quisceing mech= anism working in Xen.

On a little different note, it is amusing to n= ote that VMWare has to do some tricky dance of junction point/snapshot, etc= . May be VMWare virtual machines principally use loopback file systems for = virtual disk - that's why they have problem in viewing the same file system= from dom0 and domU (consistent or inconsistent). Xen allows devices to be = used as boot disk. Hence the file system is visible from dom0 and domU the = same way (at least RO from dom0). I might be wrong. Correct me if you think= so.

Reg= ards,

Anthony Liguori

>     The closes= t thing you can achieve is a localhost migration.  There are
>     some caveats to this, of course. &nbs= p;The first is that you need to
>     have as
= >     much memory as the domain has available since = you'll have a copy
>     of the
> &nbs= p;   domain created briefly while the migration takes
>     place.  Migrations are
>&n= bsp;    also quite intrusive since they involve tearing down= and bringing
>     up all
>  &nb= sp;  the devices.
>
>     I've gotten = a lot of requests for light weight checkpointing.  AFAIK,
>     noone is actually working on it though.>
>     Regards,
>
>  &= nbsp;  Anthony Liguori
>
>     > If= you had a way to snapshot the storage at the same time as the
> = ;    VM, then you
>     > could make live snapshotting of VMs w= ork properly.  As it is,
>     this is = not
>     > integrated into Xend at the moment= , and not supported because of
>     the danger o= f
>     > filesystem corruption if you don't k= now what you are doing.
>     >
>     > = Ewan.
>     >
>     = > _______________________________________________
>  &nb= sp;  > Xen-devel mailing list
>     > = Xen-devel@lists.xensource.com <mailto:Xen-devel@lists.xensource.com>
>  = ;   > http://= lists.xensource.com/xen-devel
>     >
>
>
>
>> --
> Jayesh
> ------------------------------------------= ------------------------------
> Everything you can imagine is real



--
Jayesh
--------------------------= ----------------------------------------------
Everything you can imagin= e is real ------=_Part_221_2505356.1147310946609-- --===============1070071670== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1070071670==--