WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: "Javier Guerra" <javier@xxxxxxxxxxx>
Subject: Re: [Xen-users] Xen Image File vs LVM
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=QRzjRWlQBAG+NrxZKXJJVLQPoENG01C8dRgjaiuoJQs=; b=xFJKhQaHCWQsM44ZFwCQLI9vuSKAk/OsLwJVBER+eBXTNVQ6pTFzAGg91K7S23mOje C6EQgIlEH8jRsim2wTNGXGTelvoYQ4OSfC/PTqzg4fw4RWEnZbKuFilwDiWIc4p5878u 8oXdgYG8kxZE7619vQ/7GnOuzarzmhpYWEHNg=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <90eb1dc70808041304p6549955bq4a8207f4f1c9a323@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <008e01c8f33f$a39b91f0$ead2b5d0$@net> <ed123fa30807311235i747a62aamcfdada5860d1ea1c@xxxxxxxxxxxxxx> <12c201c8f66a$c2ea9960$48bfcc20$@net> <90eb1dc70808041256p73a03243ibdf47da2ce0c8164@xxxxxxxxxxxxxx> <48bc40670808041301u163e4a41u7a823e993ee20338@xxxxxxxxxxxxxx> <90eb1dc70808041304p6549955bq4a8207f4f1c9a323@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx


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