3 Replies Latest reply on May 28, 2012 5:03 AM by rjeet

    Not able to pull out LUN information on esx3.5

    rjeet Lurker

      Hi,

       

      i have RDM presented on vm which is hosted on ESX3.5  and  LUN presented from XP1024 array, as disk ID is  bit diffrent from any other array in terms of string length and format, i am not able to figure out exact LUN id information for  RDM disks...

       

      Any help will be appreciated.....

       

      Thanks

      RJ

        • 1. Re: Not able to pull out LUN information on esx3.5
          Hot Shot

          I think you might be posting to the wrong product page.  This is vCenter Infrastructure Navigator which discovers dependencies between VMs on the application layer.  VIN would not be probing for the kind of information you seek.  You probably need to examine the vSphere Client.

          • 2. Re: Not able to pull out LUN information on esx3.5
            Enthusiast

            Hi rjeet

             

            Welcome to the communites

            If you are using power CLI script please run below  .

            Param($VM)

            if (Get-VM $VM) {

            $Disks

            = Get-VM $VM | Get-HardDisk | Where {$_.DiskType -eq

            “RawPhysical”}

            Foreach ($Disk

            in

            $Disks) {

            $Lun

            = Get-SCSILun $Disk.SCSICanonicalName -VMHost (Get-VM $VM).VMHost

            $Lun.RuntimeName.Substring($Lun.RuntimeName.LastIndexof(“L”)+1)

            }

            }

             

             

             

             

             

             

             

             

             

             

            "Before you judge a man, walk a mile in his shoe."http://imagicon.info/cat/5-59/vbsmile.png
            • 3. Re: Not able to pull out LUN information on esx3.5
              rjeet Lurker

              Thank you Juan11, for quick response…

               

              I tried your  script  but  it  poping up with an error …..

               

              I create a function called “RDMDISK”  with your code :

              Function RDMDISK

              {Param($VM)

               

              if (Get-VM $VM) {

              $Disks = Get-VM $VM | Get-HardDisk | Where {$_.DiskType -eq “RawPhysical”}

              Foreach ($Disk

              in

              $Disks) {

              $Lun = Get-SCSILun $Disk.SCSICanonicalName -VMHost (Get-VM $VM).VMHost

              $Lun.RuntimeName.Substring($Lun.RuntimeName.LastIndexof("L")+1)

               

              }

              }

              }

               

               

              And  after executing  it ran command on powershell\PowerCli :

               

              Rdmdisk –vm

              First time : there was no output,  and  when I ran  second time it  gave me  an error :

               

               

              You cannot call a method on a null-valued expression.

              At C:\vmrdm.ps1:10 char:56

              + $Lun.RuntimeName.Substring($Lun.RuntimeName.LastIndexof <<<< ("L")+1)

                  + CategoryInfo          : InvalidOperation: (LastIndexof:String) [], RuntimeException

                  + FullyQualifiedErrorId : InvokeMethodOnNull

               

              could you please suggest me how do I use this script  and  get output, and  how  output  will look like any example ..?  please

               

               

               

               

              Ranjeet Tiwari