1

I'm running a installation of XenServer 6.2 where I've imported a .ova. The .ova is an image of a linux-system from a previous vmware esxi environment.

The problem is that since the linux-image doesn't support all disk controllers, I would like to change the driver inside XenServer for the vmdk disk.

I've had the same problem when running the exact same image on a qemu-kvm system. I solved it by just changing the disk controller in virt-manager (or in the vm.xml) for the virtual machine. But I can't seem to find this option in XenServer.

Any tips?

Mxx
  • 2,312
  • 2
  • 26
  • 40
norrland
  • 103
  • 9

2 Answers2

1

I'm not sure I understood your question. If I did, you managed to successfully import a Linux-based VM. However, your VM won't boot because its kernel cannot recognise the disk controller exposed by XenServer. And you would like to have access to your VM's disk so that you can tweak the drivers loaded.

Because Linux guests are (by default) paravirtualised, your guest's kernel should have realised it is being virtualised by Xen and loaded a kernel driver called blkfront. This driver will pick up on any disks exposed by the backend (for that VM) and present as /dev/xvd_ in your guest.

Nevertheless, you can see that VDI from dom0. Using the command-line interface, you can find out where the disks for your VMs are and (possibly) access them.

The following command should give you the UUID of your VM (named VMNAME):

vm_uuid=$(xe vm-list name-label=VMNAME --minimal)
echo $vm_uuid

Next, you can find out any Virtual Disk Images (VDIs) associated with your VM like this:

xe vbd-list type=Disk params=vdi-uuid vm-uuid=$vm_uuid

You can access these VDIs from dom0 using the with_vdi helper script. Considering you want to access VDI with UUID 06612a19-d9ba-49f8-9f75-6c9d5a9aaef6, you can run:

# /opt/xensource/debug/with-vdi 06612a19-d9ba-49f8-9f75-6c9d5a9aaef6
DEVICE=sm/backend/c86e75df-eff8-d139-0c0f-7924465f9bfa/06612a19-d9ba-49f8-9f75-6c9d5a9aaef6

You will now be in a shell and /dev/$DEVICE will be a block device representation of that VDI. You can, for example, look at that VDI's partition table with:

fdisk -l /dev/$DEVICE

And, from there, mount the filesystem locally and "play" with it. Remember to type exit when you are done to quit this shell and release the VDI.

Cheers

Felipe

  • I will try to build a kernel with the blkfront module. Seems like the easiest way instead of digging through the Xen cli every time. – norrland Aug 04 '13 at 08:07
  • 1
    Finally, progress. Added a bunch of blkfront and enabled userspace allocation. In Slackware atleast it works. – norrland Sep 24 '13 at 12:16
0

If I remember correctly, this instance didn't support Xen disk devices at the time. An upgrade of the kernel to include such modules solved the problem.

norrland
  • 103
  • 9