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: Benjamin Knoth <knoth@xxxxxxxxxxx>
Date: Fri, 20 Aug 2010 10:33:16 +0200
Delivery-date: Fri, 20 Aug 2010 01:35:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTim0sBfAexN=BT16TfvvKx3ydf16q3nYPq=6Rr6d@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: <8CBB53B8098D4544A6FF75CFFAD77DF2CA3C0C@xxxxxxxxxxxxxxxxxxxxx> <4C6D3C0F.80701@xxxxxxxxxxx> <AANLkTim0sBfAexN=BT16TfvvKx3ydf16q3nYPq=6Rr6d@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2
Hi,


Am 19.08.2010 23:40, schrieb Fajar A. Nugraha:
On Thu, Aug 19, 2010 at 9:13 PM, Benjamin Knoth <knoth@xxxxxxxxxxx> wrote:
Hey Emerson and all,
same problem on boot.
If i start Yast i only find the old network device in the list with old
mac-adress, which i changed in the config. And the network device isn't
available.
Since you're using SLES, have you contacted Novell support? Not all
people on this list familiar with SLES or Yast.

I contacted novell but i didn't get an useful aswer to this time.

      
If i change the network device on the config to br0, i get the follow
error to start the vm with xm create
Error: Device 1 (vif) could not be connected. Could not find bridge
device br0

But on a other vm the device br0 run.
Here's the basics:
- to be able to easily move domU across different dom0s (or different
versions of dom0), you'd need the domU storage, xen config file, and
(possibly) the kernel used to boot the original domU
- dom0 kernel can be used to boot domU as well. However this might
cause some problem when you change dom0's distro or version. Therefore
I highly recommend that you use kernel inside domU, and boot with
pygrub/pv-grub (which is the default behavior if you use RHEL/Centos).
- domU doesn't really care about the name of dom0's bridge, as long as
it's the same network. It does care about MAC address change.
- you should specifiy a static MAC address for each domU, which is
unique (i.e. not used by other domUs).
- it'd be easier to troubleshoot if you know where domU's config files
are. It could be on /etc/xen, or managed by xend (in which case you
should be able to see it on /var/lib/xend/domains)
- you need to know whether your domU is PV or HVM
The old vm is a PV. My config follows.

      
If i change it to bridge=eth0,model=rtl8139 it starts,
model is only valid for HVM. Are you using PV or HVM?
What is the bridge name on both your old and new dom0? Try running
"brctl show". Blindly changing bridge names by guessing without really
knowing what the real bridge name is might not work as expected.

Here's an example syntax to specify a static MAC address, bridge name,
and vif name:
vif =	['mac=00:16:3E:63:2E:90, bridge=br6, vifname=u-test-eth0']

If i start brctl show i get on both server this with other interface numbers.

bridge name    bridge id        STP enabled    interfaces
eth0        8000.001d096deb32    no        peth0
                                                                vif56.0
                                                                vif8.0
                                                                vif4.0


      
but i find only a
loop-back device on ifconfig and in Yast i find only the old network
device with old ip-adess and mac-adress.
Not familiar with yast. Sorry.

I get this errors on boot.

--------

modprobe: FATAL: Could not load
/lib/modules/2.6.27.45-0.1-xen/modules.dep: No such file or directory
Start by finding domU's config file, and pasting it's content. Is this
kernel located on domU or dom0? Does that directory exist on domU
(i.e. what do you have on domU's /lib/modules/)?

At first glance it looks like you're using dom0's kernel to boot domU,
but since you use a different version of dom0, the kernel booted and
the modules inside domU does not match. If that's the case, then the
quick fix would be to get the original kernel and initrd and copy it
to the new dom0, and use it to boot domU.

I test the standard Kernel and initrd from a new created vm and copied the old Xen Kernel from SLES 10 SP2 on SLES 11 and start the vm with this Kernel.


Here are my both config files for the old and cloned VM.

VM on SLES 11


xm_vars.check()


#kernel = "/boot/vmlinuz-xen"
kernel = "/boot/vmlinuz-2.6.16.60-0.34-xen"
ramdisk = "/boot/initrd-2.6.16.60-0.34-xen"
#ramdisk = "/boot/initrd-xen"


builder='linux'

memory = 4096

name = "vm35"

uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b2"

vcpus = 1 # make your domain a 4-way

vif = [ 'mac=00:16:3e:00:00:d5, bridge=br0', ]
disk = [ 'phy:d/vm35sda1,hda1,w', 'phy:d/vm35sda3,hda3,w', 'phy:d/vm35swap,hda2,w']
netmask="255.255.255.0"
# Set default gateway.
gateway="134.76.28.254"
hostname="vm35"

root = "/dev/hda1"

extra = "3 console=xvc0"


VM on SLES10 SP2



xm_vars.check()
kernel = "/boot/vmlinuz-xen"
ramdisk = "/boot/initrd-xen"
builder='linux'
memory = 4096

name = "vm02"

uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b2"

vcpus = 1 # make your domain a 4-way

vif = [ 'mac=00:16:3e:00:00:12, bridge=xenbr0' ]
disk = [ 'phy:l1/vm2sda1,hda1,w', 'phy:l2/vm2sda2,hda3,w', 'phy:l1/vm2swap,hda2,w']
netmask="255.255.255.0"
gateway="134.76.28.254"
hostname="vm02"
root = "/dev/hda1"

extra = "3 console=xvc0"

I hope it helps.

Best regards

Benjamin
-- 
Benjamin Knoth
Max Planck Digital Library (MPDL)
Systemadministration
Amalienstrasse 33
80799 Munich, Germany
http://www.mpdl.mpg.de

Mail: knoth@xxxxxxxxxxx
Phone:  +49 89 38602 202
Fax:    +49-89-38602-280
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users