NetApp Storage QoS using SRM Script Callouts

15Nov13

Every year my team brings various lab environments to VMworld demonstrating the benefits of using VMware products on NetApp storage.  This year for my lab I decided to show the benefits of using VMware Site Recovery Manager on NetApp’s Clustered Data ONTAP.  In addition to showing the flagship NetApp capabilities like array based replication using SnapMirror and instantaneous zero capacity writable clones using FlexClone,  I wanted to demonstrate the ability to apply NetApp Storage Quality of Service (QoS) policies to my recovery plan using custom script callouts.

SRM Script Callout

Within SRM you have the ability to further automate your recovery plan by adding additional steps using custom script callouts. The steps can be used to either prompt the recovery plan operator or to call scripts in a .bat, .cmd, .vbs, .wmi, PowerShell, or Perl file to automate other tasks.  As a matter of fact, scripts can be added on either the SRM server or guest VMs, so as long as the guest OS supports the command-line engine you want to run you are good.

Image

Since one of the features in NetApp’s Clustered Data ONTAP 8.2 is the ability to assign QoS polices at a Volume, File, LUN, or Storage Virtual Machine (SVM) I thought it would be cool to show the capabilities of custom script callouts to proactively assign a QoS policy.

QoS with clustered Data ONTAP

The Storage Quality of Service (QoS) feature is new in NetApp Data ONTAP 8.2. It operates by applying policies (behaviors) on policy groups. These policy groups, which define isolation boundaries between workloads, operate within the scope of a Storage Virtual Machine, or SVM (a SVM is a NetApp virtual storage server, and can be used to provide multi-tenant isolation).  Policy groups can contain a single SVM, or one or more volumes, LUNs, or VMDK files within the SVM.  In clustered Data ONTAP 8.2, policies supported include throughput limits, expressed either as IOPS or MB/sec applied at the protocol stack.  This means the throttling gets triggered when the total throughput across all workloads within the policy group exceeds the QoS limit.  Storage QoS can be used to throttle and prevent rogue workloads from interfering with higher priority traffic, as well as to provide predefined service level objectives for specific tenants in service provider environments, and also to ensure consistent tenant-level performance regardless of the number of tenants deployed on the shared infrastructure.

My Lab

  • 2 virtual ESXi 5.5 Hosts
  • 2 clustered Data ONTAP 8.2 VSIMS
  • VMware vCenter Site Recovery Manager 5.5

For my lab I chose to proactively assign a QoS policy to throttle the performance of a workload that will be failing over to my New York recovery datacenter.  The storyline is as follows.  I have three priority workloads (A, B and C).  While my C workload is the highest priority workload in Barcelona, it is the 3rd highest overall.  In the event of a Barcelona failover to New York, my A and B workloads will potentially be sharing IOPS with my C workload.  Of course I can wait until there is a performance impact after migrating, but #1, that doesn’t guarantee performance to my priority workloads and #2, I don’t get to play with SRM script callouts.

Image

Adding a Script Callout to a VM

SRM allows you to add scripts as individual steps or sub-steps within a Virtual Machine. In my lab I used both.

  • Pre-Flight QoS Check: Determines if  the recovery is a test or real recovery operation.
  • Set QoS: Defines and applies QoS policy to a volume in my recovery site.

When adding to an individual VM do the following

1.  Right click the VM and select Configure.

srmqos4

2.  Select either Pre or Post Power on Steps.  I chose Pre-Power for my demo because I want the policy to apply before the VM starts.

srmqos5

3.  You can either run scripts from your SRM server or an individual VM.  The option to run on a VM is only displayed on Post-Power on.  I am running my script on my SRM server.

srmqos6

Pre-Flight QoS Check Script

During a test recovery operation, the NetApp Storage Replication Adapter creates a FlexClone volume from the latest Snapshot copy of the SnapMirror destination volume and displays the cloned export path or LUN path to Site Recovery Manager.  I only want a QoS policy to be applied in the event of a real failover to New York.  Since SRM’s test recovery operation uses the recovery workflow, I decided to add a script that would identify whether or not the plan that is running is a test or true recovery operation.

How do I tell the difference you ask?  Easy, because I know that the NetApp SRA prepends every test FlexClone volume on the secondary storage system with the prefix testfailoverClone_  I decided to use this as my variable.

