I'm using libvirt with KVM/QEMU. I found a great PPA, uvtool (http://s3hh.wordpress.com/2013/12/12/quickly-run-ubuntu-cloud-images-locally-using-uvtool/), that manages images and metadata in a volume storage pool. I can quickly create new VM guests from the command line. This makes it easy to work with shell scripts to create/destroy using uvt-kvm (uvtool's wrapper) and start/stop using virsh (from libvirt package).
For some reason, guests have only one cpu/core and I need to set the number from the command line. I found references to virsh's setvcpu option, but no examples of how to use it. Here's what I tried with the error messages:
Start existing guest with 2 CPU's:
tahoar@pttools0:~$ virsh start test-host setvcpus --count 2 error: command 'start' doesn't support option --count
Start existing guest with defaults:
tahoar@pttools0:~$ virsh start test-host Domain test-host started
Set CPU's on running guest:
tahoar@pttools0:~$ virsh setvcpus test-host --count 2 error: invalid argument: requested vcpus is greater than max allowable vcpus for the domain: 2 > 1
Thanks for any help.