A simple python-based utility for handling KVM machines on Proxmox 2.x systems. Since I did this at work, I could not spend much time on documenting it. However, as soon as I find time for it, I'll add some more lines of documentation here.
Feel free to fork and improve this project!
aptitude install python-setuptools
git clone git://github.com/remofritzsche/proxmox-utils.git
cd proxmox-utils python setup.py build sudo python setup.py install
./kvm-clone <from-id> <to-id> This clones a KVM machine (NOTE: not a template) from one id to the other. If the source machine is currently running, the script will automatically suspend it and resume it again after the machine has been copied. To the end of the script, it gives you the possibility to edit the configuration file for the target machine. In any case, this has to be done in order to adapt the image paths contained in the configuration files. ./kvm-remove <machine-id> This fully removes a KVM machine and it's configuration. You can also delete such a machine directly via the Proxmox Web Interface, however a few files will be left out by Proxmox. ./kvm-create-template <machine-id> <template-name> Creates a new template from an installed KVM machine with <machine-id>. Make sure to edit the generated template configuration file (especially name, comment and image file location). ./kvm-list-templates Lists the available template names. ./kvm-activate-template <template-name> <to-id> This copies over an existing template to a machine of a certain ID.