Around The Block Blog

Guest Post: MaximumASP and PowerShell

by Andy Stumph, Senior Systems Engineer with MaximumASP — December 16, 2008

 

Hi, my name is Andy Stumph and I’m a Senior Systems Engineer with MaximumASP. MaximumASP is a Microsoft Gold Certified hosting and IT services provider based in Louisville, Ky. We recently released a new product offering called MaxV. MaxV is virtual dedicated server offering that is hosted on Windows Server 2008, Hyper-V, Microsoft Failover Clustering and a Compellent Storage Center SAN and managed using the System Center Suite of products. We believe we are the first hosting company to market with a highly available / clustered virtual server offering based on Hyper-V!

The MaxV provisioning process is built entirely using PowerShell. When a customer signs up for a virtual dedicated server on the MaximumASP website, a set of PowerShell scripts kick off that runs the entire process, creating LUNs on the SAN, mapping those LUNs to a 14 node cluster, creating the virtual machine, running sysprep on  the VM, making the VM highly available and even setting up a backup routine for the VM. This whole process can be done in a matter of 15 – 20 minutes. In the past, provisioning a traditional dedicated server could take 2 – 3 business days.

One of the main reasons we are able to offer a clustered Hyper-V configuration with an automated process is our use of the Compellent Storage Center SAN. Compellent recently released a set of PowerShell cmdlets called the Storage Center Command Set for managing the SAN. These cmdlets are a key ingredient in this whole mixture. Without the Storage Center Command Set, MaxV would not exist in its current form today. If you had to use the GUI, imagine how long it might take you to create a LUN and then map that LUN to 14 servers across multiple interfaces…then log on to each server and perform a disk rescan. This can be done in seconds using PowerShell and the Compellent Command Set.

Below is a sample script that shows the power of the Command Set. It will connect to a Compellent Storage Center, create a new LUN from an existing replay, map the LUN across all cluster nodes and perform a disk rescan on all cluster nodes.

This is just a sample of the things you can do with the Command Set. There are a total of 60 cmdlets providing a very powerful set of tools for automating disk, LUN and SAN management.

function Get-ClusterNodes
{

$Cluster = New-Object -comObject MSCluster.Cluster
$Cluster.Open("") 

$Nodes
= $Cluster.Nodes 

foreach
($Node in $Nodes)     
     {
     
     [
array]$NodeList = $NodeList + $Node.Name
     } 

return $NodeList
$NodeList = $null
}

# Load the Compellent Command Set
if(!(Get-PSSnapin Compellent.StorageCenter.Scripting -ea SilentlyContinue))
{
Add-PSSnapin -Name Compellent.StorageCenter.Scripting
}
 

# Compellent SC Connection Variables
$User = "User"
$Pass = ConvertTo-SecureString "P@adf3adfe1" -AsPlainText -Force
$SCHost = "192.168.10.1" 

# Initiate Connection to Compellent Storage Center
$connection = Get-SCConnection -HostName $schost -User $User -Password $Pass -Save $SChost -Default 

# This is the description field for a given replay
$ReplayName = "GoldenImage" 

# Get the named Replay
$Replay = Get-SCReplay -Description $ReplayName 

# Create a new volume on the Compellent from the replay
$NewSCVolume = New-SCVolume -SourceReplay $Replay -Name "HyperVGuest1" 

# Get all nodes in the cluster
$Nodes = Get-ClusterNodes 

# Map the new volume to all the nodes in the cluster and perform rescan
foreach($Node in $Nodes)     
    {
      $SCServer = Get-SCServer -Name $Node

      
New-SCVolumeMap -VolumeIndex $NewSCVolume.Index -ServerIndex $SCServer.Index            
      Rescan-DiskDevice -Server $Node -RescanDelay 5                             
    }

Comments

August 25, 2009 12:24 PM

Thanks for sharing about your company. You have bragging rights to be the first. Thanks for explaining.

louisville home

Add comment

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]
Comment moderation is enabled and may delay your comment. There is no need to re-submit your comment if you don't immediately see it in the comment list.