Giter Site home page Giter Site logo

vagrant-proxmox's Introduction

Vagrant Proxmox Provider

This is a Vagrant plugin that adds a Proxmox provider to Vagrant, allowing Vagrant to manage and provision Proxmox virtual machines.

Features

  • Create/Destroy OpenVZ containers from specified templates
  • Start/Shutdown OpenVZ containers
  • SSH into virtual machine
  • Provision the virtual machine
  • Synced folder support via rsync

Limitations

  • For OpenVZ containers you need a Vagrant compatible OpenVZ template
  • For OpenVZ containers only routed network mode is currently supported
  • For KVM machines the ISO file needs to be a Vagrant compatible live system or automatic installation

Requirements

  • Vagrant 1.5+
  • Ruby 2+

Installation

Install using standard Vagrant plugin method:

$ vagrant plugin install vagrant-proxmox

This will install the plugin from RubGems.org.

Usage

First install the provided dummy vagrant box:

$ vagrant box add dummy dummy_box/dummy.box

Then for an openvz container create a Vagrantfile that looks like the following (note that you might have to add "@pam" to your username if you're getting a "401 Unauthorized" error):

Vagrant.configure('2') do |config|

	config.vm.provider :proxmox do |proxmox|
		proxmox.endpoint = 'https://your.proxmox.server:8006/api2/json'
		proxmox.user_name = 'proxmox_username@pam'
		proxmox.password = 'proxmox_password'
		proxmox.vm_id_range = 900..910
		proxmox.vm_name_prefix = 'vagrant_'
		proxmox.openvz_os_template = 'local:vztmpl/vagrant-proxmox-ubuntu-12.tar.gz'
		proxmox.vm_type = :openvz
		proxmox.vm_memory = 256
	end

	config.vm.define :box, primary: true do |box|
 		box.vm.box = 'dummy'
 		box.vm.network :public_network, ip: '192.168.0.1'
 	end

end

If you want KVM the Vagrantfile could look as follows:

Vagrant.configure('2') do |config|

	config.vm.provider :proxmox do |proxmox|
		proxmox.endpoint = 'https://proxmox.example.com/api2/json'
		proxmox.user_name = 'vagrant'
		proxmox.password = 'password'
		proxmox.vm_id_range = 900..910
        proxmox.vm_type = :qemu
		proxmox.vm_name_prefix = 'vagrant_'
        proxmox.qemu_os = :l26
        proxmox.qemu_disk_size = '30G'
        proxmox.qemu_storage = 'local'
        proxmox.qemu_iso_file = '/home/user/system.iso'
        proxmox.vm_id_range = 900..910
        proxmox.vm_name_prefix = 'vagrant_test_'
        proxmox.vm_memory = 512
	end

	config.vm.define :box, primary: true do |box|
 		box.vm.box = 'dummy'
 		box.vm.network :public_network, ip: '192.168.0.1', macaddress: 'ff:aa:cc:dd:bb:ee'
 	end

end

For the meaning of the various options, refer to the Options section below.

You need an OpenVZ template or KVM ISO that contains a vagrant user supplied with the default Vagrant SSH keys. You can download an example Ubuntu based template here.

Finally run vagrant up --provider=proxmox to create and start the new OpenVZ container.

Options

  • endpoint URL of the JSON API endpoint of your Proxmox installation
  • user_name The name of the Proxmox user that Vagrant should use
  • password The password of the above user
  • vm_id_range The possible range of machine ids. The smallest free one is chosen for a new machine
  • vm_name_prefix An optional string that is prepended before the vm name
  • vm_type The virtual machine type, e.g. :openvz or :qemu
  • openvz_os_template The name of the template from which the OpenVZ container should be created
  • openvz_template_file The openvz os template file to upload and use for the virtual machine (can be specified instead of openvz_os_template)
  • vm_memory The container's main memory size
  • task_timeout How long to wait for completion of a Proxmox API command (in seconds)
  • task_status_check_interval Interval in seconds between checking for completion of a Proxmox API command
  • ssh_timeout The maximum timeout for a ssh connection to a virtual machine (in seconds)
  • ssh_status_check_interval The interval between two ssh reachability status retrievals (in seconds)
  • imgcopy_timeout The maximum timeout for a proxmox server task in case it's an upload (in seconds)
  • qemu_os The qemu virtual machine operating system, e.g. :l26
  • qemu_iso The qemu iso file to use for the virtual machine
  • qemu_iso_file The qemu iso file to upload and use for the virtual machine (can be specified instead of qemu_iso)
  • qemu_disk_size The qemu disk size to use for the virtual machine, e.g. '30G'
  • qemu_storage Storage name to use for virtual machine (Default 'local')
  • selected_node If specified, only this specific node is used to create machines

Build the plugin

Build the plugin gem with

$ rake build

Optionally run the rspec tests with

$ rake spec

About us

TELCAT MULTICOM GmbH is a Germany-wide system house for innovative solutions and services in the areas of information, communication and security technology.

We develop IP-based telecommunication systems (TELCAT-UC) and use Vagrant and Proxmox to automatically deploy and test the builds in our Jenkins jobs.

vagrant-proxmox's People

Contributors

sebrem avatar z1nkum avatar lausser avatar nkkollaw avatar

Watchers

James Cloos avatar Starbuck avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.