KVM Management - Libvirt

Hi all.

I’ve been playing around with KVM for a bit now and have several virtual machines up and running.  Having passed what I considered “first look” stage, I’m ready to start using libvirt as a manager.  For reference, pre-libvirt, I have started this VM with:

kvm -net nic,model=virtio -net tap,ifname=tap5,script=no  -drive file=test1.img,if=virtio,boot=on -curses -no-reboot -m 1g -smp 2

I have a test environment I like to play with, and created the initial domain XML using virt-install:

virt-install –name “Test” –ram 1024 –vcpus=2  –cpu host –description “Test VM” –import –file test1.img –os-type=linux –os-variant=virtio26  –network bridge=br0,model=virtio –graphics=none –autostart –prompt

When I look in /var/log/libvirt/qemu/Test.log  I see the VM is started with the command (edited down to the relevant parts):

/usr/bin/qemu-kvm -S -m 1024 -smp 2 -name Test,process=qemu:Test -nographics -boot c -drive file=/kvms/test1.img,if=none,boot=on

This has two problems:

1) The “-S” is keeping the system from booting
2)  the “if=none” needs to be “if=virtio”

I’ve confirmed both by changing -nographics to -curses and watching what happens.  For #1, its a big fat nothing (no surprise since -S turns off the CPUs), for #2 grub loads and the kernel boots, but my /dev/vda3 isn’t found so “init” can’t start.

I’m anticipating a 3rd problem:  I don’t see where to specify that I want the VM to use “tap5″ of my bridged network.

I have to imagine these things can be corrected by editing the Libvirt XML file for the domain Test.  I’m asking the Libvirt mailing list https://www.redhat.com/mailman/listinfo/libvirt-users for help with this one!

Share