Archive

Posts Tagged ‘netapp’

SRM for free with PowerCLI & DataONTAP– Part 2: iSCSI

September 14th, 2011 2 comments

My updated previous NFS post talked about implementing part of the functionality of SRM in Powershell using PowerCLI and NetApp’s DataONTAP for NFS datastores.

This post is an update to my previous iSCSI post in which I had only looked at the VMware side of the automation and so it’s time for an update to include the important part of handling the underlying storage. I’m going to use NetApp storage as an example but any storage vendor that exposes their API to Powershell can be used if you can find the relevant commands.

You will obviously need both PowerCLI and Netapp’s DataONTAP installed. See my previous post: Pimping your Powershell Profile for getting everything installed.

For the storage automation, all you really have to do is connect to the filer and then quiesce and break the storage mirror so it is writeable at the BR site. After you’ve connected this is a single line:

Get-NaSnapmirror "FilerName" | Invoke-NaSnapmirrorQuiesce | Invoke-NaSnapmirrorBreak -Confirm:$false

Read more…

SRM for free with PowerCLI & DataONTAP– Part 1: NFS

August 16th, 2011 1 comment

I’ve blogged before on how you can use PowerCLI to replicate some of the functionality of VMware’s SRM to easily recover VMs in a business recovery site with replicated storage.

In my previous post I had only looked at the VMware side of the automation and so it’s time for an update to include the important part of handling the underlying storage. I’m going to use NetApp storage as an example but any storage vendor that exposes their API to Powershell can be used if you can find the relevant commands.

This is where the awesomeness of Powershell really comes into its own when you can combine automation for both VMware and NetApp in a single script.

You will obviously need both PowerCLI and Netapp’s DataONTAP installed. See my previous post: Pimping your Powershell Profile for getting everything installed.

Read more…

NetApp PowerShell Toolkit, DataONTAP 1.5 released

August 4th, 2011 No comments

NetApp has updated it’s Powershell Toolkit which it calls DataONTAP to version 1.5 (I think PowerONTAP would be a much better name!).

You will need a Netapp NOW account which is available to customers and partners to download the toolkit.
http://communities.netapp.com/community/interfaces_and_tools/data_ontap_powershell_toolkit

There are 27 new cmdlets taking the total up to a massive 528 cmdlets with nearly all possible API’s now covered.

Read more…

NetApp DataONTAP 1.3 released

February 8th, 2011 No comments

NetApp’s Powershell Toolkit has been updated to 1.3.
http://communities.netapp.com/community/interfaces_and_tools/data_ontap_powershell_toolkit/data_ontap_powershell_toolkit_downloads?view=overview

Highlights are:

  • Create a PSDrive and access the ONTAP file system as if it was a local disk
  • Using a Credential Cache
  • Being able to invoke SSH directly from within DataOntap so you can run any CLI command as the API doesn’t cover everything
  • More -WhatIf parameter usage

You can get more information from Making The Most Of Data ONTAP PowerShell Toolkit 1.3

Microsoft has created a fantastic administration environment with Powershell, the more companies that create PowerShell modules the better so good work NetApp, looking forward to some more!

Categories: NetApp, Powershell Tags: ,

Disk timeout settings in registry for VMs using PowerCLI

September 1st, 2010 3 comments

One of NetApp’s best practices is to increase the disk timeout settings for VMs to 190 seconds so VMs don’t blue screen if they temporary lose connectivity to their disks say during a cluster failover.

This is done by amending the Disk Timeout registry value:
HKLM\SYSTEM\CurrentControlSet\Services\Disk\TimeoutValue to DWord 190.

I’m sure you’d love to go through all your VMs and load regedit manually so why not grab a list of VMs using PowerCLI and set the registry value.

The VMs will obviously need to be powered on and you will need permissions to be able to write to the registry.

The procedure is a 2 step process:

The first is to get all the VMs you want to change.
You can use any Get-VM statement you want:

All VMs in a particular Resource Pool

$VMs = Get-VM -Location (Get-ResourcePool "Resource_Pool_Prod") | Where { $_.PowerState -eq "PoweredOn" }

or

$VMs = Get-ResourcePool "Resource_Pool_Prod" | Get-VM | Where { $_.PowerState -eq "PoweredOn" }

All VMs in a particular Cluster

