International Man of Awesome's Blog – When Too Much Awesome Isn't Enough

November 5, 2010

vSphere PowerCLI multipath policy script examples

Filed under: ESX, iSCSI, Storage, Virtualisation, VMware — internationalmanofawesome @ 4:43 pm

Since PowerCLI is the way to go with VMware ESXi, I’ve needed to do some investigation of changing my config script to PowerCLI. Here are some examples of setting multipath policies for iSCSI storage.

 

#Shows the multipath policy for all LUN’s connected to all hosts in Cluster CL01

Get-Cluster CL01 | Get-VMHost | Get-ScsiLun -LunType disk

 

#Shows the multipath policy for all LUN’s connected to host host4

Get-VMHost host4 | Get-ScsiLun -LunType disk

 

#Sets the multipath policy for all HDS LUN’s connected to all hosts in Cluster CL01 to roundrobin

Get-Cluster CL01 | Get-VMHost | Get-ScsiLun -CanonicalName “naa.600*” | Set-ScsiLun -MultipathPolicy “roundrobin”

 

#Sets the multipath policy for all EMC LUN’s connected to host host4

Get-VMHost host4 | Get-ScsiLun -CanonicalName “naa.600*” | Set-ScsiLun -MultipathPolicy “roundrobin”

 

# Output the CanonicalName for all the devices on Cluster Primary that are HDS  type (naa.600*)

Get-Cluster Primary | Get-VMHost | Get-ScsiLun -CanonicalName “naa.600*” | fl -show CanonicalName | out-file c:\shared\naa-id.txt

 

Awesome.. But I can’t take the credit. I mangled these from here, http://runningvm.wordpress.com/2010/08/31/vsphere-powercli-multipath-policy-script-examples/

Advertisements

1 Comment »

  1. Hi there,

    you might want to check your code as naa.600* would nearly always cover any type of storage, refer this post:

    http://runningvm.wordpress.com/2011/01/06/vmware-storage-canonical-name-or-device-identifiers/

    Comment by runningvm — May 14, 2011 @ 9:31 pm


RSS feed for comments on this post. TrackBack URI

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

Create a free website or blog at WordPress.com.

%d bloggers like this: