2 Replies Latest reply on Nov 17, 2010 2:16 PM by Zsoldier

    Where Filter Not Working for Get-ScsiLun Vendor or Model Attributes

    SuperSpike Enthusiast

       

      I have a cluster that is using storage from different storage arrays. These arrays cause me to use different multipath policies. I am trying to write a PowerCLI script to filter all LUNs that are (for example) on an HP array, and then set the policy that I choose.

       

       

      I use the where clause to successfully filter different attributes of Get-ScsiLun, such as:

       

       

      Get-ScsiLun -vmhost myhost.mydomain.local -LunType disk | select * | where {$_.multipathpolicy -eq "MostRecentlyUsed"}

       

       

      That filter works fine and spits out LUNs that are using the MRU policy.

       

       

      However, when I try to use where to filter the vendor, I don't get any results at all.

       

       

      Example:

       

       

      Get-ScsiLun -vmhost myhost.mydomain.local -LunType disk | select * | where {$_.Vendor -eq "HP"}

       

       

      Perhaps -eq is too restrictive, so I try it with -like:

       

       

      Get-ScsiLun -vmhost myhost.mydomain.local -LunType disk | select * | where {$_.Vendor -like "HP"}

       

       

      No dice. No output at all.

       

       

       

       

       

      As you can probably tell, I want to find all LUNs on my HP array and then set a policy specifically for those LUNs. I could go ahead and put all of the canonicalnames into a file and loop through that, but that's way too much work. Am I going about this the wrong way?