Package: proxmox-deploy
Use this tool to deploycloud-initenabled images from various Linux
distributions on Proxmox.Proxmox does not supportcloud-initenabled images out of the box. It’s
possible to create template from manually installed VMs. However, with the
availability of ready to deploy images from most major Linux vendors, why
should you install a VM manually?How it workscloud-init depends on two things:A minimal base installation of the distribution, usually in the form of a
raw or qcow2 image. I call this acloud image.Thecloud-initpackage installed in the image.cloud-init was originally made for Amazon EC2 and OpenStack. These platforms
have native support for cloud-init, and provide a datasource thatcloud-initcan use to configure the VM. However, there are few alternative datasources
available that will work, even if the platform itself has no native support forcloud-init.proxmox-deployuses theNoClouddatasource. For this approach, the VM
must have a copy of thecloud imageas the first disk, and a read-only vfat or
iso9660 filesystem as the second disk. On this second disk, there must be two
files:user-dataandmeta-data.proxmox-deploytakes care of generating theuser-dataandmeta-datafiles based on user input.proxmox-deployalso takes care of creating a
Proxmox VM and uploading thecloud imageandcloud-initimage into the
proper datastore. All that’s left afterwards is turning on the VM.How to installAll dependencies are installable using pip. To install globally, execute as
root:# pip install proxmox-deployOr to install into a virtualenv (as a normal user):$virtualenvenv$.env/bin/activate$pipinstallproxmox-deployMake sure to activate your virtualenv before using or upgrading the tool later:$.env/bin/activateTo later upgrade it:$pipinstall--upgradeproxmox-deployHow to useAfter installing, simply use:$proxmox-deploy--proxmox-host<hostname>--cloud-images-dir<imagesdirectory>And answer the interactive questions.Tested cloud imagesI have testedproxmox-deploywith the followingcloud images:DistributionVersionStatusUbuntu14.0415.1016.04The-amd64-disk1.imgimages work.Fedora Server23Theqcow2image works.openSUSE13.2The-OpenStack-Guest.x86_64.qcow2image works,
provided the VM has at least 512 MB RAM. The
minimal disk size is 10 GB. However, the first
NIC is calledeth1, so make sure to selecteth1to configure. There is nosuseuser,
login asroot.CentOS67The CentOS 6 image fails to boot, hanging at
“Booting from hard disk”.The CentOS 7-GenericCloud.qcow2.xzimage
works. The minimal disk size will be 8G.Debian8Neither the qcow2 nor the raw image works. The
first boot results in a kernel panic and
subsequent boots won’t runcloud-init,
rendering the VM unreachable.FreeBSD10.1 cloud10.1 vmDoes not work,cloudbase-init-bsdhas no
support for the NoCloud datasource.The official VM images boot at least, but
cloud-init is not available. It will boot with
with DHCP and a default user/password.All distributions provide a default user with the name of the distro (ubuntu,fedora,centos,debian,freebsd), except openSUSE which only has arootuser.DependenciesProxmox VE 4.1 or laterPython 2.7proxmoxeras Proxmox API clientopenssh-wrapperfor communicating with the Proxmox API and
executing commands.Jinja2for generating theuser-dataandmeta-datafiles.configobjfor reading configuration files.pytzfor timezone names.genisoimage(Linux) ormkisofs(FreeBSD) command.Do note that we need to access the Proxmox server via SSH, to perform the
various tasks. We also use thepveshandpvesmcommands over SSH to
interface with the Proxmox API and datastores respectively.proxmox-deploywill not ask for passwords to login, so a proper SSH agent and SSH key access
must be configured before hand.Changelog0.4.0Support for volumes on zfspool stores.Allow specifying an empty VLAN id.Allow specifying a different SSH port for connecting to Proxmox.0.3Support for volumes on nfs and lvm-thin data stores.Always enable serial console on new VMs. This fixes deploying
Ubuntu 16.04 cloud images.0.2Support for cloud-init Chef handoff (no autorun yet).Improve EnumQuestion output by listing and sorting options.Add option for automatically starting VMs after deployment.Choose defaults for node and storage selection.Support FreeBSDmkisofscommand.0.1Initial releaseLicenseproxmox-deployis licensed under the GPLv3 license.