Re: [Libguestfs] Migrating file based Xen RHEL5.4 to KVM
On Mon, May 17, 2010 at 02:13:02AM +0200, Martin Jeppesen wrote:
I was wondering, if you can help me out with a answer or two about migrating file based RHEL5.4 Xen guests to RHEL5.5 KVM?
Reading the source code to virt-v2v, it seams to me that migrating RHEL 5.4 file based guests would be:
* Log in to the guest # yum install kernel # vi /etc/rc.local modprobe cirrus modprobe virtio_blk modprobe virtio_net
# halt -p
Is it really that simple for RHEL 5.4 guests?
Should I make any changes to the guest config, when using network bridge br0 on KVM for the guests?
CC'd to the mailing list, in case someone knows the answer to this. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
-----Original Message----- From: libguestfs-bounces@redhat.com [mailto:libguestfs- bounces@redhat.com] On Behalf Of Richard W.M. Jones Sent: Monday, May 17, 2010 10:46 AM To: Martin Jeppesen; libguestfs@redhat.com Subject: Re: [Libguestfs] Migrating file based Xen RHEL5.4 to KVM
On Mon, May 17, 2010 at 02:13:02AM +0200, Martin Jeppesen wrote:
I was wondering, if you can help me out with a answer or two about migrating file based RHEL5.4 Xen guests to RHEL5.5 KVM?
Reading the source code to virt-v2v, it seams to me that migrating RHEL 5.4 file based guests would be:
* Log in to the guest # yum install kernel # vi /etc/rc.local modprobe cirrus modprobe virtio_blk modprobe virtio_net
# halt -p
Is it really that simple for RHEL 5.4 guests?
Should I make any changes to the guest config, when using network bridge br0 on KVM for the guests?
Guests are unaware of the network configuration in the host, e.g. the bridge name. You should make sure the correct bridge name is set in the OVF file. virt_v2v script will handle that for you if you remove the comments from the config file network section.
CC'd to the mailing list, in case someone knows the answer to this.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Guests are unaware of the network configuration in the host, e.g. the bridge name. You should make sure the correct bridge name is set in the OVF file. virt_v2v script will handle that for you if you remove the comments from the config file network section.
Excellent. What about the preparation of the guest? Is this all that I have to do?: * Log in to the guest # yum install kernel # vi /etc/rc.local modprobe cirrus modprobe virtio_blk modprobe virtio_net # halt -p
On 17/05/10 16:33, Martin Jeppesen wrote:
Guests are unaware of the network configuration in the host, e.g. the bridge name. You should make sure the correct bridge name is set in the OVF file. virt_v2v script will handle that for you if you remove the comments from the config file network section.
Excellent.
What about the preparation of the guest? Is this all that I have to do?:
* Log in to the guest # yum install kernel # vi /etc/rc.local modprobe cirrus
You meant to change xorg.conf here, not modprobe
modprobe virtio_blk modprobe virtio_net
You don't want to be putting any of these things in /etc/rc.local. You'll also need to rebuild initrd.
# halt -p
virt-v2v will do everything required to migrate a RHEL 5.4 Xen guest to KVM. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
You meant to change xorg.conf here, not modprobe
Thanks.
modprobe virtio_blk modprobe virtio_net
You don't want to be putting any of these things in /etc/rc.local.
So these are loaded as default in the RHEL5.4 kernel?
You'll also need to rebuild initrd.
Doesn't "yum install kernel" do that for me?
virt-v2v will do everything required to migrate a RHEL 5.4 Xen guest to KVM.
Yes, but file based guests are not supported, and I have a few of those =)
On Mon, May 17, 2010 at 08:13:16PM +0200, Martin Jeppesen wrote:
You'll also need to rebuild initrd.
Doesn't "yum install kernel" do that for me?
No, it's way more complex than that in virt-v2v. "yum install kernel" runs /sbin/new-kernel-pkg which (eventually) runs plain mkinitrd. Unfortunately that just makes an initrd suitable for the current (ie. pre-migration) hardware. What you have to do is to run mkinitrd with all the right parameters (by examining /sbin/new-kernel-pkg by hand) plus some extra parameters to install the virtio drivers, something like 'mkinitrd --preload=virtio_blk [...]'. You need at least the block driver in order to boot, and after booting you should probably run /sbin/new-kernel-pkg again. IMHO it would be better for the kernel to ship with a standard initrd that does everything possible. dracut was meant to solve these issues, but in reality it's just a much slower replacement for mkinitrd. (Also they should have just used Debian's initramfs.) Anyway, I'd suggest you use virt-v2v. It supports file-based guests just fine. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
No, it's way more complex than that in virt-v2v. "yum install kernel" runs /sbin/new-kernel-pkg which (eventually) runs plain mkinitrd. Unfortunately that just makes an initrd suitable for the current (ie. pre-migration) hardware.
What you have to do is to run mkinitrd with all the right parameters (by examining /sbin/new-kernel-pkg by hand) plus some extra parameters to install the virtio drivers, something like 'mkinitrd --preload=virtio_blk [...]'. You need at least the block driver in order to boot, and after booting you should probably run /sbin/new-kernel-pkg again.
IMHO it would be better for the kernel to ship with a standard initrd that does everything possible. dracut was meant to solve these issues, but in reality it's just a much slower replacement for mkinitrd. (Also they should have just used Debian's initramfs.)
Very interesting!
Anyway, I'd suggest you use virt-v2v. It supports file-based guests just fine.
Ahh. Now I see how it works. The migration is done entirely on the KVM host when the guest is offline. So I have actually the Xen guest locally on the KVM host connected through the libvirt. Which is why I just can give virt-v2v the domain? Thanks a bunch.
On Thu, May 20, 2010 at 05:11:36PM +0200, Martin Jeppesen wrote:
So I have actually the Xen guest locally on the KVM host connected through the libvirt. Which is why I just can give virt-v2v the domain?
virt-v2v -ic [...] where ... is the remote URL: http://libvirt.org/uri.html The virt-v2v man page is very helpful. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
virt-v2v -ic [...]
where ... is the remote URL:
The virt-v2v man page is very helpful.
okay, I am ready to try, but having trouble with the install. Using latest checkout from git Is it the Perl modules that isn't being intalled along with virt-v2v? ~$ cd download/virt-v2v/ ~/download/virt-v2v$ su Password: [root@amd virt-v2v]# perl Build.PL Deleting _build Creating custom builder _build/lib/Module/Build/VirtV2V.pm in _build/lib/Module/Build Checking whether your kit is complete... WARNING: the following files are missing in your kit: ChangeLog META.yml Please inform the author. Checking prerequisites... Looks good Deleting Build Removed previous script 'Build' Creating new 'Build' script for 'virt-v2v' version '0.6.0' [root@amd virt-v2v]# ./Build Copying v2v/virt-v2v.pl -> blib/script/virt-v2v.pl Deleting blib/script/virt-v2v.pl.bak process_locale_files make: Entering directory `/home/maj/download/virt-v2v/po' cd .; \ targetdir='../blib/locale'; \ languages='es it or pl ru te uk zh_CN'; \ for lang in $languages; do \ mkdir -p "$targetdir/$lang/LC_MESSAGES" || exit 1; \ dest="$targetdir/$lang/LC_MESSAGES/virt-v2v.mo"; \ cat="$lang.mo"; \ echo "installing $cat as $dest"; \ cp -f $cat $dest && chmod 644 $dest || exit 1; \ done installing es.mo as ../blib/locale/es/LC_MESSAGES/virt-v2v.mo installing it.mo as ../blib/locale/it/LC_MESSAGES/virt-v2v.mo installing or.mo as ../blib/locale/or/LC_MESSAGES/virt-v2v.mo installing pl.mo as ../blib/locale/pl/LC_MESSAGES/virt-v2v.mo installing ru.mo as ../blib/locale/ru/LC_MESSAGES/virt-v2v.mo installing te.mo as ../blib/locale/te/LC_MESSAGES/virt-v2v.mo installing uk.mo as ../blib/locale/uk/LC_MESSAGES/virt-v2v.mo installing zh_CN.mo as ../blib/locale/zh_CN/LC_MESSAGES/virt-v2v.mo make: Leaving directory `/home/maj/download/virt-v2v/po' Manifying blib/script/virt-v2v -> blib/bindoc/virt-v2v.1 [root@amd virt-v2v]# cd v2v/ [root@amd v2v]# ./virt-v2v.pl Can't locate Sys/VirtV2V.pm in @INC (@INC contains: /usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl .) at ./virt-v2v.pl line 32. BEGIN failed--compilation aborted at ./virt-v2v.pl line 32. [root@amd v2v]# ~$ find /usr/|grep virt-v2v find: `/usr/lib64/audit': Permission denied ~$
On Thu, May 20, 2010 at 06:18:17PM +0200, Martin Jeppesen wrote:
[root@amd v2v]# ./virt-v2v.pl Can't locate Sys/VirtV2V.pm in @INC (@INC contains:
Have you got 'perl-Sys-Virt' installed? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On 17/05/10 19:13, Martin Jeppesen wrote:
You meant to change xorg.conf here, not modprobe
Thanks.
modprobe virtio_blk modprobe virtio_net
You don't want to be putting any of these things in /etc/rc.local.
So these are loaded as default in the RHEL5.4 kernel?
You'll also need to rebuild initrd.
Doesn't "yum install kernel" do that for me?
You'll need to rebuild it with your virtio devices in there explicitly. It won't pick this up by default. You'll also want to add them to modprobe.conf. Putting them in rc.local won't work at all, because this can only be loaded after the root device can be read. If your root device is on virtio_blk, and your initrd hasn't already loaded it, it will have kernel panicked long before this.
virt-v2v will do everything required to migrate a RHEL 5.4 Xen guest to KVM.
Yes, but file based guests are not supported, and I have a few of those =)
Do you mean you just have the disk images and no metadata? How do you launch them normally? If it's from Xen in RHEL 5, we support that. You'll have to install libvirt first, which will pick up your existing Xen guests automatically. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (4)
-
Amos Benari -
Martin Jeppesen -
Matthew Booth -
Richard W.M. Jones