VMware Cloud Community
steve31783
Enthusiast
Enthusiast

Detach naa device from cluster

I would like to use the functions here:

http://www.lucd.info/2011/11/25/lun-juggling-in-vsphere-5/

to detach a device (in the form of it's naa. name) from every host in a given specificed cluster.

Can someone help me put this together? or lead me in the right direction?

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

You can use a ForEach loop.

Something like this

$lun = "naa.123..."

Get-Cluster -Name MyCluster | Get-VMHost | %{

     Detach-Disk -VMHost $_ -CanonicalName $lun

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
steve31783
Enthusiast
Enthusiast

Thank you!

Reply
0 Kudos