$ControllerIP      = '192.168.0.101'
$UserName          = 'admin'
$Password          = 'password'
$Volume            = 'bcnds0_dr'
$VSM               = 'VS1'

Import-Module DataOntap

Connect-NcController $ControllerIP -Credential (New-Object System.Management.Automation.PSCredential ($UserName,(ConvertTo-SecureString $Password -AsPlainText -Force)))

# Test for FlexClone
$fctemp = Get-NcVol -Template
Initialize-NcObjectProperty $fctemp VolumeCloneAttributes
Initialize-NcObjectProperty $fctemp.VolumeCloneAttributes VolumeCloneParentAttributes

$fctemp.VolumeCloneAttributes.VolumeCloneParentAttributes.Name = $Volume
$fctemp.Vserver = $VSM
$fctemp.Name = "testfailoverClone*"

if (Get-NcVol -Query $fctemp)
{
	return;
}
else
{
	$Attributes = Get-NcVol -Template
	Initialize-NcObjectProperty $Attributes VolumeQosAttributes

	$Query = Get-NcVol -Template
	$Query.Vserver = $VSM
	$Query.Name = "${Volume}"

	$Attributes.VolumeQosAttributes.PolicyGroupName = "none"
	Update-NcVol -Attributes $Attributes -Query $Query
}

Set QoS Policy Script

I added the Set QoS Policy script as a pre-power on step to my VM in Barcelona.  So now, whenever I failover my Barcelona VM to my New York datacenter, I know that it will not exceed 250 IOPS

Param(
    $ControllerIP      = '192.168.0.101'
,   $UserName          = 'admin'
,   $Password          = 'password'
,   $Volume            = 'bcnds0_dr'
,   $VSM               = 'VS1'
,   $QOSMaxThroughput  = '10IOPS'
)

Import-Module DataOntap

Connect-NcController $ControllerIP -Credential (New-Object System.Management.Automation.PSCredential($UserName,(ConvertTo-SecureString $Password -AsPlainText -Force)))

# Test for FlexClone
$fctemp = Get-NcVol -Template
Initialize-NcObjectProperty $fctemp VolumeCloneAttributes
Initialize-NcObjectProperty $fctemp.VolumeCloneAttributes VolumeCloneParentAttributes

$fctemp.VolumeCloneAttributes.VolumeCloneParentAttributes.Name = $Volume
$fctemp.Vserver = $VSM
$fctemp.Name = "testfailoverClone*"

if (Get-NcVol -Query $fctemp)
{
	return;
}
else
{
	$Attributes = Get-NcVol -Template

	Initialize-NcObjectProperty $Attributes VolumeQosAttributes

	$Query = Get-NcVol -Template
	$Query.Vserver = $VSM
	$Query.Name = "${Volume}"

	if (Get-NcSnapmirror -Destination $Volume  -DestinationVserver $VSM)
	{
		$QOSPolicyGroup = Get-NcQosPolicyGroup -Name "srm_${vsm}" -Vserver $VSM

		if (!$QOSPolicyGroup)
		{
			New-NcQosPolicyGroup -Name "srm_${VSM}" -Vserver $VSM -MaxThroughput $QOSMaxThroughput
		}
		else
		{
			$QOSPolicyGroup | Set-NcQosPolicyGroup -MaxThroughput $QOSMaxThroughput
		}

		$Attributes.VolumeQosAttributes.PolicyGroupName = "srm_${VSM}"

		Update-NcVol -Attributes $Attributes -Query $Query
	}
	else
	{
		$Attributes.VolumeQosAttributes.PolicyGroupName = "none"

		Update-NcVol -Attributes $Attributes -Query $Query
	}
}

As you might imagine this isn’t the only way to apply a QoS policy and it certainly isn’t the only use case for custom script callouts, but it definitely got the gears turning at VMworld this year and made for some good conversation at our booth.   What about you?  Are you using storage QoS?  Have you played with the SRM script callouts feature?  I would love to hear some other use cases.  As always comments are welcome.

Advertisements


No Responses Yet to “NetApp Storage QoS using SRM Script Callouts”

  1. Leave a Comment

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


%d bloggers like this: