Configure and Manage Storage Pools with Data ONTAP SMI-S Agent 5.1 on Windows Server 2012 and 2012 R2.

by vinith Former NetApp Employee on ‎2014-05-21 11:01 PM

In this blogpost i would show how you can configure and manage storage pools  with Data ONTAP SMI-S Agent 5.1 on Windows Server 2012 and 2012 R2. for more details on how to get started with Configuring Data ONTAP SMI-S agent with Windows Server 2012 / 2012 R2 check out my previous blogpost Getting started with Configuring Data ONTAP SMI-S Agent 5.1 on Windows Server 2012 and 2012 R2.

We would dig deep into the storage powershell cmdlets which come with the storage module and also see how these cmdlets integrate with the SMI-S agent to manage our NetApp Storage Array.

If i run a measure object on the list of cmdlets in the storage module, we would see that there are about 102 cmdlets.

gcm -Module storage | Measure-Object

Now lets look at the list of cmdlets which can be used to configure and manage storage pools, i can get the list of these cmdlets by filtering the output of the above one liner and check for the cmdlets which match the name pool.

gcm -Module storage | ?{$_.name -match "pool"}

Get-StoragePool gets me the list of all storage pools which exist on the NetApp controller.

So next let us explore the properties of one of these pool's, as you can see below this cmdlet gives us a detailed information regarding the pool.

Get-StoragePool aggr_SC2012 | fl *

To create a new storage pool we need to use the New-StoragePool cmdlet, the New-StoragePool cmdlet creates a new storage pool using a group of physical disks and a specific storage subsystem exposed by a storage provider.

New storage pools are created using the physical disks which are currently not part of any storage pool, these disks should have the canpool property set to true.

To get the list of physical disks use the Get-PhysicalDisk cmdlet.

Get-PhysicalDisk | ft -AutoSize

As you see in the figure above lot of these disks have the canpool property set to false, which means that they are already a part of a storage pool, now to get the list of disks which are free to pool, run the get-physicaldisk cmdlet with the canpool parameter set to true.

Get-PhysicalDisk -CanPool $true | ft -AutoSize

If i dig deep down into the characteristics of a NetApp Disk, im able to see that a detailed information regarding the disk type, serial number etc.

If i execute the Get-PhysicalDisk cmdlet it does not give me the storage subsystem to which its bounded, below you can see that when i execute this cmdlet it does not give me storage subsystem name.

So here's where we use powershell to create custom objects, the below script accomplishes this task.

$storagesubsystem = Get-StorageSubSystem

$volinfoarray = @()

foreach ($stor in $storagesubsystem)

{

$physicaldiskinfo = Get-StorageSubSystem $stor.FriendlyName | Get-PhysicalDisk

foreach ($physicald in $physicaldiskinfo)

{

       $physicaldiskmodinfo = [pscustomobject][ordered] @{

            'Storage_SubSystem_Name' = $stor.FriendlyName;

            'CanPool' = $physicald.CanPool;

            'BusType' = $physicald.BusType;

            'HealthStatus' = $physicald.HealthStatus;

            'AllocatedSize'  = ([math]::Round([decimal]($physicald.AllocatedSize)/1gb,2));

            'Description'  = $physicald.Description;

            'DeviceId'  = $physicald.DeviceId;

            'Manufacturer'  = $physicald.Manufacturer;

            'Model' = $physicald.Model;

            'SerialNumber' = $physicald.SerialNumber;

            'Size' = $physicald.Size;

            'SpindleSpeed' = $physicald.SpindleSpeed

            }

            $volinfoarray += $physicaldiskmodinfo

}

}

Once i execute this scriptlet it gives me the details of the physical disks along with the storage subsystem to which it belongs.

Now if i look into the output of $volinfoarray, you would be able to see the storagesubsystem name listed.

Next if we filter the output more, i can get the list of disks which are free to be pooled.

$volinfoarray | ?{$_.canpool -match "True"}

Next let me create a storage pool using these free disks.

New-StoragePool -FriendlyName "LUN-1TB" -StorageSubSystemUniqueId (Get-StorageSubSystem -FriendlyName Jupiter).uniqueID -PhysicalDisks (Get-PhysicalDisk -CanPool $true)

As you can see in the figure above once i execute a Get-StoragePool cmdlet im able to see the new storage pool which was created.

Similarly you can use the Remove-StoragePool cmdlet to remove a storage pool, When a storage pool is created, it consumes one or more physical disks to create the pool, from which virtual disks are subsequently created. The removal of a

storage pool, which can only be performed after all virtual disks have first been removed ( which can be accomplished using the Remove-PhysicalDisk cmdlet) , destroys the storage pool, and returns the physical disks back to a non-pooled state, where they may be re-consumed.

PS C:\> Remove-StoragePool -FriendlyName "LUN-1TB"

To modify the properties of the specified storage pool, you can use the Set-StoragePool cmdlet. Below are examples from the cmdlet help.

Example 1: Change the friendly name

PS C:\>Set-StoragePool -FriendlyName StoragePool -NewFriendlyName StoragePool2

Example 2: Make a read-only storage pool writeable

PS C:\>Set-StoragePool -FriendlyName "Storage Pool 1" -IsReadOnly $False

Example 3: Set the default resiliency and provisioning settings

PS C:\>Set-StoragePool -FriendlyName "Storage Pool 1" -ResiliencySettingsNameDefault Mirror -ProvisioningTypeDefault Thin

If you upgrade your Windows Server 2012 infrastructure to Windows Server 2012 R2, storage pools hosted on that server continue to work, but new Storage Spaces functionality, such as storage tiers, is not available. This cmdlet enables new Storage Spaces functionality for a storage pool on a server that runs Windows Server 2012 R2. The Update-StoragePool cmdlet updates the metadata of a Windows Server® 2012 storage pool to a Windows Server® 2012 R2 storage pool.

Below are some examples from the cmdlet output.

Updates the metadata of a Windows Server 2012 R2 storage pool.

Example 1: Upgrade a storage pool by using a friendly name

PS C:\>Update-StoragePool -FriendlyName "Win8Pool32"

I hope that you have enjoyed this blog entry and have found this information helpful. In my next series of blog post i would be taking a deep dive into the powershell cmdlets which can be used to manage Virtual Disks.

Good Luck!

Thanks,

Vinith

Warning!

This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.