Kernel Panic When Adding Partitioned Virtio Disk

Home » CentOS » Kernel Panic When Adding Partitioned Virtio Disk
CentOS 2 Comments

I have a cloned kvm (that I can now get started following a shutdown and reboot of the hypervisor host). When it starts with its original virtio disk there is no problem. If I create a virtio disk and add it via virt-manager it also boots without issue, although one cannot see the new ‘physical’ disk. If I shutodwon the kvm guest, partition the new virtio disk, and reboot the guest then I see this:

Kernel panic – not syncing: Attempted to kill init!
Pid: 1, comm: init Not tainted 2.6.32-504.12.2.el6.x86_64 #1

Call Trace:
[ffffffff8152933c] ? panic+0xa7/0x16f
[ffffffff8107a5f2] ? do_exit+0x862/0x870
[ffffffff8118fa25] ? fput+0x25/0x30
[ffffffff8107a658] ? do_group-exit+0x58/0xd0
[ffffffff8107a6e7] ? sys_exit_group+0x17/0x20
[ffffffff8100b072] ? system_call_fastpath+0x16/0x1b

Does anyone have any idea what partitioning does to cause this behaviour? I have deleted and recreated the virtio disk several times with differing sizes and it always comes down to whether or not the disk is partitioned.

I have added virtio disks to other kvm guests in the same fashion many times and have never run into this.

2 thoughts on - Kernel Panic When Adding Partitioned Virtio Disk

  • Hi, James,

    James B. Byrne wrote:

    Now, admittedly, a) I really haven’t been following this thread, and b)
    haven’t worked a lot with VMs, and not with KVM, but could you clarify something for me? Are you trying to make the virtual root disk larger, or are you creating a new one, and just adding it the the VM, like mounting another drive on an existing system? If the latter, can’t you mount it?

    Oh, and is the new virtual drive formatted?

    mark

  • I discovered my error and have corrected it. I am just providing this information in case someone else does something similar.

    The situation is this. I have a KVM guest that I keep as a clone template. It has one virtio disk of 32GB that is configured as an LVM
    partition with several lvs.

    I cloned this system to create an off-site backup host for our fax server. The archives of which exceeds 32GB by some margin. My requirement therefore was to create the necessary additional storage
    (2 x 32Gb virtio disks) and attach them to the cloned system. Initially this worked as it has in the past. However, I ran into a problem on the new guest when adding a new lv using the space from the new virtual disks that I had added to the volume group defined on the guest. And this is where I made my mistake.

    Instead of removing the lv first and then removing the virtio disks from the vg I deleted the disks from the guest.

    This meant that the guest LVM manager was looking for those drives whenever it was rebooted. If the drives that I added back in subsequent trials were not partitioned then they were not found by the lvm manager and the system booted. If the re-added disks were partitioned then the lvm manager found them, but they were not the disks expected. That probably tripped some sort of security or consistency check and that caused the kernel panic.

    The fix was to boot the system without the added disks. Then login and run the lvm utilities to remove the dangling lv, also remove the missing pvs from the vg, and then shutdown. Once this was done adding new partitioned virtio disks to the guest proceeded as expected and the problem disappeared from the next boot.