Proxmox-init

Python script to deploy GNU/Linux cloud images, cloud-style, on Proxmox KVM. Based on Proxmox API Python (proxmoxer) and cloud-init.


Project maintained by libersoft Hosted on GitHub Pages — Theme by mattgraham

proxmox-init

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.

Installation

$ 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.

Configuration

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

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

Status

Rough working proof of concept.

Possible Improvements

Random Ideas and maybe

License

Gnu General Public License 3.0

Credits