Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A cli-based deployment tool for Proxmox

License

NotificationsYou must be signed in to change notification settings

adrianmester/proxmox-deploy

 
 

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?

How it works

cloud-init depends on two things:

  1. A minimal base installation of the distribution, usually in the form of araw or qcow2 image. I call this acloud image.
  2. Thecloud-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-initcan 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-datafiles 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.

How to install

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

How to use

After installing, simply use:

$ proxmox-deploy --proxmox-host<hostname> --cloud-images-dir<images directory>

And answer the interactive questions.

Tested cloud images

I have testedproxmox-deploy with the followingcloud images:

DistributionVersionStatus
Ubuntu14.0415.1016.04The-amd64-disk1.img images work.
Fedora Server23Theqcow2 image works.
openSUSE13.2The-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

6

7

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.

Debian8Neither 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

10.1 cloud

10.1 vm

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.

Dependencies

  • 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 theuser-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-deploywill not ask for passwords to login, so a proper SSH agent and SSH key accessmust be configured before hand.

Changelog

0.4.0
  • Support for volumes on zfspool stores.
  • Allow specifying an empty VLAN id.
  • Allow specifying a different SSH port for connecting to Proxmox.
0.3
  • Support for volumes on nfs and lvm-thin data stores.
  • Always enable serial console on new VMs. This fixes deployingUbuntu 16.04 cloud images.
0.2
  • Support 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 FreeBSD mkisofs command.
0.1
  • Initial release

License

proxmox-deploy is licensed under the GPLv3 license.

About

A cli-based deployment tool for Proxmox

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python100.0%

[8]ページ先頭

©2009-2025 Movatter.jp