I wanted to share some of the example Ansible playbooks used during last Wednesday’s US #vBrownBag. During the show I went over examples of how you can use Ansible to create, clone, and update virtual machines in vCenter without the need for other provisioning tools. Based on my testing (and I’m still learning as well), the items noted in the comments are the bare minimum needed to run the playbook, even though the official documentation may currently state otherwise. If you are already using Ansible for configuration management, this is a handy option to have as you can perform the provisioning tasks without leaving Ansible.
All playbooks have been uploaded to my GitHub Ansible-Test-Playbooks repository (https://github.com/jfrappier/ansible-test-playbooks/).
Posted in Tech Tagged with: #vbrownbag, ansible, ansible with vcenter, automation, clone, Cloud, devops, GitHub, Home, Linux, podcast, professionalvmware.com, provision, Shared, Technology, vcenter, Virtualization, VMware, vSphere
In my last video, we walked through how to install VMware Tools for CentOS 6.x. Now we are going to prepare the virtual machine for cloning. This requires we remove a specific file; /etc/udev/rules.d/70-persistent-net.rules. This file contains the MAC address for the virtual machine. Once removed, the file will be created during the initial boot with the matching MAC address for the cloned virtual machine.
Now that you have your first Windows VM built and patched, you’re probably itching to get things built like turning the virtual machine it into your domain controller for the home lab which will be used for authentication throughout this setup. However, we want to be efficient with our time so we are going to take our Windows VM and use it to clone new VMs since at the very least I will need 3 Windows virtual machines for this lab; a Domain Controller, SQL server and web server for the vCloud Automation Center/vRealize Automation Infrastructure-as-a-Service server.
So once your Windows VM is fully patched there is one house keeping item to take care of before we use it to clone, and that is to sysprep it.
You should now have a powered off virtual machine, I chose to put mine into a folder called Templates though you can organize as you wish. Now I want to clone this template.
Since the virtual machine was setup using a linked clone, the cloning process will have finished quickly and be space efficient for the lab environment, you will be ready to boot your VM. I moved my VM into a folder I created called Lab, you can see my VMware Workstation layout below.
With the VM cloned and powered on, you will be ready to setup your first virtual machine – our domain controller.