Learning Puppet CentOS VM in KVM/libvirt

I am trying out Puppet for config file management with this guide and they provided a CentOS 5 VM with Puppet Enterprise preloaded. They provide the VM file in either VMX or OVF. I chose OVF to use on Fedora 18 with libvirt/KVM. It took me a while to get it to boot properly. Originally I tried using virt-manager to create the VM booting the vmdk file directly, but no matter what I changed the storage driver to (IDE, SATA,virtio) it kernel panicked while trying to activate the root VG. Here is what I did to get it to work:

[jbrier@jb-t520 learn_puppet_centos_pe2.7.0_ovf.2013.01.07]$ virt-convert learn_puppet_centos_pe2.7.0_ovf.2013.01.07.ovf 
Generating output in 'virt-image' format to Learning-Puppet-VM--(PE-2.7.0)/
Converting disk 'learn_puppet_centos_pe2.7.0_ovf.2013.01.07-disk1.vmdk' to type raw...
[jbrier@jb-t520 learn_puppet_centos_pe2.7.0_ovf.2013.01.07]$ ls -lt
total 615692
drwxrwxr-x. 2 jbrier jbrier      4096 Mar 13 11:29 Learning-Puppet-VM--(PE-2.7.0)
-rw-r--r--. 1 root   root   630446080 Jan  7 17:35 learn_puppet_centos_pe2.7.0_ovf.2013.01.07-disk1.vmdk
-rw-r--r--. 1 jbrier jbrier       197 Jan  7 17:35 learn_puppet_centos_pe2.7.0_ovf.2013.01.07.mf
-rw-r--r--. 1 jbrier jbrier      5283 Jan  7 17:35 learn_puppet_centos_pe2.7.0_ovf.2013.01.07.ovf
[jbrier@jb-t520 learn_puppet_centos_pe2.7.0_ovf.2013.01.07]$ cd Learning-Puppet-VM--\(PE-2.7.0\)/
[jbrier@jb-t520 Learning-Puppet-VM--(PE-2.7.0)]$ ls
Learning-Puppet-VM--(PE-2.7.0).virt-image.xml  learn_puppet_centos_pe2.7.0_ovf.2013.01.07-disk1.raw

I tried to use virsh define on the generated XML, but it was incomplete:

[jbrier@jb-t520 Learning-Puppet-VM--(PE-2.7.0)]$ virsh define Learning-Puppet-VM--\(PE-2.7.0\).virt-image.xml 
error: Failed to define domain from Learning-Puppet-VM--(PE-2.7.0).virt-image.xml
error: XML error: unexpected root element , expecting 

I ended up using virt-manager to create a new VM and specifying the generated raw file (8 GB or so) and specifying RHEL 5.4 or later as the OS. I did have to switch the storage driver:

View > Details > VirtioIO Disk 1 > Advanced > Disk Bus > IDE


Super site

Super article, génial !