Solving problems and taking names: Automated scripting keeps you ahead

IT admins can use automated scripting and other tools to avoid repetition, reduce human error and generate better documentation.

The benefits of IT automation are often overlooked or misunderstood, which leads many IT professionals to categorize it as someone else's problem. Administrators perform far too many redundant processes -- as well as complex procedures that require the kind of flawless execution that humans can't always achieve. Enterprises need reliable, measurable, efficient results from IT to remain competitive, and automation can help provide that....

Workflow automation tools are useful, but automated scripting -- PowerShell especially -- can help admins accomplish even more.

The push of a button

My father-in-law recently introduced me to his Model-T Ford, and I found myself fascinated by the ritual he practiced to start the car. He adjusted the "spark" for ignition, opened the fuel petcock, added some fuel to prime the cylinders, placed the car in neutral, applied the hand brake and then proceeded to spin a crank stuck into the front of the car. The car sputtered to life.

After watching my father-in-law shift levers and press pedals to keep the machine in motion, I had a new appreciation for the simple joy of getting in my own car and pressing a button to start it up.

In our ever-growing, complex environments in physical and virtual data centers, both on-premises and off-premises, you shouldn't rely on someone remembering how to start the Model-T and perform the repetitive functions that keep it running.

Automation helps resolve a number of problems, including:

  • Repetition. If a tasks needs to be performed more than once on a reliable and consistent level, then automate and schedule the task.
  • Human error. The removal of human error, especially during crisis management, is critical to successful large-scale operations. Even a good admin, under extreme pressure in a critical outage, can make the situation worse with a mistake.
  • Documentation challenges. Automation provides clear documentation of specific instructions and expected, auditable results. Ask yourself if the IT team has the disaster recovery plan documented. If it has been automated, the answer is "yes."

Automation involves new challenges

Of course, automation doesn't magically resolve IT challenges. A good automation strategy requires an understanding of what kind of tools should be used where, as well as the skills to make those tools worthwhile.

Automation can come in a few forms. Let's start with tools that provide a graphical user interface (GUI), which give IT staffers some ability to reuse tasks and manage tasks in greater scale.

Tools such as the graphical Server Manager in Windows Server 2012 and System Center Virtual Machine Manager (SCVMM) provide some automation and scalable features such as deploying roles to multiple servers or managing multiple VMs at once, but don't mistake this for a flexible automation environment. No GUI will ever know your particular business needs.

The flexibility to handle whatever the business throws at you requires a tool unhindered by wizards and limited buttons. The best automation strategies provide an open field of possibility and control -- which also means a chance for complete failure. There is no easy, one-size-fits-all approach to automation.

Effective automation tools are complex and require IT pros to make a huge investment in training and in a specific career path. Learning automation skills should lead to career advancement, cross-platform potential and profit for the company.

In addition, IT must work with the business side to plot a worthwhile plan for automation. On that note, both IT pros and CIOs should read the The Phoenix Project, by Gene Kim, Kevin Behr and George Spafford. It explains how IT can become a part of the business rather than have the typical adversarial relationship.

The advantages of PowerShell

It's widely agreed in the IT industry that a particular tool can provide standards-based, cross-platform, scalable automation that is well worth the investment. While each vendor-specific GUI has merit, the answer to most automation challenges is PowerShell. Hate it, love it, run from it -- you'll embrace it or be automated out by it.

IT pros who use Unix-like operating systems have been using PowerShell for decades. They know that true automation means being able to interact in real time with many objects at once, and automated scripting is the most flexible approach. This is achieved with command-line shell, and the most popular shell is PowerShell. It has already been adopted by VMware, Microsoft SCVMM and Citrix XenApp.

Here's an example. The business needs a new Web server that supports an application running Active Server Pages .NET. A typical solution might look like this:

  • Log onto server
  • Open GUI Server Manager
  • Select Roles and Role services required
  • Reboot server

The solution in PowerShell could be:

  • Log onto server
  • Open PowerShell and type:
  • PS> Install-WindowsFeature Web-Server, web-Asp-Net

There's not much difference until you add scale requirements. Say that 50 Web servers in a load balance are needed to host the new ASP.NET application. The GUI admin's answer is:

  • Log onto server
  • Open GUI Server Manager
  • Select Roles and Role services required
  • Reboot server
  • Next Server (x50)

This solution requires hours or weeks of work, with no documentation and no room for human error, like forgetting to add ASP.NET. The automation IT pro performs something like this:

  • Open PowerShell on desktop and type:
  • PS> Invoke-Command -ComputerName Web1,Web2,Web3 {Install-WindowsFeature Web-Server, web-Asp-Net}

Yes, the computer names can be retrieved from a text file, a .csv file or, better, Active Directory, but the command remains basically the same. The moral of the story is that by using PowerShell Remoting, you can install and configure everything you need to all 50 servers in minutes. It's a simple example, but the point is crystal-clear: I get the job done in minutes, and my value to the business is higher than the GUI admin's.

Automated scripting instructions like those above are the imperative (or step-by-step) instructions sent to a computer to deploy and configure software. PowerShell v4 offers a declarative way, similar to Puppet or Chef in the Unix world, to manage and control system configurations.

Think back to my experience with my father-in-law and the Model-T. He knew how to start it, but if I need to start a Model-T, I'd have to use him as a resource, without having any understanding of the procedure myself.

PowerShell v4 has "Desired State Configuration," which means I can declare a requirement like "I need 50 new Web servers that look like this... " and the resource (step-by-step instructions) will execute my desire without me needing to know the details. This not only expands the deployment aspect of applications and servers, but it also allows you to prevent "drift" (undesirable changes over time from other admins) at a large scale.

PowerShell automation provides IT professionals with a cross-platform tool to deploy and maintain a desired state. It allows CIOs to request 50 new Web servers and get them in minutes. Overall, if automation is done right, it brings IT closer to meeting the needs of the business.

My father-in-law happens to like the process of starting the old Model-T. But when it comes to critical business needs, repetitive tasks are often best left to the safety and reliability of automation.

This was first published in February 2014

Dig deeper on Improving server management with virtualization

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Related Discussions

Jason Helmick asks:

What benefits have you seen from using automated scripting?

0  Responses So Far

Join the Discussion

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close