PowerShell Script to Configure Windows Server 2012 and 2012 R2 to use shared RAID as Cluster shared Volume

First what is shared RAID?

Shared RAID means that different Systems share one RAIDcontroller (or two if the system is redundant) and his virtual Disks.

Like with the Dell PowerEdge VRTX, where you can have up to 4 nodes sharing a PERC H710p based Raidcontroller (redudant configuration will be available beginning 2014) and up to 25 disks.

 

VRTX

Source: www.delltechcenter.com


www.dell.com

 

By default, you cannot use shared RAID as in Windows Server.  If you want to use a shared RAID Controller as Cluster shared Volume with Windows Server you need to change the registry.

You have to create the registry value:

HKLM:\SYSTEM\CurrentControlSet\Services\ClusDisk\Parameters\AllowBusTypeRAID 
 
 

Because most of us running scripts or management systems like Microsoft System Center to autoconfigure the Operatingssystem and the Server, I spend some time to create a script you can use with Windows Server 2012 and 2012 R2 to configure this registry value.

 

Script:

#Copyright www.datacenter-flo.de & www.dell.de/techcenter
Set-ExecutionPolicy RemoteSigned -Force #Set Execution Policy to RemoteSigned
Get-PSDrive -PSProvider Registry #Load PowerShell drive Registry
$regkey = “HKLM:\SYSTEM\CurrentControlSet\Services\ClusDisk\Parameters\” #write var RegKey with Registry path
$name = “AllowBusTypeRAID” #write var name with name of value
$exists = Get-itemproperty -path $regkey -name $name -ErrorAction SilentlyContinue #write value of var name in var exist
if ($exists.$name -eq $null) #check if var name exist
{
new-Itemproperty -path “HKLM:\SYSTEM\CurrentControlSet\Services\ClusDisk\Parameters\” -name AllowBusTypeRAID -value “1” -PropertyType “dword” #write new key because var name not exist
Write-Output “The Key [$regkey$name] was created and set to value 1.”
Write-Output “You can now use shared RAID as Cluster Shared Volume (CSV)”
}else{
if ($exists.AllowBusTypeRAID -eq 0 ) #var name exist now checking if value is 0
{
Set-ItemProperty -path “HKLM:\SYSTEM\CurrentControlSet\Services\ClusDisk\Parameters\” -name AllowBusTypeRAID -value “1” #var name exist but is 0 so set value to 1
Write-Output “The Key [$regkey$name] was available and set to value 1.”
Write-Output “You can now use shared RAID as Cluster Shared Volume (CSV)”
}else{
Write-Output “The Key [$regkey$name] already exist.”
Write-Output “You can now use shared RAID as Cluster Shared Volume (CSV)”
}
}

 

Tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.