IaaS with Ansible and ServiceNow

 In the previous article we showed how organizations can leverage modern automation tools to deliver Storage-as-a-Service on-prem to provide end users with a comparable experience to that of public cloud at a fraction of the cost and with the added benefits of easier security and compliance.  The STaaS demo leaves no one indifferent. What we see often happening is that the viewer’s mind starts to extrapolate and comes up with the logical question:

"Can I do this with other IT resources?"

After all, the IT organization owns more resources than storage and of course, public clouds offers all their services in the same way, directly to the end user through a self-service catalogue

The answer is “YES”, it can be done (and it should be done) for other IT resources. For example, a basic offering for everyone should be Infrastructure-as-a-Service. Both IaaS and STaaS were the original services provided by AWS 14 years go and are to this date the bread and butter of public cloud providers services portfolio. So in today’s article we will show how we can deliver IaaS using ServiceNow and Ansible

The most common hypervisor in the enterprise market is still VMware vSphere so for the IaaS part we will vSphere. Essentially the goals are to allow the end-user to:

  • provision their own VM
  • install applications in their VMs

While presenting about Ansible I often get some customers commenting:

“We cannot use Ansible because we run VMware”

There is a misconception that the only way to automation vSphere environments is to use VMware’s own automation tools such as vRealize suite. The truth is that many 3rd party tools provide the ability to automate VMware environments which makes sense given the prevalence of vSphere in the datacentre. In particular the list of Ansible modules available for VMware is large and covers all aspects of management, including the Virtual Machine lifecycle which is what we need to implement IaaS.

The following screenshot from Ansible Galaxy shows the most popular collection of Ansible modules to manage vSphere. The collection contains 167 modules but the only module our demo uses is “vmware_guest”. These modules leverage PyVmomi, which is a very popular Python SDK for the vSphere API.


In the first part of the video we show how the end user can:

  • select a location for the Virtual Machines. The drop-down menu shows 2 datacentres in 2 different countries, however it could be used to offer different tiers as well, i.e. prod vs dev. These tiers could be underpinned by different clusters or different pools in the same cluster and potentially offer different network/security characteristics
  • specify the number of VMs to provision. For example if we need a web farm consisting of 20 identically configured virtual machines we can create them all in a single step
  • then specify the size of the VM such as vCPU and RAM. Public cloud providers like to use specific t-shirt sizes which is convenient for them but not so much for the user, especially when a non-average VM configuration is required
  • Finally select an operating system to be installed in the VM


 This demo doesn’t include three of the features that we used for the STaaS. Implementing them is not difficult as the same technique would be directly applicable in here:
  • Organizational quotas. The advantage of doing them on an external system is that they can span multiple sites and multiple clusters. The quota management system can easily be expanded to include a quota for a number of VMs or for the individual physical resources (ex: vCPU and RAM) as desired
  • Leases. Very often there is a short term requirement for test & dev. We can offer the user the possibility to select a finite lease for a temporary requirement or a permanent lease for a production workload. The provisioning workflow then creates a scheduled task in Ansible Tower/AWX to deprovision the resources at the end of the lease
  • Notify the end user that the VMs are available. This is easily achieved with the “mail” Ansible module as we did in the STaaS video

In the second part of the video we show how we can install an application on a given VM. The workflow is very simple:

  • Select the location where the VM lives
  • Provide the name of the VM
  • Select the application to install from the drop-down list of available applications provided by the IT department


Some possible improvements would include:
  • Once a location or a target cluster is provided we could retrieve a list of VMs running at that location that the user has rights to and populate the VM name field in a drop-down fashion. This can be done with the “vmware_vm_inventory” Ansible module or through a REST API call to vCenter. However, the drop-down menu could be very large if the user has rights to many VMs
  • We could also provide the option to install the app in the VM creation catalogue entry but this method is convenient also to address the requirement of multiple apps installed in the same VM and the requirement to upgrade an installed app to a newer version, which is straight forward with Ansible

And finally here it is the video

One can imagine that by allowing end users to consume the IT resources we are freeing up our valuable IT engineers from repetitive tasks. Instead these engineers can now focus on creating great OS images and application playbooks that are hardened and configured to best practices to deliver the best possible security and performance. This redeployment of resources and change in roles and responsibilities is in fact the final phase of the IT transformation, “Transform”. The first two phases being “Modernize” and “Transform”


Comments

  1. It's official: I passed the ServiceNow Certified System Administrator on my first attempt, and I couldn't have asked for better study materials. These CSA Dumps Study Guide resources were exceptional! The study guides were comprehensive and covered everything I needed to know. The practice questions were challenging and gave me the confidence I needed to face the real exam.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Great Article Thank you..

    ELearn Infotech offers Python Training in Hyderabad Madhapur. Our Python course includes from Basic to Advanced Level Python Course. We have designed our Python course content based on students Requirement to Achieve Goal. We offer both class room Python training in Hyderabad Madhapur and Python Course Online Training with real time project.

    ReplyDelete
  4. A Dedicated Server provider that meets your hosting needs can be a game-changer.

    ReplyDelete

Post a Comment

Popular posts from this blog

Sending PowerStore alerts via SNMP

Sending PowerStore logs to Syslog

Electronic Nose - eNose