Leveraging PowerShell to seize control of a heterogeneous data center

With more businesses adopting multiple hypervisors, PowerShell may be your best bet for a unified platform to manage a heterogeneous data center.

Don't fight the trend of other virtualization platforms creeping into your data center. Businesses often need to lower costs or find alternatives, challenging IT pros to become just as heterogeneous in their management as their virtualization environment. Don't make this challenge harder than necessary. Focus on a unified management platform to minimize the learning curve while maintaining the flexibility to control a variety of systems...

found in a heterogeneous data center.

Is a graphical management tool the answer?

After you've learned the difference between each vendor's platform, your challenge becomes how to manage them. This is a time and sometimes monetary investment you don't want to waste on tools that may not meet your needs down the road.

The first inclination of many IT pros is to find a graphical user interface (GUI) tool that will help them manage their entire heterogeneous data center. Graphical tools have benefits. They're easy to learn, include guided wizards to help with complicated tasks and can offer a visual representation of your environment.

Many virtualization platform vendors, such as VMware and Microsoft, have created GUI management tools that assist in managing the other vendors' product. This provides a consistent interface and reduces the confusion factor and training cost. There are third-party management products that do this as well. But even with the advantage of a uniform interface, consider some of the drawbacks to using a GUI management tool:

  • You can only perform the management tasks that the vendor has developed for the GUI. Outside business needs are difficult to address.
  • There are inconsistent features (or lack of features) with cross-platform management as well as other countless limitations when one vendor attempts to manage another vendor's product through a graphical interface.
  • Graphical management tools don't normally offer many automation capabilities, forcing you to repeat tasks.
  • It's not always easy to install GUI tools on client computers when you need them.

Weighing the benefits and drawbacks of a particular graphical management tool takes time and testing. There will always be a need for a graphical tool. However, as an IT pro who works across different platforms and requires automation, I don't want to invest my time in tools that limit my capabilities.

The most power and flexibility possible

Instead of investing time with a graphical management tool, I focus on using PowerShell. Now, before you start throwing angry insults at me, let me list a few benefits, drawbacks and an example to get you started.

PowerShell is a cross-virtualization platform. There are cmdlets for the most popular virtualization platforms, including VMware (PowerCLI), Microsoft (SCVMM and Hyper-V) and Citrix (XenDesktop). PowerShell gives you complete flexibility to handle whatever business needs you face. There are no GUI limitations; you have the ability to choose your own path. You can also use automation to remove repetitive tasks often required in a graphical tool. This automation also removes the potential for human error.

There are also drawbacks to using a shell and scripting language such as PowerShell. Just ask any experienced Unix admin. Learning to use the tool can be difficult, and it can be a large time investment. There are great resources available today -- including books, videos and training classes -- but you will need to sit down and practice, not just absorb information.

Using PowerShell will require some research. You won't solve every problem with a simple command. Many times, you will need to research a fix, then script the solution. This might involve hours out at the Microsoft Developer Network site. You will also need to learn development skills. You don't need to become a full-fledged developer, but you will need to learn scripting and programing skills.

Once they consider what's best for your company and your virtualization environment, many IT pros choose PowerShell for their heterogeneous data center.

Get started managing cross-platform

The examples below are more of a concept than something to actually type at a PowerShell prompt. They're designed to describe some of the capabilities PowerShell can provide.

First, PowerShell provides flexible and extensible management by loading multiple modules (or Snap-ins) that provide additional cmdlets. If the vendor has created these and you have installed the tools on your local computer, you can load and use them to manage your heterogeneous data center. Below is an example of how to load the cmdlets for VMware.

PS> Add-PSSnapin VMware*

You can load multiple modules and create automation and management scripts for multiple products. In the example below, I loaded both the VMware and Microsoft SCVMM cmdlets. A note of caution: There are cmdlet names that conflict in cases where multiple vendors have used the same name. If the cmdlets are in a module, the Import-Module cmdlet has a parameter, -prefix, that will prefix the noun of the cmdlet to avoid the conflicts:

PS> Add-PSSnapin VMware*
PS> Import-Module –Name VirtualMachineManager -Prefix MS

Oftentimes I don't have or want the management tools installed on my computer. PowerShell has a feature, PowerShell Remoting, whereby you can borrow the cmdlets from the server that does have them. The cmdlets appear on your computer as if they were installed, but it's more accurate to think of them as shortcuts to the cmdlets on the remote server. I've given examples below of implicitly remoting the cmdlets for VMware, Citrix and SCVMM. However, as you experiment with your own products, you will discover that not all vendors planned for this, and some cmdlets may not function correctly.

#VMware
$VWsession = New-PSSession -ComputerName "NameOfVMWareServer"
Invoke-Command -Session $VWsession -ScriptBlock {Add-PSSnapin VMware*}
Import-PSSession -Session $VWsession -Module VMware* -Prefix VW

#Citrix
$CXSession = New-PSSession -ComputerName "NameOfCitrixZenDesktopServer"
Invoke-Command -Session $CXSession -ScriptBlock {Add-PSSnapin Citrix*}
Import-PSSession -Session $CXSession -Module Citrix* -Prefix CX

#MS SCVMM
$MSsession = New-PSSession -ComputerName "NameOfSCVMMServer"
Invoke-Command –Session $MSSession -ScriptBlock {Import-Module –Name VirtualMachineManager}
Import-PSSession -Session $MSsession -Module VirtualMachineManager -Prefix MS

If you've already started using PowerShell, I hope this gives you some ideas on how to use it across all your virtualization platforms. If you haven't started using PowerShell, maybe it's time to consider the ultimate flexibility and automation tool.

This was first published in January 2014

Dig deeper on Microsoft Hyper-V management

Pro+

Features

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

Related Discussions

Jason Helmick asks:

What is your favorite tool for managing multiple hypervisors?

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