libvirtra

03 Jul 2011

This is a libvirt OCF Resource Agent written in python using my python OCF Resource Agent library.

It was written because I wanted to have the config for virtual domains stored in the cluster config rather than a shared disk or file server.

It doesn't support the full libvirt XML config yet, but adding new config parameters to match domain XML is fairly simple.

You can grab the code from launchpad, and Ubuntu users can just add the repository ppa:therealmik/ocfra.

Sample CRM config

crm configure primitive testvm ocf:libvirtra:libvirt \
  params memory="1048576" vcpu="2" disks="iscsi:vda?portal=192.168.0.10&target=iqn.2011-01.com.example:12345-testvm" \
  op start timeout="30s" \
  op stop timeout="300s" \
  op monitor interval="30s" timeout="10s" \
  op migrate_to timeout="300s" \
  op migrate_from timeout="300s" \
  meta allow-migrate="true"