Python script to deploy GNU/Linux cloud images (tested with Ubuntu), cloud-style, on Proxmox KVM. Based on Proxmox API Python (proxmoxer) and cloud-init. Hardware templating of KVM instances is possible by flavors configuration file (inspired by OpenStack flavors). Only local storage support, both directory and LVM Group. Cloud-init is linked to Qemu-KVM machines by [NoCloud datasource] (http://cloudinit.readthedocs.org/en/latest/topics/datasources.html#no-cloud).
$ git clone https://github.com/libersoft/proxmox-init.git proxmox-init
$ cd proxmox-init
$ pip install requirements.txt
You need also to install genisoimage
, needed to create the cloudinit seed datasource.
You have to copy proxmox settings from settings/settings.py.dist
to settings/settings.py
and edit it to reflect your current proxmox configuration.
You can add and modify your hardware flavors in flavors/
.
In this case you have also to update choices for --flavor
cmdline switch in the main script.
You have to copy instance configuration from settings/instance.py.dist
to settings/instance.py
and edit it to reflect your need.
Current format for configuration is quite rough and not very flexible.
The script assumes you have your ssh key in the authorized_keys of the proxmox node, for the user specified in the settings file.
usage: proxvm-deploy.py [-h] --vmid VMID --name NAME [--flavor {micro,small}]
[--storage {dir,lvm}]
Create a proxmox kvm and cloudinit it.
optional arguments:
-h, --help show this help message and exit
--vmid VMID, -v VMID Virtual machine id
--name NAME, -n NAME Virtual machine name/hostname
--flavor {micro,small}, -f {micro,small}
Virtual machine flavor
--storage {dir,lvm}, -s {dir,lvm}
Virtual machine storage backend
Rough working proof of concept.
- Puppet and chef section in cloudinit template.
- Ansible-pull launch on instance customization.
- Support to proxmox remote storage.
- Settings refactoring, especially network interfaces
- Extend cmdline arguments to choose base os image, proxmox node, proxmox host anb other.
- Code reorganization
- Proxmox KVM Ansible module ?