- Notifications
You must be signed in to change notification settings - Fork0
A cli-based deployment tool for Proxmox
License
adrianmester/proxmox-deploy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Use this tool to deploycloud-init
enabled images from various Linuxdistributions on Proxmox.
Proxmox does not supportcloud-init
enabled images out of the box. It'spossible to create template from manually installed VMs. However, with theavailability of ready to deploy images from most major Linux vendors, whyshould you install a VM manually?
cloud-init depends on two things:
- A minimal base installation of the distribution, usually in the form of araw or qcow2 image. I call this acloud image.
- The
cloud-init
package installed in the image.
cloud-init was originally made for Amazon EC2 and OpenStack. These platformshave native support for cloud-init, and provide a datasource thatcloud-init
can use to configure the VM. However, there are few alternative datasourcesavailable that will work, even if the platform itself has no native support forcloud-init
.
proxmox-deploy
uses theNoCloud datasource. For this approach, the VMmust have a copy of thecloud image as the first disk, and a read-only vfat oriso9660 filesystem as the second disk. On this second disk, there must be twofiles:user-data
andmeta-data
.
proxmox-deploy
takes care of generating theuser-data
andmeta-data
files based on user input.proxmox-deploy
also takes care of creating aProxmox VM and uploading thecloud image andcloud-init
image into theproper datastore. All that's left afterwards is turning on the VM.
All dependencies are installable using pip. To install globally, execute asroot:
# pip install proxmox-deploy
Or to install into a virtualenv (as a normal user):
$ virtualenv env$. env/bin/activate$ pip install proxmox-deploy
Make sure to activate your virtualenv before using or upgrading the tool later:
$. env/bin/activate
To later upgrade it:
$ pip install --upgrade proxmox-deploy
After installing, simply use:
$ proxmox-deploy --proxmox-host<hostname> --cloud-images-dir<images directory>
And answer the interactive questions.
I have testedproxmox-deploy
with the followingcloud images:
Distribution | Version | Status |
---|---|---|
Ubuntu | 14.0415.1016.04 | The-amd64-disk1.img images work. |
Fedora Server | 23 | Theqcow2 image works. |
openSUSE | 13.2 | The-OpenStack-Guest.x86_64.qcow2 image works,provided the VM has at least 512 MB RAM. Theminimal disk size is 10 GB. However, the firstNIC is calledeth1 , so make sure to selecteth1 to configure. There is nosuse user,login asroot. |
CentOS | The CentOS 6 image fails to boot, hanging at"Booting from hard disk". The CentOS 7-GenericCloud.qcow2.xz imageworks. The minimal disk size will be 8G. | |
Debian | 8 | Neither the qcow2 nor the raw image works. Thefirst boot results in a kernel panic andsubsequent boots won't runcloud-init ,rendering the VM unreachable. |
FreeBSD | Does not work,cloudbase-init-bsd has nosupport for the NoCloud datasource. The official VM images boot at least, butcloud-init is not available. It will boot withwith 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 aroot user.
- Proxmox VE 4.1 or later
- Python 2.7
- proxmoxer as Proxmox API client
- openssh-wrapper for communicating with the Proxmox API andexecuting commands.
- Jinja2 for generating the
user-data
andmeta-data
files. - configobj for reading configuration files.
- pytz for timezone names.
genisoimage
(Linux) ormkisofs
(FreeBSD) command.
Do note that we need to access the Proxmox server via SSH, to perform thevarious tasks. We also use the pvesh and pvesm commands over SSH tointerface with the Proxmox API and datastores respectively.proxmox-deploy
will not ask for passwords to login, so a proper SSH agent and SSH key accessmust be configured before hand.
0.4.0 |
|
0.3 |
|
0.2 |
|
0.1 |
|
proxmox-deploy
is licensed under the GPLv3 license.
About
A cli-based deployment tool for Proxmox
Resources
License
Stars
Watchers
Forks
Packages0
Languages
- Python100.0%