Tuesday 3 May 2016

KVM and multipathing

I was curious how to add multipathing to a KVM guest, turns out it is really very simple.

Create two (or more) virtual disks, then depending on whether you run virt-manager or the command line it is just a matter of specifying the same serial number.

virt-manager serial number


qemu-kvm
qemu-kvm ... -device ... -drive if=none,id=sda,file=disk1.img,serial=0001 ... -device -drive if=none,id=sdb,file=disk1.img,serial=0001 ...


Result for libvirt's xml code for KVM guest

 ...
  <devices>
   ...
   <disk type='block' device='disk'>
    ...
    <serial>0001</serial>
    ...
   </disk>
   <disk type='block' device='disk'>
    ...
    <serial>0001</serial>
    ...
   </disk>

Friday 29 April 2016

gdb and python

Wow no posts since 2015...

I have been messing around in gdb running some python scripts in the embedded python interpreter.

One very useful tip I found was enabling the full python stack trace enabling me to debug the scripts I was running.

To do this use
set python print-stack full