Vagrant Vmpooler Provider
vagrant-vmpooler is still a work in progress and a lot of things might not work at the moment. If you find a bug, feel free to open up an issue on this repository.
- Quickly provision virtual machines with vmpooler and vagrant
- SSH into machines
- Provision the instances with any built-in Vagrant provisioner
- Sync folders with Rsync
- Built off of the vmfloaty library, using the vmpooler api
To quickly get started, install the vagrant plugin with the command below. Then you'll want to add a dummy box from the example_box directory...finally create a Vagrantfile and run the up command with the
$ vagrant plugin install vagrant-vmpooler ... $ vagrant box add dummy https://github.com/briancain/vagrant-vmpooler/raw/master/example_box/dummy.box ... $ vagrant up --provider=vmpooler ...
A few examples to get you started
# -*- mode: ruby -*- # vi: set ft=ruby : # Provisioning script provision_script = <<SCRIPT #!/bin/bash echo "Hello there" > ~/hi.txt SCRIPT Vagrant.configure("2") do |config| config.vm.box = "dummy" config.vm.provision :shell, :inline => provision_script config.vm.provider :vmpooler do |vmpooler| vmpooler.url = "https://vmpooler.com/api/v1" vmpooler.os = "centos-7-x86_64" vmpooler.ttl = 24 vmpooler.password = "secretpassword" end end
Similar to vmfloaty, a few of these settings can be defined in the
vmfloaty dotfile located in your home directory. However, they can be overridden in a Vagrantfile if needed. The configuration values that can be set in that dotfile below are explicitly called out.
- vmfloaty dotfile config setting
- The url to your vmpooler installation
- The type of operatingsystem to get from the pooler
- The password to use to log into the vmpooler machine
- Whether or not to run vmfloaty api calls in verbose mode
- defaults to
- vmfloaty dotfile config setting
- The token used to obtain vms
- How long the vm should additionally stay active for (default is 12 with token)
- Increases default disk space by this size
These can be set like any other vagrant provider:
Vagrant.configure("2") do |config| # ... other stuff config.vm.provider :vmpooler do |vmpooler| vmpooler.password = "foo" vmpooler.os = "ubuntu-1604-x86_64" vmpooler.ttl = 48 end end
At the moment, vagrant-vmpooler only supports rsync for syncing folders. It requires both the host machine and remote machine to have rsync installed. Right now there's a basic setup step that will install rsync on the remote host before syncing folders since several vmpooler machines do not have it installed by default.
Both of the commands are not supported in this plugin since vmpooler gives no api support for halting or suspending vms. Running these commands will result in a warning from vagrant-vmpooler.
vagrant-vmpooler assumes that it will be logging in as root or Administrator (windows) to any vmpooler vm.
To work on the
vagrant-vmpooler plugin, clone this repository out, and use
Bundler to get the dependencies:
Once you have the dependencies, verify the unit tests pass with
$ bundle exec rake
If those pass, you're ready to start developing the plugin. You can test
the plugin without installing it into your Vagrant environment by just
Vagrantfile in the top level of this directory (it is gitignored)
and add the following line to your
Use bundler to execute Vagrant:
$ bundle exec vagrant up --provider=vmpooler