XenServer将HVM转换为半虚拟化

最近,我负责将支持HVM的虚拟机(在Citrix XenServer 5.6.0上运行)的设置转换为PV(半虚拟化)容器的艰巨过程。

该项目的制约因素是:

  1. 迁移后,操作系统必须function相同。
  2. 对操作系统的最小修改(内核/驱动器映射除外)

我也被允许以任何我认为合适的方式更改bootloader(即grub)。

不过,我已经尝试过了,我会先告诉你我的步骤。

目前这个CentOS5.5是特定的:

脚步:

  1. yum安装kernel-xen

    这安装了:2.6.18-194.32.1.el5xen

  2. 编辑:/boot/grub/menu.lst改变我的规格匹配:

    title CentOS (2.6.18-194.32.1.el5xen) root (hd0,0) kernel /vmlinuz-2.6.18-194.32.1.el5xen ro root=/dev/VolGroup00/LogVol00 console=xvc0 initrd /initrd-2.6.18-194.32.1.el5xen.img 

    然后我改变我的XenServer参数匹配:

     xe vm-param-set uuid=[vm uuid] PV-bootloader-args="--kernel /vmlinuz-2.6.18-194.32.1.el5xen --ramdisk /initrd-2.6.18-194.32.1.el5xen.img" xe vm-param-set uuid=[vm uuid] HVM-boot-policy="" xe vm-param-set uuid=[vm uuid] PV-bootloader=pygrub xe vbd-param-set uuid==[Virtual Block Device/VBD uuid] bootable=true 

有些事情要注意,我正在运行VolGroup LVM;)

无论如何,在所有这些步骤(这不是太多!)我启动虚拟机,它启动初始内核就好了,但是我提出了这个错误:

启animation面:

 device-mapper: dm-raid45: initialized v0.2594l Waiting for driver initialization. Scanning and configuring dmraid supported devices Scanning logical volumes Reading all physical volumes. This may take a while... Activating logical volumes Volume group "VolGroup00" not found Creating root device. Mounting root filesystem. mount: could not find filesystem '/dev/root' Setting up other filesystems. Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory setuproot: error mounting /sys: No such file or directory Switching to new root and running init. unmounting old /dev unmounting old /proc unmounting old /sys switchroot: mount failed: No such file or directory 

现在我的提示是它无法检测/因为当你从HVM模式转换到PV时,它会做一些事情(不是那么明显)

在HVM上创buildSR(存储)时,会将其挂载到guest操作系统,如/ dev / hda。

然而在PV模式下,这performance为/ dev / xvda …

这可能是答案吗? 如果是这样,我怎么实现呢?

更新:
所以我已经得到了一些进一步的,因为它现在检测LVM的…

为此,我需要重新编译xen-kernel initrd映像。

命令: mkinitrd -v --builtin=xen_vbd --preload=xenblk initrd-2.6.18-194.32.1.el5xen.img 2.6.18-194.32.1.el5xen

现在,当我启动我得到这个:

启animation面:

 Loading dm-raid45.ko module device-mapper: dm-raid45: initialized v0.2594l Scanning and configuring dmraid supported devices Scanning logical volumes Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2 Activating logical volumes 3 logical volume(s) in volume group "VolGroup00" now active Creating root device. Mounting root filesystem. mount: error mounting /dev/root on /sysroot as ext3: Device or resource busy Setting up other filesystems. Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory setuproot: error mounting /sys: No such file or directory Switching to new root and running init. unmounting old /dev unmounting old /proc unmounting old /sys switchroot: mount failed: No such file or directory Kernel panic - not syncing: Attempted to kill init! 

试试: xe vm-param-set uuid=[vm uuid] PV-args="root=/dev/VolGroup00/LogVol00"