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] Cloning VM from Xen

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Cloning VM from Xen
From: Simon Hobson <linux@xxxxxxxxxxxxxxxx>
Date: Wed, 18 Aug 2010 17:10:33 +0100
Delivery-date: Wed, 18 Aug 2010 09:22:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C6BFCC5.7000506@xxxxxxxxxxx>
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: <4C6BFCC5.7000506@xxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Benjamin Knoth wrote:

i created some virtual machines on SLES 10 with Xen.
Now i would like to use Xen on SLES 11.
My harddisks from all vm are lvm.
Is it possible to clone my existing vm to my new server which runs with
SLES 11?

Short answer - copy the LVs and guest config from one server to the other.

Longer answer :
Create each LV on the new server, copy the contents across from the old one. If the LV is identical in size then you can probably just do a bytewise copy of the LV. Alternatively, you can mount the LV on the DomU and copy all the files across using your favourite tool.

My personal preference is :
mount LV on /mnt on each Dom0
rsync -avH --numeric-ids /mnt/ root@xxxxxxxxxxxxxxxxxxxxxxxxx:/mnt/
scp /etc/xen/guest_cofig_file root@xxxxxxxxxxxxxxxxxxxxxxxxx:/etc/xen
unmount /mnt on each machine
repeat above for each LV

startup guest on new server

Obviously you can take this opportunity to resize volumes, and even re-arrange then (eg you can split a single LV on the old server and make it separate / and /var on the new one - don't forget to alter both the guest config and the guest's /etc/fstab.

--
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

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