[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Xen Image File vs LVM


  • To: "Javier Guerra" <javier@xxxxxxxxxxx>
  • From: "Grant McWilliams" <grantmasterflash@xxxxxxxxx>
  • Date: Mon, 4 Aug 2008 16:16:33 -0700
  • Cc: Chris Edwards <cedwards@xxxxxxxxxxxxxxxx>, Michael March <mmarch@xxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 04 Aug 2008 16:17:14 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=N5D68Q9Srzy27ioM5VsK79p7f6YXhtA3THkYCEu/TzzQm+OiD0EtSuUfE7HuXB5PvT 9dlZVsnj+15QsnEsefozJQAEi5s618tnjAleuvEfqoO/38+NIO/tqKN20l6VxWpvUbbc OwY+AjVESzvHZVRVPM9x3KB+C0UsK32Nkh1Co=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>



On Mon, Aug 4, 2008 at 1:04 PM, Javier Guerra <javier@xxxxxxxxxxx> wrote:
On Mon, Aug 4, 2008 at 3:01 PM, Michael March <mmarch@xxxxxxxxx> wrote:
>>
>>> 3.        If I have a xen guest os in a LV how would I migrate the guest os
>>> from one machine to the other?  Create identical LV on new machine?
>>
>> to migrate VMs, the storage has to be accessible from both machines
>> with the same reference.  when using image files, that means a shared
>> filesystem (NFS, GFS, OCFS, etc.), when using LVs, that means the VG
>> must be accessible from both hosts, usually with a SAN or SAN-like
>> setup (FC, iSCSI, drbd, AoE, (g)nbd, etc)
>
> Is this for 'live' migrations or any migration of a VM?

sorry, didn't read the whole question.

this is for live migrations.  for 'manual' migrations, you can get by
copying the data (and i guess you could also migrate between image
files and LVs, but i haven't tried that (yet))


--
Javier


You can go between LVs and files too really easy. I've started putting tutorials up on these things as I get to them at http://grantmcwilliams.com/index.php?option=com_content&view=category&id=97&Itemid=379

The URL will be changing though as I implement SEO on my site.

--------------------------------------------------------------------------------------------------------------

How to move from a tap:aio file to Logical Volume Management

In Xen we can provide virtualized hard drives several different ways. It's not uncommon to create a large empty file using dd and then specify it as the hard drive like this.

name = "mailserver"
memory = "1024"
disk = [ 'tap:aio:/srv/xen/mailserver.img,xvda,w', ]
vif = [ 'bridge=xenbr0', ]
bootloader="/usr/bin/pygrub"
vcpus=2
>>

In this example /srv/xen/mailserver.img is our file. In a lot of ways LVM is more powerful and faster so moving our test server to LVM makes sense once we've gotten serious about deploying it. Moving from tap:aio to LVM is much easier than you think, here's how.

1. Shutdown domain.

xm shutdown mailserver

2. Create the Logical Volume

You'll need a Logical Volume the same size as your Xen disk file. In this example the Xen disk file is 10GB and I'll assume you already created it. This could easily turn into an LVM tutorial if I don't.

10 GB Disk file: /srv/xen/mailserver.img
10 GB Logical Volume:  /dev/VolGroup00/LogVolMAIL

3. Copy disk file to Logical Volume

dd if=/srv/xen/mailserver.img of=/dev/VolGroup00/LogVolMAIL -bs 1024

4. Edit the Xen domain config file

name = "mailserver"
memory = "1024"
disk = [ 'phy:/dev/VolGroup00/LogVolMAIL,xvda,w', ]
vif = [ 'bridge=xenbr0', ]
bootloader="/usr/bin/pygrub"
vcpus=2
>>

5. Restart domain

xm create -c mailserver


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.