Using Vagrant With Vsphere

Creating a vCSA 5.5 .box template on CentOS 6.5 for vagrant deployment

In the last few blogs post we have created ESXi .box templates, but in order to create a complete virtual lab using vagrant we will also need a vCenter Server Appliance virtual machine. The vCSA comes as a .ova template, so we will need to convert it to a vagrant-vmware-ovf .box template before we can use it with vagrant. In this post we will need several packages installed, that we have covered in the last few posts:

Installing vagrant and the vagrant-vcenter provider on CentOS 6.5

If you followed the steps in one of the two previous posts, you have a ESXi .box template in the vagrant-vmware-ovf format. This format allows for deploying the exact same template to vCenter, vCloud Director or vCloud Air, by simply specifying a different provider in vagrant. This post will cover deploying to vCenter, since that is the most readily available of the three. In this post we will again talk about the following helpful gosddc project:

Creating a Puppet manifest and integrating it with Vagrant

This post will cover configuring Vagrant to automatically run a Puppet manifest on the vm created by “vagrant up.” This capability allows you to test your Puppet manifests, make changes and test again, all quickly and easily. Let’s get started: 1. Create the Puppet manifest & modules we will be using for our Vagrant tests. For testing purposes we will be creating a Puppet manifest that ensures NTP is installed and is configured to use the following NTP servers:

Using advanced vagrant-vsphere provider settings and vCenter guest customization

This post will pick up where we left off by demonstrating more vagrant-vsphere provider settings using the CentOS template we customized in the last blog post. Let’s get started: 1. Create a new customization specification in the vSphere web client. This customization specification will allow us to set the hostname of the vm created by “vagrant up” to the same name as the virtual machine. Go to Home | Customization Specification Manager: Click the “Create a new specification” button: Select “Linux” for the “Target VM Operating System” and name the customization specification.

Creating a CentOS 6.x template that is customized for Vagrant

This post will continue our examination of using the vagrant-vsphere plugin, by customizing a CentOS template for integration with Vagrant. Having a Vagrant customize template will allow us to deploy this template and SSH to the cloned vm using the “vagrant ssh” command, as well automatically run puppet manifests when we deploy a vm using Vagrant. Let’s get started: 1. Ensure you have a DHCP server on the network you will be connecting the Vagrant deployed templates to.

Installing Vagrant and the vagrant-vsphere plugin on CentOS 6.x

Some readers might find this post to be a little “in the weeds” and cover details they are already familiar with. I struggled in my first attempts to get Vagrant working on CentOS, because I couldn’t find any good tutorials that covered the entire process. If you get bored with basic network configuration or have another preferred method for installing Ruby, please understand I’m trying to provide as much detail as possible to those without much linux experience.