Storage Spaces : Create a non-clustered storage pool on a cluster instance

Introduction

Today I ran into some issues when creating a storage spaces volume on a cluster instance. I wanted to use the performance benefits of joining multiple Azure storage disks by using storage spaces. Afterwards I wanted to use the volume with SIOS Datakeeper. The issue at hand was that the newly storage spaces would auto register with the cluster. It would then assume that the Azure disks were shared accross the cluster.

 

Error messages

The first thing I got were some failed messages. Then I saw that the storage pool was set in ReadOnly ;

Get-StoragePool Pool02 | Set-StoragePool -IsReadOnly $false

Set-StoragePool : Access denied
At line:1 char:26
+ Get-StoragePool Pool02 | Set-StoragePool -IsReadOnly $false
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : PermissionDenied: (StorageWMI:ROOT/Microsoft/…_StorageCmdlets) [Set-StoragePool], CimE
xception
+ FullyQualifiedErrorId : StorageWMI 40001,Set-StoragePool

Normally, the access denied would mean that you aren’t running as administrator. In this case it meant that the storage was (auto)registered to the clustered. Therefore you need to delete the storage pool from the cluster first, before you are able to delete it.

 

The Fix

The fix was (in retrospect) quite easy… Disabling the “Automatic Clustering” on the storage sub system. And only then create the storage pool (and others).

Get-StorageSubSystem | Where AutomaticClusteringEnabled -eq $true | Set-StorageSubSystem -AutomaticClusteringEnabled $false

My first attempt was to attempt to link the disks to the non clustered storage sub system. Though the disks were already linked to the clustered storage subsystem by default.

 

Easy Script

Want to do it more easy? Check out this script…

$storagePoolName = "XylosStoragePoolLocal"
$virtualDiskName = "XylosVirtualDiskLocal"
$driveLetter = "Z"
Write-Host "* Looking for the storage sub system with Automatic Clustering enabled"
$storageSubSystem = Get-StorageSubSystem | Where AutomaticClusteringEnabled -eq $true
if ($storageSubSystem -eq $null) {
    Write-Host "* No storage sub system found with Automatic Clustering enabled... Please choose one ; "
    $storageSubSystem = Get-StorageSubSystem | Out-GridView -PassThru
} else {
    Write-Host "* Disabling the Automatic Clustering"
    Get-StorageSubSystem | Where AutomaticClusteringEnabled -eq $true | Set-StorageSubSystem -AutomaticClusteringEnabled $false
}
Write-Host "* Using" $storageSubSystem.FriendlyName "as storage sub system"
$columnCount = (Get-PhysicalDisk -CanPool $true).Count
Write-Host "* Using a column count of" $columnCount
Write-Host "* Creating storage pool" $storagePoolName
$storagePool = New-StoragePool -FriendlyName $storagePoolName -StorageSubSystemUniqueId $storageSubSystem.uniqueID -PhysicalDisks (Get-PhysicalDisk -StorageSubSystem $storageSubSYstem -CanPool $true)
Write-Host "* Creating virtual disk name" $virtualDiskName 
$virtualDisk = New-VirtualDisk -StoragePoolFriendlyName $storagePoolName -FriendlyName $virtualDiskName -ResiliencySettingName "Simple" -NumberOfColumns $columnCount -UseMaximumSize
Write-Host "* Initializing the virtual disk as drive" $driveLetter
Get-VirtualDisk –FriendlyName $virtualDiskName | Get-Disk | Initialize-Disk –Passthru | New-Partition -DriveLetter $driveLetter –UseMaximumSize | Format-Volume -Confirm:$false

 

TL;DR

  • Setting up a non-clustered storage spaces pool on a cluster instance it suite tedious.
  • Disable the automatic cluster registration
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s