vagrant-haipa
is a Vagrant provider plugin that supports the management of Hyper-V virtual machines with Haipa.
Features include:
- Create and destroy Haipa Machines
- Power on and off Haipa Machines
Install the provider plugin using the Vagrant command-line interface:
vagrant plugin install vagrant-haipa
Once the provider has been installed, you will need to configure your project to use it. See the following example for a basic Vagrantfile
implementation:
config.vm.define :ubuntu do |ubuntu|
ubuntu.vm.provider :haipa do |provider|
provider.vm_config = {
'Memory' => {
'Startup' => 2048
},
'Disks' => [
{
"Template" => 'c:\hyperv-templates\ubuntu-xenial.vhdx',
"Size" => 20
}
],
'NetworkAdapters' => [
{
"Name" => "eth0",
"SwitchName" => "Default Switch",
}
]
}
end
end
end
Supported Configuration Attributes
The following attributes are available to further configure the provider:
provider.vm_config
- A Hash with the Haipa vm configuration
provider.provision
- A Hash with the Haipa provision configuration
After creating your project's Vagrantfile
with the required configuration
attributes described above, you may create a new Machine with the following
command:
$ vagrant up --provider=haipa
This command will create a new machine, setup your SSH key for authentication, create a new user account, and run the provisioners you have configured.
Supported Commands
The provider supports the following Vagrant sub-commands:
vagrant destroy
- Destroys the machine instance.vagrant ssh
- Logs into the machine instance using the configured user account.vagrant halt
- Powers off the machine instance.vagrant provision
- Runs the configured provisioners and rsyncs any specifiedconfig.vm.synced_folder
.vagrant status
- Outputs the status (active, off, not created) for the machine instance.
Before submitting a GitHub issue, please ensure both Vagrant and vagrant-haipa are fully up-to-date.
- For the latest Vagrant version, please visit the Vagrant website
- To update Vagrant plugins, run the following command:
vagrant plugin update
To contribute, fork then clone the repository, and then the following:
Developing
- Install Bundler
- Currently the Bundler version is locked to 1.7.9, please install this version.
sudo gem install bundler -v '1.7.9'
- Then install vagrant-haipa dependencies:
bundle _1.7.9_ install
- Do your development and run a few commands, one to get started would be:
bundle _1.7.9_ exec vagrant haipa-list images
- You can then run a test:
bundle _1.7.9_ exec rake test
- Once you are satisfied with your changes, please submit a pull request.
Testing
- Build and package your newly developed code:
rake gem:build
- Then install the packaged plugin:
vagrant plugin install pkg/vagrant-haipa-*.gem
- Once you're done testing, roll-back to the latest released version:
vagrant plugin uninstall vagrant-haipa
vagrant plugin install vagrant-haipa
- Once you're satisfied developing and testing your new code, please submit a pull request for review.