hv — kvm virtualization swiss knife (requires kvm-admin)
Kvm is currently one of best choices for virtualization under GNU Linux operating systems. It is fast and stable. No wonder there are many frontend utilities that handles it.
RedHat Enterprise Linux and Ubuntu Server Linux are both suggesting to relay on libvirt, but whenever I try to use that I always finish with "It is not good enough yet", "new features come, old bugs still exist" etc. As I suppose — it will never be good enough. The reason is the libvirt layer which completly separates system administrator from kvm console.
In opposition to libvirt — we can use kvm and qemu tools, but sooner or later we will start to look after another toolkit to make life easier. I found mine — kvmtools — it is slick, lightweight, written in Python language and offers possibility to perform most tasks using single command. It is really great, but... I don't like kvm-admin command syntax. That is why I created hv — simple bash script that makes kvm-admin more friendly — especially — for (former) virsh users.
hv util is available here.You can download it using the following command:
hg clone http://nme.pl/pub/repos/hv
hv
Usage:
hv (list|running) hv (boot|bootp|reboot|kill) domain-name (bootp = boot domain-name, but keep it in paused state) hv (vnc|vncinfo) domain-name hv serial domain-name hv monitor domain-name qemu-monitor-command hv (pause|cont|status) domain-name hv edit domain-name hv snapshots domain-name hv (savevm|loadvm|delvm|bootvm) domain-name snapshot-name hv shutdown domain-name hv verify hv example-domain
Commands might be shortened, eg. hv li
What does hv offer?
List of all commands with examples, like mentioned in hv usage above — it is possible to shorten commands, as long as they are unambiguous. hv offers as much syntatic sweetness as I could figure out 
More verbose help:
hv list | list all available virtual machines. |
hv running | list running virtual machines. |
hv boot domain-name | start given virtual machine. |
hv bootp domain-name | start given virtual machine in a paused state. |
hv reboot domain-name | warm reboot virtual machine. |
hv kill domain-name | power off virtual machine. |
hv vnc domain-name | connect vncviewer with virtual machine (and keep it turning on when it disconnects — in case of resolution change etc, ^C breakable). |
hv vncinfo domain-name | return vnc listen ip:port. |
hv serial domain-name | connect to serial tty of virtual machine. |
hv monitor domain-name qemu-monitor-command | kvm monitor interface — if no monitor-command is given, issuing help command will be suggested. |
hv pause domain-name | freeze virtual machine. |
hv cont domain-name | continue feezed virtual machine. |
hv status domain-name | virtual machine status. |
hv edit domain-name | same as vim /etc/kvm/domain/name. |
hv snapshots domain-name | list current virtual-machine snapshots. |
hv savevm domain-name snapshot-name | create snapshot for virtual-machine |
hv loadvm domain-name snapshot-name | apply (load) snapshot for virtual-machine |
hv delvm domain-name snapshot-name | delete snapshot |
hv bootvm domain-name snapshot-name | boot domain and apply (load) snapshot |
hv shutdown domain-name | gracefully shutdown virtual machine (requires acpid / acpi support on virtual-machine). |
hv verify | simplifies manual check of all virtual machines configuration — disks, mac addresses, tap interfaces and vnc ports. |
hv example-domain | bootstrap configuration of virtual machine, eg. hv example >/etc/kvm/domain/new-vm |
Feedback?
As usual — every opinion and suggestion is appreciated!






