During the #vDM30in30 challenge I started playing with Ansible to get to know it a bit better. One of the things I was curious about is the ability for Ansible to provision virtual machines directly to vCenter. After all if I am using Ansible to manage the configuration of my servers, it would certainly be nice to have a playbook that also deploys my virtual machine, rather than another provisioning tool.
If you don’t already have Ansible up and running, you can get the dependencies installed and Ansible project cloned from GitHub pretty easily with a vanilla CentOS box. Once Ansible is running and you have a playbook or two under your belt you can take a read at the Ansible vsphere_guest docs. This particular module is a bit lacking, I hope to add some updates soon and see if they get accepted.
As they mention in the docs, you will need to have pysphere installed; PySphere being a Python API to support interaction with vSphere/vCenter. PySphere is easy to install if you were able to follow along with my Installing Ansible from Git post; simply run
sudo pip install -U pysphere
With PySphere installed, you are now ready to create your playbook. The playbook example in the Ansible docs seemed to be missing something. Recall from my other posts you typically specify a host (linux box, not vSphere host) in your inventory file and direct the playbook that that host or groups of hosts, for example:
--- - hosts: db remote_user: virtxpert sudo: yes tasks: - name: update mysql-libs-latest yum: pkg=mysql-libs state=latest
But, as you can see in the document ion, you specify the vSphere/ESXi host and vCenter server in the vsphere_guest task. So after a few iterations of trying to get that to work, I came across this page on GitHub. It shows what appears to be essentially dummy text to satisfy the host requirements in the playbook. So my playbook ends up looking like this:
- hosts: 127.0.0.1 connection: local user: root sudo: false gather_facts: false serial: 1 tasks: - vsphere_guest: vcenter_hostname: vxprt-vc01.vxprt.local username: [email protected] password: ******** guest: testansible state: powered_on vm_disk: disk1: size_gb: 1 type: thin datastore: vxprt-esxi01-gold-local vm_nic: nic1: type: vmxnet3 network: vm network_type: standard vm_hardware: memory_mb: 1024 num_cpus: 1 osid: centos64Guest scsi: paravirtual esxi: datacenter: dc01 hostname: vxprt-esxi01.vxprt.local
With this playbook format in place, I am now able to run the playbook and have the virtual machine created in vCenter.
Up next, play around with vars_prompt in place of some of the item names so when the playbook is run, it will prompt the user for input and using Ansible to clone an existing vSphere template.
Today Ravello has announced a new version of their platform. I first met Ravello at VMworld and was impressed with what they were building. Ravello, in my opinion, makes it easy to explore public cloud solutions and get comfortable with a range of technologies out side the traditional virtualization admin world – specifically I am looking at them as I continue my journey in learning DevOps methodologies and tools.
With their new release, Ravello is also close to being able to run ESXi as a virtual machine on AWS – for lab enthusiast this means no more expensive home lab equipment. Fire up your AWS hosted ESXi virtual machines and run your lab for as long as you need and power it off when you’re done.
Ravello also provides you the ability to run native ESXi virtual machines on AWS, I can think of several situations where I could have leveraged this functionality for disaster recovery and/or disaster recovery testing.
Full press release after the break…
Official Press Release:
Ravello Systems, Inc. today announced that it has released a major version of its nested virtualization technology, HVX, which wraps complex application environments in selfcontained capsules that can run on any cloud. Founded in 2011 by the team that created the KVM hypervisor, Ravello is driving a fundamental increase in pace for companies by instantly cloud enabling any application.
Delivered as a service, Ravello is a breakthrough offering that enables entire application environments with existing VMware or KVM virtual machines and complex networking, to be deployed on any cloud, without any changes. In addition to seamless cloud usage, Ravello has enabled enterprises to reduce provisioning time for complex application environments from months to minutes. Ravello’s cloudbased smart labs enable enterprises to accelerate their development, test, training, sales and support processes. With the new major release today, Ravello has further enhanced all components of its technology:
1. HVX: nested hypervisor the nested hypervisor now includes nested^2 functionality through support for virtualization extensions such as Intel VT and AMD SVM. This means, in addition to running unmodified VMware or KVM virtual machines on public clouds, Ravello can also run thirdparty hypervisors such as KVM today and soon ESXi on top of AWS or Google cloud. This enables hardwareless hypervisor labs and OpenStack labs in the public cloud.
2. HVX: overlay networking and storage the overlay networking technology now includes full support for VLANs as well as mirror ports on top of AWS or Google Cloud. When combined with the unique ability to support broadcast and multicast in public clouds, the new networking functionality enables applications to have full layer 2 access and use the cloud just like the data center.
3. Management the Ravello management UI has undergone a complete refresh. It now has a new look and feel, with improved user experience and a unified private library that serves as a repository of all resources such as VMs, application blueprints, disk Ravello Systems went into a successful public beta in February 2013 and launched the product globally in August 2013. Since then Ravello’s technology has been adopted by a wide variety of companies ranging from the Fortune 500 to midsize and smaller companies.
Chalk this up in the “useful error messages” column. When you attempt to enter a license key in the vRealize Automation appliance you receive “Error code: 500.”
Now when I saw this I immediately thought “internal server error,” however in the case of vRA it may simply be an expired or invalid license key. Before extensive troubleshooting validate that your license key is correct, and it has not expired.
Posted in Tech Tagged with: automation, Cloud, error code: 500, Home, license, Shared, Technology, troubleshooting, vcac, vcloud, vcloud automation center, vCloud Automation Center (vCAC), VMware, vra, vrealize, vrealize automation, vRealize Automation (vRA)
Today I was chatting with Tim Jabaut in a Slack room Matthew Brender created for Commitmas (ping him or Josh Cohen to get in) and he shared a nice markdown cheat sheet (I seem to be all about cheat sheets during Commitmas). If you have looked at the Commitmas GitHub page you see that Matt and others have made his page pretty; it has been done using markdown. I tried adding some simple markdown to my README file on my Ansible Test Playbooks page but they were just coming over as ##, not as headings.
So, troubleshooting in this new era – it is certainly not done by emailing someone a file! Tim forked my repository to have a look; my README file needed a .MD extension to properly interpret the markdown syntax. With the change complete, Tim issued a pull request which you can see below
First, I need to merge the changes:
git pull https://github.com/tjabaut/ansible-test-playbooks master
Once that is done, you can see I have the changes from Tim in my local repository – my README file is now named README.md
I can now inspect changes to the file that Tim made; for example it may not be something as trivial as a file name. If this were a change say to an Ansible playbook I might want to review what those changes before putting them into the repository. With the file(s) local to me now, I can:
git add . git push
to merge this change back into the repository. Here you can see the changes before and after my git push.
Yesterday was the first day of Commitmas, a community event thought up by Matt Brender to help us all get used to sharing code and working with GitHub. The challenges vary based on your level of comfort – I am starting in the beginner track and hoping to work my comfort level up to being a “beginner intermediate” by the end. Now I am no developer but I see the train coming, and for all the vCommunity out there I hope you see it coming at well. The future is code and scripts; Commitmas is a great way to prepare.
Last month I published a few posts on Ansible, as part of that I created a repository on GitHub to put my playbooks in. To get back into the swing of GitHub I decided to install Git on Windows, clone my Ansible repository and create a simple README file.
What little knowledge and hands on with GitHub I have has all been from a Linux based system. On Windows you lack some of the common tools you have with Linux such as the ability to create SSH keys or an SSH client. The Git install for Windows provides these for you. Installing Git for Windows is easy, thanks for course to Chocolatey.org; if you have not used Chocolatey before installing it is also quite simple. Open a cmd prompt as admimistrator and run
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin
Now packages are as easy to install as running
choco install git
Once installed, we need to verify a few system settings:
After the reboot you should be able to open a cmd prompt and run ssh and not get a “ssh is not a recognized command” message
We are now ready to setup GitHub on Windows. If you haven’t done so already, create a user account on GitHub. There are a few commands we need to run to get everything ready.
CD to %userprofile%.ssh; you should see two files – id_rsa and id_rsa.pub.
Now switch back to your cmd prompt window
You are now authenticated with GitHub, you can now enjoy the 12 days of Commitmas!
Posted in Tech Tagged with: automation, chocolatey, Cloud, Commitmas, devops, git, git for windows, GitHub, Home, lab, Microsoft, PowerShell, Shared, ssh, ssh-keygen, Technology, Training, Vendors, Windows