VMworld Europe Hackathon: Introducing team Automation for All

VMworld Europe Hackathon: Introducing team Automation for All

In a week, VMworld Europe 2017 kicks off and as tradition dictates, VMware is organising a Hackathon on Monday night. As part of that, a bunch of us have started a team to do something cool with Ansible during that Hackathon (team 4 on the list).

The first and foremost goal of our team is to have fun and enjoy a good evening with like-minded people. If, during all of that fun, beer drinking, chocolate eating and overall banter, we also manage to build something interesting, all the better!

The team

The team consists of some interesting and experienced people with great backgrounds:

If you want to meet the team, join us on our VMware {code} Hackathon-Europe Slack channel!

The goal

There are two potential goals that we could go for as a team:

  • Develop a new Ansible module to do something in a vSphere environment, for instance deploying an OVA.
  • Creating Ansible roles to automate a deployment of a vSphere product, for instance vSphere Integrated Containers.

Let’s dive in each of those options a little deeper.

Expanding Ansible capabilities

One of the ways this team can do a real life contribution to Ansible, is by actually developing a new module for Ansible, or by expanding the capabilities of an existing module.

There are already a lot of modules available as part of native Ansible for managing VMware environments, and with each release there are more. One of the modules and functionalities that are currently missing, is a way to deploy OVA or OVF images through Ansible. What people currently do is to use the ovftool of VMware and call that directly using the Ansible command module. This is not the real Ansible way.

As Ansible is written in Python, the optimal solution needs to use pyvmomi, the official Python API of VMware. There is already an example on how to do this using pyvmomi in the community-samples repository: deploy_ovf.py and deploy_ova.py.

This code can be used as a base for developing an Ansible module, the module will require the classic framework to use the proper Ansible constructs. Any existing VMware module can be used as an example for this effort.

The complexity of this implementation will come from adding some needed functionality which currently is missing in the example mentioned above. The example just deploys an OVA and supports multiple disks. It does not support network and vApp properties during the deployment.

Adding those functionalities will require some research into the API, for which we can use the vSphere Web API Reference guide.

Automating with Ansible

Another way the team can contribute in the automation space, using Ansible, is by creating a role which can be shared using Ansible Galaxy. This would help others who want to use Ansible to manage certain components of their vSphere environments.

A lot of automation has already been provided, one of those great examples is the Automated Lab deployment scripts of William Lam. (They’re not using Ansible, but we can forgive him for that ;)).

What has been missing is a way to automatically deploy and setup the vSphere Integrated Containers solution. This solution allows you to run containers as VMs and in a typical devops environment, being able to deploy and manage this solution through automation, would be a great improvement.

During the Hackathon, multiple roles could be developed:

  • Prepare VIC environment: This role would setup the required networks/portgroups and host configuration
  • Deploy VIC OVA: The role that would do the actual deployment of the management host
  • Deploy VCH: Using the management host, deploy a Virtual Container Host
  • Destroy VCH: Using the management host, remove a Virtual Container Host
  • Destroy VIC: Remove the whole VIC setup

The Deploy roles will have the highest priority as these would provide the automation that would be very useful and fun to demonstrate. Once VIC and a VCH has been deployed, deploying containers using Ansible can be achieved with the Docker modules.

Join us!

Be sure to check out the list of teams for the Hackathon, there is still plenty of room to join and it is an incredible experience! Don’t forget to also subscribe to the event (VMTN6735E in the VMworld EU Catalog).

In case you just want to join for the beers and company, you can join just for the foods and drinks event in the VMworld EU Catalog (VMTN6736E).

Tags: , , , , ,