-
Notifications
You must be signed in to change notification settings - Fork 29
Vagrant and vSphere plugin for @scale deployment
"Vagrant - the command line utility for managing the life-cycle of virtual machines." vagrant-vsphere - VMware vSphere provider for Vagrant, allowing Vagrant to control and provision machines using VMware vSphere. First, we can use vagrant to deployment InfraSIM @scale test environment on vCenter, VMs resources allocation will follow vSphere DRS (Distributed Resource Scheduler). We can execute vagrant up, halt, reload, provision, destroy and ssh...command on VMs in parallel.
Here we select a VM with Ubuntu 16.04 installed as Vagrant host server.
- Vagrant installation:
$ sudo apt-get install ruby-full
$ sudo apt install ruby-bundler
$ git clone https://github.com/mitchellh/vagrant.git
$ cd vagrant
$ bundle install
- OR we can install the latest version vagrant from https://www.vagrantup.com/downloads.html
$ wget https://releases.hashicorp.com/vagrant/1.9.2/vagrant_1.9.2_x86_64.deb
$ sudo apt install ~/vagrant_1.9.2_x86_64.deb
After the installation execute "vagrant -v" to make sure Vagrant version as your expectation.
- Install vagrant-vsphere plugin:
$ vagrant plugin install vagrant-vsphere
Which is hosted via Atlas in "InfraSIM/infrasim-compute" organization, we can define it in Vagrantfile. https://atlas.hashicorp.com/InfraSIM/boxes/infrasim-compute
Please prepare this file base on your exact test vCenter environment, an example is uploaded to GitHub InfraSIM/tools/@scale repo for reference. https://github.com/InfraSIM/tools
Make sure the "template inventory location" and "template name" is the same as in Vagrantfile
$ vim-cmd solo/registervm /vmfs/volumes/datastore_name/VM_directory/VM_name.vm
This "spec" will be used one you need to set static IP for "private network". One key point, the NIC numbers in "spec" should match the NIC numbers in vm template.
$ vagrant up --provider=vsphere
$ vagrant ssh vagrant-1
$ vagrant destroy
After all InfraSIM virtual nodes powered up, you can refer to Ansible playbook in InfraSIM/tools repo for further operation on InfraSIMs.
https://github.com/InfraSIM/tools/pull/40
If add "--debug" parameter we can save output to a file "vagrant.log".
$ vagrant up --debug &> vagrant.log
https://www.vagrantup.com/docs/
https://github.com/mitchellh/vagrant
https://github.com/nsidc/vagrant-vsphere
Create a Customization Specification for Linux in vSphere Client.