Case Study Explained: How ansible provides various modules to manage VMware infrastructure.
Ansible is a software tool that provides simple but powerful automation for cross-platform computer support. It is primarily intended for IT professionals, who use it for application deployment, updates on workstations and servers, cloud provisioning, configuration management, intra-service orchestration, and nearly anything a systems administrator does on a weekly or daily basis.
How Ansible works
In Ansible, there are two categories of computers: the control node and managed nodes. The control node is a computer that runs Ansible. There must be at least one control node, although a backup control node may also exist. A managed node is any device being managed by the control node.
Ansible works by connecting to nodes (clients, servers, or whatever you’re configuring) on a network, and then sending a small program called an Ansible module to that node.
Ansible provides various modules to manage VMware infrastructure, which includes datacenter, cluster, host system and virtual machine.
Ansible VMware modules are written on top of pyVmomi. pyVmomi is the Python SDK for the VMware vSphere API that allows user to manage ESX, ESXi, and vCenter infrastructure. You can install pyVmomi using pip:
$ pip install pyvmomi
Ansible for VMware Concepts
Any machine with Ansible installed. You can run commands and playbooks, invoking
/usr/bin/ansible-playbook, from any control node. You can use any computer that has Python installed on it as a control node - laptops, shared desktops, and servers can all run Ansible
Delegation allows you to select the system that executes a given task. If you do not have
pyVmomi installed on your control node, use the
delegate_to keyword on VMware-specific tasks to execute them on any host where you have
The units of code Ansible executes. Each module has a particular use, from creating virtual machines on vCenter to managing distributed virtual switches in the vCenter environment.
Ordered lists of tasks, saved so you can run those tasks in that order repeatedly. Playbooks can include variables as well as tasks. Playbooks are written in YAML and are easy to read, write, share and understand.
Ansible VMware modules are written on top of pyVmomi.
pyVmomi is the official Python SDK for the VMware vSphere API that allows user to manage ESX, ESXi, and vCenter infrastructure.
Ansible for VMware Scenarios
These scenarios teach you how to accomplish common VMware tasks using Ansible. To get started, please select the task you want to accomplish.
- Deploy a virtual machine from a template
- Rename an existing virtual machine
- Remove an existing VMware virtual machine
- Find folder path of an existing VMware virtual machine
- Using VMware HTTP API using Ansible
Ansible maximizes our VMware investment
Make it possible to do more with what we already have. Ansible will help us automate our VMware infrastructure and accelerate the process from development to production.
Ansible Changing the economics of virtualization
Many enterprise IT teams have an operations team managing the VMware infrastructure and a second team deploying apps to this environment. Using Ansible with VMware allows your team to enable a simple self-service IT model across all environments. In addition, Red Hat® Ansible® Tower can be used as a common tool across both teams, reducing complexity. The operations team can write Ansible Playbooks and job templates to describe the environments and the App team can build environments and deploy apps with a single button click.
Ansible also ships with integrations to support physical network devices for all leading vendors. Additionally, NSX modules are available for teams looking to automate network virtualization.
Many VMware customers use vRealize Automation (vRA) to automate the provisioning of VMs, and would prefer to use Ansible Tower for orchestration and application deployment. Through a partnership with SovLabs, the power of Ansible Tower is now accessible from vRA, enabling advanced provisioning and ongoing Day 2 management functions. The combination of vRA and Ansible Tower expands the scope of possible automation for customers — in a manner that is faster and simpler than was previously possible.