Christopher Hunt
2009-Nov-06 19:49 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
First let me say that I'm not a sysadmin, but am simply wearing that hat this week so please excuse my ignorance. I need to temporarily move some virtual servers from a CentOS-KVM platform to a CentOS-XEN platform while I do some upgrades to the CentOS box. I've created a local LV, and used DD and SCP to transfer the block device from the VKM machine to the XEN machine. For quite a while I struggled with the "Error: (2, 'Invalid kernel', 'xc_dom_parse_elf_kernel: ELF image has no shstrtab\n')" error but thanks to Nick Couchman from http://lists.xensource.com/archives/html/xen-users/2008-03/msg00603.html, I've passed that. Now I'm stuck with a kernel panic situation. Unfortunately the kernel panic error doesn't appear using "xm console" and flashes so quickly through "virt-viewer" that I can't get any details. I think it may have to do with the differing file structures on the 2 Host machines. The KVM machine mounts / on /dev/mapper/vg00-root whereas the XEN machine mounts / on /dev/mapper/VMM01-KVMvg00-c5root00: [root at VMM01-KVM ~]# mount /dev/mapper/vg00-root on / type ext3 (rw) [root at VMM03-XEN xen]# mount /dev/mapper/VMM01-KVMvg00-c5root00 on / type ext3 (rw) Interesting log file entries: [2009-11-06 10:27:26 xend 5112] DEBUG (blkif:27) exception looking up device number for xvda: [Errno 2] No such file or directory: '/dev/xvda' [2009-11-06 10:27:26 xend 5112] DEBUG (blkif:27) exception looking up device number for xvda: [Errno 2] No such file or directory: '/dev/xvda' -------------------------------------------------------------------------------- The domU is configured thusly: [root at VMM03-XEN xen]# cat /etc/xen/guest02 # Automatically generated xen config file name = "guest02" memory = "1024" disk = [ 'phy:/dev/VMM01-KVMvg00/guest02,xvda,w', ] vif = [ 'mac=00:16:3e:5c:f1:dd, bridge=xenbr0', ] vfb = ["type=vnc,vncunused=1"] #bootloader="/usr/bin/pygrub" kernel = "/boot/vmlinuz-2.6.18-164.6.1.el5xen" ramdisk = "/boot/initrd-2.6.18-164.6.1.el5xen.img" vcpus=1 on_reboot = 'restart' on_crash = 'restart' #root = "/dev/VMM01-KVMvg00/c5root00 ro" #extra = "single selinux=0" extra = "ro" -------------------------------------------------------------------------------->From the domU instance running on the KVM box:[root at guest02 ~]# cat /etc/fstab /dev/vg00/root / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/vg00/swap swap swap defaults 0 0 [root at guest02 ~]# cat /etc/gr group group- grub.conf -------------------------------------------------------------------------------- [root at guest02 ~]# cat /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/vg00/root divider=10 notsc # initrd /initrd-version.img #boot=/dev/vda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-164.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/vg00/root divider=10 notsc initrd /initrd-2.6.18-164.el5.img title CentOS (2.6.18-128.7.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-128.7.1.el5 ro root=/dev/vg00/root divider=10 notsc initrd /initrd-2.6.18-128.7.1.el5.img title CentOS (2.6.18-128.4.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-128.4.1.el5 ro root=/dev/vg00/root divider=10 notsc initrd /initrd-2.6.18-128.4.1.el5.img title CentOS (2.6.18-128.2.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-128.2.1.el5 ro root=/dev/vg00/root divider=10 notsc initrd /initrd-2.6.18-128.2.1.el5.img title CentOS (2.6.18-128.1.10.el5) root (hd0,0) kernel /vmlinuz-2.6.18-128.1.10.el5 ro root=/dev/vg00/root divider=10 notsc initrd /initrd-2.6.18-128.1.10.el5.img -------------------------------------------------------------------------------- Dom-0 Log files: [root at VMM03-XEN xen]# tail -f /var/log/xen/xend.log [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:206) XendDomainInfo.create(['vm', ['name', 'guest02'], ['memory', '1024'], ['on_reboot', 'restart'], ['on_crash', 'restart'], ['vcpus', 1], ['image', ['linux', ['kernel', '/boot/vmlinuz-2.6.18-164.6.1.el5xen'], ['ramdisk', '/boot/initrd-2.6.18-164.6.1.el5xen.img'], ['args', 'ro']]], ['device', ['vbd', ['uname', 'phy:/dev/VMM01-KVMvg00/guest02'], ['dev', 'xvda'], ['mode', 'w']]], ['device', ['vif', ['bridge', 'xenbr0'], ['mac', '00:16:3e:5c:f1:dd']]], ['device', ['vkbd']], ['device', ['vfb', ['vncunused', '1'], ['type', 'vnc'], ['xauthority', '/root/.Xauthority']]]]) [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:328) parseConfig: config is ['vm', ['name', 'guest02'], ['memory', '1024'], ['on_reboot', 'restart'], ['on_crash', 'restart'], ['vcpus', 1], ['image', ['linux', ['kernel', '/boot/vmlinuz-2.6.18-164.6.1.el5xen'], ['ramdisk', '/boot/initrd-2.6.18-164.6.1.el5xen.img'], ['args', 'ro']]], ['device', ['vbd', ['uname', 'phy:/dev/VMM01-KVMvg00/guest02'], ['dev', 'xvda'], ['mode', 'w']]], ['device', ['vif', ['bridge', 'xenbr0'], ['mac', '00:16:3e:5c:f1:dd']]], ['device', ['vkbd']], ['device', ['vfb', ['vncunused', '1'], ['type', 'vnc'], ['xauthority', '/root/.Xauthority']]]] [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:445) parseConfig: result is {'features': None, 'image': ['linux', ['kernel', '/boot/vmlinuz-2.6.18-164.6.1.el5xen'], ['ramdisk', '/boot/initrd-2.6.18-164.6.1.el5xen.img'], ['args', 'ro']], 'cpus': None, 'vcpu_avail': None, 'backend': [], 'uuid': None, 'on_reboot': 'restart', 'cpu_weight': None, 'memory': 1024, 'cpu_cap': None, 'localtime': None, 'timer_mode': None, 'start_time': None, 'on_poweroff': None, 'on_crash': 'restart', 'device': [('vbd', ['vbd', ['uname', 'phy:/dev/VMM01-KVMvg00/guest02'], ['dev', 'xvda'], ['mode', 'w']]), ('vif', ['vif', ['bridge', 'xenbr0'], ['mac', '00:16:3e:5c:f1:dd']]), ('vkbd', ['vkbd']), ('vfb', ['vfb', ['vncunused', '1'], ['type', 'vnc'], ['xauthority', '/root/.Xauthority']])], 'bootloader': None, 'maxmem': None, 'shadow_memory': None, 'name': 'guest02', 'bootloader_args': None, 'vcpus': 1, 'cpu': None} [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:1774) XendDomainInfo.construct: None [2009-11-06 10:27:26 xend 5112] DEBUG (balloon:145) Balloon: 3145436 KiB free; need 4096; done. [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:1900) XendDomainInfo.initDomain: 50 256 [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:1941) _initDomain:shadow_memory=0x0, maxmem=0x400, memory=0x400. [2009-11-06 10:27:26 xend 5112] DEBUG (balloon:145) Balloon: 3145436 KiB free; need 1048576; done. [2009-11-06 10:27:26 xend 5112] INFO (image:139) buildDomain os=linux dom=50 vcpus=1 [2009-11-06 10:27:26 xend 5112] DEBUG (image:208) domid = 50 [2009-11-06 10:27:26 xend 5112] DEBUG (image:209) memsize = 1024 [2009-11-06 10:27:26 xend 5112] DEBUG (image:210) image /boot/vmlinuz-2.6.18-164.6.1.el5xen [2009-11-06 10:27:26 xend 5112] DEBUG (image:211) store_evtchn = 1 [2009-11-06 10:27:26 xend 5112] DEBUG (image:212) console_evtchn = 2 [2009-11-06 10:27:26 xend 5112] DEBUG (image:213) cmdline = ro [2009-11-06 10:27:26 xend 5112] DEBUG (image:214) ramdisk /boot/initrd-2.6.18-164.6.1.el5xen.img [2009-11-06 10:27:26 xend 5112] DEBUG (image:215) vcpus = 1 [2009-11-06 10:27:26 xend 5112] DEBUG (image:216) features [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:114) DevController: writing {'protocol': 'x86_32-abi', 'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vkbd/50/0'} to /local/domain/50/device/vkbd/0. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:116) DevController: writing {'frontend-id': '50', 'domain': 'guest02', 'frontend': '/local/domain/50/device/vkbd/0', 'state': '1', 'online': '1'} to /local/domain/0/backend/vkbd/50/0. [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:633) Checking for duplicate for uname: /dev/VMM01-KVMvg00/guest02 [phy:/dev/VMM01-KVMvg00/guest02], dev: xvda, mode: w [2009-11-06 10:27:26 xend 5112] DEBUG (blkif:27) exception looking up device number for xvda: [Errno 2] No such file or directory: '/dev/xvda' [2009-11-06 10:27:26 xend 5112] DEBUG (blkif:27) exception looking up device number for xvda: [Errno 2] No such file or directory: '/dev/xvda' [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:114) DevController: writing {'virtual-device': '51712', 'device-type': 'disk', 'protocol': 'x86_32-abi', 'backend-id': '0', 'state': '1', 'backend': '/local/domain/0/backend/vbd/50/51712'} to /local/domain/50/device/vbd/51712. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:116) DevController: writing {'domain': 'guest02', 'frontend': '/local/domain/50/device/vbd/51712', 'format': 'raw', 'dev': 'xvda', 'state': '1', 'params': '/dev/VMM01-KVMvg00/guest02', 'mode': 'w', 'online': '1', 'frontend-id': '50', 'type': 'phy'} to /local/domain/0/backend/vbd/50/51712. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:114) DevController: writing {'mac': '00:16:3e:5c:f1:dd', 'handle': '0', 'protocol': 'x86_32-abi', 'backend-id': '0', 'state': '1', 'backend': '/local/domain/0/backend/vif/50/0'} to /local/domain/50/device/vif/0. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:116) DevController: writing {'bridge': 'xenbr0', 'domain': 'guest02', 'handle': '0', 'script': '/etc/xen/scripts/vif-bridge', 'state': '1', 'frontend': '/local/domain/50/device/vif/0', 'mac': '00:16:3e:5c:f1:dd', 'online': '1', 'frontend-id': '50'} to /local/domain/0/backend/vif/50/0. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:114) DevController: writing {'protocol': 'x86_32-abi', 'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vfb/50/0'} to /local/domain/50/device/vfb/0. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:116) DevController: writing {'vncunused': '1', 'domain': 'guest02', 'frontend': '/local/domain/50/device/vfb/0', 'xauthority': '/root/.Xauthority', 'state': '1', 'online': '1', 'frontend-id': '50', 'type': 'vnc'} to /local/domain/0/backend/vfb/50/0. [2009-11-06 10:27:26 xend 5112] DEBUG (vfbif:11) Spawn: ['/usr/lib/xen/bin/qemu-dm', '-M', 'xenpv', '-d', '50', '-domain-name', 'guest02', '-vnc', '127.0.0.1:0', '-vncunused', '-k', 'en-us'] [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:992) Storing VM details: {'shadow_memory': '0', 'uuid': '21fa15ea-febf-1cbd-6360-cfa02eb73d8c', 'on_reboot': 'restart', 'start_time': '1257532046.49', 'on_poweroff': 'destroy', 'name': 'guest02', 'xend/restart_count': '0', 'vcpus': '1', 'vcpu_avail': '1', 'memory': '1024', 'on_crash': 'restart', 'image': '(linux (kernel /boot/vmlinuz-2.6.18-164.6.1.el5xen) (ramdisk /boot/initrd-2.6.18-164.6.1.el5xen.img) (args ro))', 'maxmem': '1024'} [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:1027) Storing domain details: {'console/ring-ref': '1084703', 'console/port': '2', 'name': 'guest02', 'console/limit': '1048576', 'vm': '/vm/21fa15ea-febf-1cbd-6360-cfa02eb73d8c', 'domid': '50', 'cpu/0/availability': 'online', 'memory/target': '1048576', 'store/ring-ref': '1055232', 'store/port': '1'} [2009-11-06 10:27:26 xend.XendDomainInfo 5112] DEBUG (XendDomainInfo:1249) XendDomainInfo.handleShutdownWatch [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices vif. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:164) Waiting for 0. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:509) hotplugStatusCallback /local/domain/0/backend/vif/50/0/hotplug-status. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:509) hotplugStatusCallback /local/domain/0/backend/vif/50/0/hotplug-status. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:523) hotplugStatusCallback 1. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices usb. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices vbd. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:164) Waiting for 51712. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:509) hotplugStatusCallback /local/domain/0/backend/vbd/50/51712/hotplug-status. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:523) hotplugStatusCallback 1. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices irq. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices vkbd. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:164) Waiting for 0. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:509) hotplugStatusCallback /local/domain/0/backend/vkbd/50/0/hotplug-status. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:523) hotplugStatusCallback 1. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices vfb. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:164) Waiting for 0. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:509) hotplugStatusCallback /local/domain/0/backend/vfb/50/0/hotplug-status. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:523) hotplugStatusCallback 1. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices pci. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices ioports. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices tap. [2009-11-06 10:27:26 xend 5112] DEBUG (DevController:158) Waiting for devices vtpm. [2009-11-06 10:27:26 xend 5112] INFO (XendDomain:387) Domain guest02 (50) unpaused. [root at VMM03-XEN xen]# xm create guest02 ; xm console guest02 Using config file "./guest02". Started domain guest02 Linux version 2.6.18-164.6.1.el5xen (mockbuild at builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Nov 3 17:53:47 EST 2009 BIOS-provided physical RAM map: Xen: 0000000000000000 - 0000000040800000 (usable) 304MB HIGHMEM available. 727MB LOWMEM available. NX (Execute Disable) protection: active ACPI in unprivileged domain disabled Built 1 zonelists. Total pages: 264192 Kernel command line: ro Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Initializing CPU#0 CPU 0 irqstacks, hard=c0750000 soft=c0730000 PID hash table entries: 4096 (order: 12, 16384 bytes) Xen reported: 2992.688 MHz processor. Console: colour dummy device 80x25 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Software IO TLB disabled vmalloc area: ee000000-f4ffe000, maxmem 2d7fe000 Memory: 1025064k/1056768k available (2162k kernel code, 22592k reserved, 887k data, 176k init, 311304k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay using timer specific routine.. 7493.78 BogoMIPS (lpj=14987562) Security Framework v1.0.0 initialized SELinux: Initializing. selinux_register_security: Registering secondary module capability Capability LSM initialized as secondary Mount-cache hash table entries: 512 CPU: Trace cache: 12K uops, L1 D cache: 16K CPU: L2 cache: 2048K Checking 'hlt' instruction... OK. SMP alternatives: switching to UP code Freeing SMP alternatives: 13k freed Brought up 1 CPUs checking if image is initramfs... it is Freeing initrd memory: 6980k freed Grant table initialized NET: Registered protocol family 16 Brought up 1 CPUs PCI: setting up Xen PCI frontend stub ACPI: Interpreter disabled. Linux Plug and Play Support v0.97 (c) Adam Belay pnp: PnP ACPI: disabled xen_mem: Initialising balloon driver. usbcore: registered new driver usbfs usbcore: registered new driver hub PCI: System does not support PCI PCI: System does not support PCI NetLabel: Initializing NetLabel: domain hash size = 128 NetLabel: protocols = UNLABELED CIPSOv4 NetLabel: unlabeled traffic allowed by default NET: Registered protocol family 2 IP route cache hash table entries: 32768 (order: 5, 131072 bytes) TCP established hash table entries: 131072 (order: 8, 1048576 bytes) TCP bind hash table entries: 65536 (order: 7, 524288 bytes) TCP: Hash tables configured (established 131072 bind 65536) TCP reno registered audit: initializing netlink socket (disabled) type=2000 audit(1257533537.470:1): initialized highmem bounce pool size: 64 pages VFS: Disk quotas dquot_6.5.1 Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) Initializing Cryptographic API alg: No test for crc32c (crc32c-generic) ksign: Installing public key data Loading keyring - Added public key 5CA5E7AEC7491D45 - User ID: CentOS (Kernel Module GPG key) io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered (default) pci_hotplug: PCI Hot Plug PCI Core version: 0.5 rtc: IRQ 8 is not free. Non-volatile memory driver v1.2 Linux agpgart interface v0.101 (c) Dave Jones brd: module loaded Xen virtual console successfully installed as xvc0 Event-channel device installed. Console: switching to colour frame buffer device 100x37 input: Xen Virtual Keyboard/Mouse as /class/input/input0 Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx ide-floppy driver 0.99.newide usbcore: registered new driver hiddev usbcore: registered new driver usbhid drivers/usb/input/hid-core.c: v2.6:USB HID core driver PNP: No PS/2 controller found. Probing ports directly. i8042.c: No controller found. mice: PS/2 mouse device common for all mice md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27 md: bitmap version 4.39 TCP bic registered Initializing IPsec netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 Using IPI No-Shortcut mode XENBUS: Device with no driver: device/vbd/51712 XENBUS: Device with no driver: device/vif/0 Initalizing network drop monitor service Freeing unused kernel memory: 176k freed Write protecting the kernel read-only data: 390k USB Universal Host Controller Interface driver v3.0 megaraid cmm: 2.20.2.7 (Release Date: Sun Jul 16 00:01:03 EST 2006) SCSI subsystem initialized megaraid: 2.20.5.1 (Release Date: Thu Nov 16 15:32:35 EST 2006) device-mapper: uevent: version 1.0.3 device-mapper: ioctl: 4.11.5-ioctl (2007-12-12) initialised: dm-devel at redhat.com device-mapper: dm-raid45: initialized v0.2594l ##### using virt-viewer to view the console I see one more line: #### waiting for driver initialization... Grovellingly yours, with bruised forehead -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20091106/cbec98db/attachment-0005.html>
Christopher G. Stach II
2009-Nov-07 19:39 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
----- "Christopher Hunt" <dharmachris at gmail.com> wrote:> ramdisk = "/boot/initrd-2.6.18-164.6.1.el5xen.img"Does that have the xenblk module? Since you're using domain 0's initrd, my guess is that it does not, although it will have the block backend. You will probably need to make a new initrd for the guests. -- Christopher G. Stach II
On Nov 6, 2009, at 11:49 AM, Christopher Hunt wrote: [...]> [root at VMM03-XEN xen]# cat /etc/xen/guest02 > # Automatically generated xen config file > name = "guest02" > memory = "1024" > disk = [ 'phy:/dev/VMM01-KVMvg00/guest02,xvda,w', ] > vif = [ 'mac=00:16:3e:5c:f1:dd, bridge=xenbr0', ] > vfb = ["type=vnc,vncunused=1"] > #bootloader="/usr/bin/pygrub" > kernel = "/boot/vmlinuz-2.6.18-164.6.1.el5xen" > ramdisk = "/boot/initrd-2.6.18-164.6.1.el5xen.img" > vcpus=1 > on_reboot = 'restart' > on_crash = 'restart' > #root = "/dev/VMM01-KVMvg00/c5root00 ro" > #extra = "single selinux=0" > extra = "ro"[...]> [root at guest02 ~]# cat /etc/grub.conf > # grub.conf generated by anaconda > # > # Note that you do not have to rerun grub after making changes to > this file > # NOTICE: You have a /boot partition. This means that > # all kernel and initrd paths are relative to /boot/, eg. > # root (hd0,0) > # kernel /vmlinuz-version ro root=/dev/vg00/root divider=10 > notsc > # initrd /initrd-version.img > #boot=/dev/vda > default=0 > timeout=5 > splashimage=(hd0,0)/grub/splash.xpm.gz > hiddenmenu > title CentOS (2.6.18-164.el5) > root (hd0,0) > kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/vg00/root > divider=10 notsc > initrd /initrd-2.6.18-164.el5.imgCouple thoughts: /etc/grub.conf on the guest is actually irrelevant with the xen config you gave as you're not using pygrub, but are using a specified dom0 kernel/initrd (what pygrub does is use grub on the domU to use the domU's kernel/initrd). Now, this would be fine, but you'll likely run into issues with not having appropriate modules installed for that kernel; you might be able to boot without any modules (lots of errors certainly though) but it depends. My recommendation is usually to use pygrub along with installing the right domU kernel-xen. You might be able to do this, even if you do not have access to the KVM host any longer, by using "kpartx" to create a block device for the partition inside the lv, mounting it in the dom0, and then using some alternate install root for rpm/yum (not sure what the option is offhand). Lastly, to help with debugging: it's been a while since I had to dive into this, and I was using Gentoo at the time, but it use to be there was a difference between /dev/tty0 and /dev/console with Xen; you use to have to change your inittab to have the getty load on /dev/ console. Oh, actually, looking at my CentOS boxes now, it seems that kudzu rewrote /etc/inittab to start a getty on "xvc0" (see below). Anyhow, what I'm reasoning is that perhaps you're not seeing errors on "xm console" because you either need to pass/append "console=xvc0" on your kernel command line (xen config "extra" param I think) *or* update your getty line in /etc/inittab (again, by using kpartx if you don't have access to the old, running machine). Cheers, Eric --------- # Run gettys in standard runlevels co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav #1:2345:respawn:/sbin/mingetty tty1 #2:2345:respawn:/sbin/mingetty tty2 #3:2345:respawn:/sbin/mingetty tty3 #4:2345:respawn:/sbin/mingetty tty4 #5:2345:respawn:/sbin/mingetty tty5 #6:2345:respawn:/sbin/mingetty tty6
Pasi Kärkkäinen
2009-Nov-07 22:24 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
On Fri, Nov 06, 2009 at 11:49:41AM -0800, Christopher Hunt wrote:> First let me say that I'm not a sysadmin, but am simply wearing that hat > this week so please excuse my ignorance. I need to temporarily move some > virtual servers from a CentOS-KVM platform to a CentOS-XEN platform while > I do some upgrades to the CentOS box. I've created a local LV, and used > DD and SCP to transfer the block device from the VKM machine to the XEN > machine. For quite a while I struggled with the "Error: (2, 'Invalid > kernel', 'xc_dom_parse_elf_kernel: ELF image has no shstrtab\n')" error > but thanks to Nick Couchman from > [1]http://lists.xensource.com/archives/html/xen-users/2008-03/msg00603.html, > I've passed that. Now I'm stuck with a kernel panic situation. > Unfortunately the kernel panic error doesn't appear using "xm console" and > flashes so quickly through "virt-viewer" that I can't get any details. >Stop the guest and edit /etc/xen/<guest> cfgfile. Remove (or comment out) the vfb line, and then restart the guest. Now you get the full console output to "xm console". -- Pasi
Christopher G. Stach II
2009-Nov-09 19:09 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
----- "Christopher Hunt" <dharmachris at gmail.com> wrote:> This brings me back to suspecting the problem is in the different file > structures. I'm still trying to wrap my head around the other replies > in this thread.mkinitrd in dom0 with xenblk and xennet and use that new initrd for the guests. After you get the guests up and running, install kernel-xen in each one and switch to using pygrub. The following should handle the first part, but no warranties implied. :) mkinitrd --with=xenblk --with=xennet --preload=xenblk --preload=xennet /boot/initrd-2.6.18-164.6.1.el5xen-domU.img 2.6.18-164.6.1.el5xen for i in /etc/xen/guest[0-9]*; do cp ${i} ${i}.bak sed -i '/^ramdisk/cramdisk = "/boot/initrd-2.6.18-164.6.1.el5xen-domU.img"' ${i} done -- Christopher G. Stach II
Christopher G. Stach II
2009-Nov-09 19:32 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
----- "Christopher Hunt" <dharmachris at gmail.com> wrote:> Found volume group "vg00" using metadata type lvm2 ## this is the VG > on the KVM host> Volume group "virt01vg00" not found ## this is the VG on the XEN hostmkinitrd is getting this from your dom0's /etc/fstab. sed 's/virt01vg00/vg00/g' /etc/fstab > /tmp/fstab-domU mkinitrd -f --fstab=/tmp/fstab-domU --with=xenblk --with=xennet --preload=xenblk --preload=xennet /boot/initrd-2.6.18-164.6.1.el5xen-domU.img 2.6.18-164.6.1.el5xen Better luck this time. :) -- Christopher G. Stach II
Christopher G. Stach II
2009-Nov-09 20:15 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
----- "Christopher Hunt" <dharmachris at gmail.com> wrote:> I've updated accordingly, and now am getting a brand new file system > issue: > > > Waiting for driver initialization. > Scanning and configuring dmraid supported devices > 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 > Kernel panic - not syncing: Attempted to kill init!This could be a couple of things. Is it still displaying the message that it found vg00? If not, (1) it's mkinitrd being stupid and not creating the initrd init script correctly (ignoring LVM initialization when you supply an alternate fstab). If it is starting vg00 properly, it is probably (2) that your root device names are different in dom0 and the guest.' If you have situation 1, you can modify the initrd manually or do a lengthy process with kpartx, yum install kernel-xen, bind mount a bunch of filesystems from dom0, mkinitrd, undo everything, and proceed to the next guest. (It's scriptable, bit still a pain.) Modifying the initrd manually isn't that bad. It basically goes like this: 1. mkinitrd --with=xenblk --with=xennet --preload=xenblk --preload=xennet <img> <version> (yes, that's the original one without the fstab) 2. gunzip -c /boot/initrd-blah.img > /root/blah 3. mkdir /mnt/blah 4. mount -o loop /root/blah /mnt/blah 5. vi /mnt/blah/init <change occurrences of dom0 VG to guest VG> <change dom0 root device name to guest root device name> 6. umount /mnt/blah 7. gzip -c /root/blah > /boot/initrd-blah.img You can keep repeat 4-7 as necessary until it works or you lose it. :) If you don't have situation 1 but you have situation 2, just change the root device name in fstab-domU and rerun the mkinitrd command with the fstab argument. -- Christopher G. Stach II
Christopher G. Stach II
2009-Nov-09 20:54 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
----- "Christopher G. Stach II" <cgs at ldsys.net> wrote:> 1. mkinitrd --with=xenblk --with=xennet --preload=xenblk > --preload=xennet <img> <version> > (yes, that's the original one without the fstab) > 2. gunzip -c /boot/initrd-blah.img > /root/blah > 3. mkdir /mnt/blah > 4. mount -o loop /root/blah /mnt/blah > 5. vi /mnt/blah/init > <change occurrences of dom0 VG to guest VG> > <change dom0 root device name to guest root device name> > 6. umount /mnt/blah > 7. gzip -c /root/blah > /boot/initrd-blah.imgIf you followed these directions, you're probably scratching your head. I screwed up. The initrd is actually a cpio archive, so: 1. mkinitrd --with=xenblk --with=xennet --preload=xenblk --preload=xennet <img> <version> (yes, that's the original one without the fstab) 2. mkdir /root/initrd-blah 3. cd /root/initrd-blah 4. gunzip -c /boot/initrd-blah.img | cpio -idmv 5. vi /root/initrd-blah/init 6. find . -print | cpio -o | gzip -c > /boot/initrd-blah.img -- Christopher G. Stach II
Christopher G. Stach II
2009-Nov-10 00:13 UTC
[CentOS-virt] Migrating from KVM to XEN - kernel panic
----- "Christopher Hunt" <dharmachris at gmail.com> wrote:> ugh.... after doing inglorious battle, I return. It's definitely > situation (1). The error messages haven't changed. Inside the init > file, should the paths references be from the point of view of Dom0?This is the initrd, running in the context of the guest. dom0 doesn't matter at this point.> lvm vgchange -ay --ignorelockingfailure vg00 > resume /dev/vg00/swap00If swap00 is the name of the LV for the guest, those look correct.> mkrootdev -t ext3 -o defaults,ro /dev/mapper/vg00-rootIf "root" is the name of the LV for the guest, that looks okay, too.> Also, should the xen host config file (/etc/xen/guest02) root > parameter point to the dom0 root or the block device for the domU?The guest's. That is basically what would go on the kernel command line, say, in grub.conf. -- Christopher G. Stach II