$VMs = Get-Cluster "LON_PROD1" | Get-VM | Where { $_.PowerState -eq "PoweredOn" }

All VM names starting with WEBSERVER

$VMs = Get-VM "WEBSERVER*" | Where { $_.PowerState -eq "PoweredOn" }

The second stage is to work some registry magic for the VMs you have.

You can then read the current registry value:

ForEach ($VM in $VMs) {
	$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $VM.Guest.Hostname)
	Write-Host "Registry Value for: "$VM.Guest.Hostname ": " $reg.OpenSubKey("SYSTEM\CurrentControlSet\Services\Disk\").GetValue("TimeoutValue")
}

To write the registry value:

ForEach ($VM in $VMs) {
	Write-Host "Setting Registry Value for: "$VM.Guest.Hostname
	$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $VM.Guest.Hostname)
	$regKey= $reg.OpenSubKey("SYSTEM\CurrentControlSet\Services\Disk",$true)
	$regkey.SetValue('TimeoutValue',200,'DWord')
}

Or you can combine a read, set and verify.

ForEach ($VM in $VMs) {
	$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $VM.Guest.Hostname)
	Write-Host "Registry Value Before: "$VM.Guest.HostName "-" $reg.OpenSubKey("SYSTEM\CurrentControlSet\Services\Disk\").GetValue("TimeoutValue")

	$regKey= $reg.OpenSubKey("SYSTEM\CurrentControlSet\Services\Disk",$true)
	$regkey.SetValue('TimeoutValue',190,'DWord')

	Write-Host "Registry Value After:  "$VM.Guest.HostName "-" $reg.OpenSubKey("SYSTEM\CurrentControlSet\Services\Disk\").GetValue("TimeoutValue")
}

or be bold and set it in a one liner:

Get-VM "WEBSERVER*" | Where { $_.PowerState -eq "PoweredOn" } | %{[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $_.Guest.Hostname).OpenSubKey("SYSTEM\CurrentControlSet\Services\Disk",$true).SetValue('TimeoutValue',190,'DWord')}

Powershell…you gotta love it!

SRM for free with PowerCLI – Part 2: iSCSI

August 3rd, 2010 No comments

My previous post talked about the design of BR and how to script a simple and scalable recovery process for getting as many VMs as you need from a primary site to a BR site when using NFS storage.

When using iSCSI storage it is slightly more complicated as you can’t use one of the benefits of NFS in presenting a read only datastore to ESX hosts in your BR site and having your VMs in the inventory and ready to just power on.

The manual steps would be:

Break the storage mirror.
Rescan the storage on the ESX hosts in the recovery site to pick up the now-visible LUN.
Browse the LUN for all .vmx files and add them into the inventory
Power on the VMs and answer the UUID question that they have moved.

Thanks LucD who has two great versions of a function for importing .VMX files, much better than the old community extension method.
http://communities.vmware.com/message/1317271#1317271
http://communities.vmware.com/message/1270822#1270822

The function is very powerful so it’s worth keeping as a link for using elsewhere.

Read more…

SRM for free with PowerCLI – Part 1: NFS

August 3rd, 2010 No comments

Also see SRM for free with PowerCLI – Part 2: iSCSI

Working in an enterprise company DR, BR, BCP, whatever you want to call it, is everything.  With potentially many thousands of people around the globe, being able to get people working again as soon as possible after a disaster can mean the difference between being in business and going bust.

The best way to do business recovery is to design it from the ground up and make it part of every architecture design you put together.  Thinking about the what-if of a disaster after everything is up and running often means you have to start again.

One of the great things about virtual worlds is you can easily (not necessarily cheaply though!) have a separate virtual infrastructure in both locations with shared storage. Simply by mirroring the storage from Site A to Site B you can recover VMs from Site A in Site B very easily without having to have a separate VM in Site B that you need to keep up to date.

This is where VMware’s SRM comes into play.  SRM is a fairly powerful piece of software for running and testing your BR.  It talks to your back-end storage and can automate the different steps required such as breaking the storage mirror, presenting the storage to your ESX hosts, adding the VMs to your inventory and powering them on.

Sounds great but firstly it is a product you need to pay for and secondly when it came out it didn’t support NFS so PowerCLI (it wasn’t called PowerCLI when we did it) came to the rescue.

Read more…

Categories: PowerCLI, Powershell Tags: , , ,