Automated CT and VM creation

  • Thread starter Thread starter librarian
  • Start date Start date
L

librarian

Guest
I use Proxmox 2.0

Code:
pve-manager: 2.0-18 (pve-manager/2.0/16283a5a)running kernel: 2.6.32-6-pve
proxmox-ve-2.6.32: 2.0-55
pve-kernel-2.6.32-6-pve: 2.6.32-55
lvm2: 2.02.88-2pve1
clvm: 2.02.88-2pve1
corosync-pve: 1.4.1-1
openais-pve: 1.1.4-1
libqb: 0.6.0-1
redhat-cluster-pve: 3.1.8-3
pve-cluster: 1.0-17
qemu-server: 2.0-13
pve-firmware: 1.0-14
libpve-common-perl: 1.0-11
libpve-access-control: 1.0-5
libpve-storage-perl: 2.0-9
vncterm: 1.0-2
vzctl: 3.0.29-3pve8
vzprocps: not correctly installed
vzquota: 3.0.12-3
pve-qemu-kvm: 1.0-1
ksm-control-daemon: 1.1-1
And I need build a build server, so I need to create a clean vms from templates automatically. Is there any way to do this from script? I know that there is some kind of API, but I could not find any methods or howtos how to work with it.
 
This is something I am also working on.

There is a utility named dab to build debian appliances.
I had to download the source and compile it for 2.0, on 1.9 I think you can install it using apt.
dab makes it easy to keep your build templates updated and is very easy to use once you read about it.

You can use the 2.0 API to create a new container once you have your template.
That is how we are planning to handle this in our setup.

vzctl utility can be used to do this at the command line.
http://pve.proxmox.com/wiki/Vzctl_manual Nice examples at the bottom of the page.