Automation

 View Only
  • 1.  get lunID of a RDM Disk

    Posted Jan 05, 2012 12:22 PM

    hi everyone,

    i'm now using this one to list the RDM's

    $report = @()
    $vms = Get-VM | Get-View
    foreach($vm in $vms){
      foreach($dev in $vm.Config.Hardware.Device){
        if(($dev.gettype()).Name -eq "VirtualDisk"){
           if($dev.Backing.CompatibilityMode -eq "physicalMode"){
             $row = "" | select VMName, HDDeviceName, HDFileName
              $row.VMName = $vm.Name
             $row.HDDeviceName = $dev.Backing.DeviceName
             $row.HDFileName = $dev.Backing.FileName
             $report += $row
           }
         }
      }
    }
    $report | Export-Csv c:\rdm.csv

    this lists the RDM devices "ClusterName","LunName","LunUuid","Lunsize","VolumeName"  but but what i really need is the mapping id of the lun given from the shared storage device (NetApp) which i can see in the hba devices paths in vsphere. and after that i want to add the RDM disk with the particular Lun ID to a Vm.

    This is very important for me so i appreciate any help on this.

    Thanks Alot.



  • 2.  RE: get lunID of a RDM Disk

    Posted Jan 05, 2012 12:48 PM


  • 3.  RE: get lunID of a RDM Disk

    Posted Jan 05, 2012 01:56 PM

    Thanks André,

    this really will help me,

    the script in the link gives me a lunID of the RDM disk which is already mapped to a Vm, i'm trying to manipulate it to a shape where i can list all the RDM LunID's of the luns connected to vsphere whether it's connected to a Vm or not. and i'm not succesfull as of now:((

    i'm still trying to learn vspherecli and powershell same time.

    i can still ask for assistance if you don't mind:)

    Best.

    Tolga



  • 4.  RE: get lunID of a RDM Disk

    Posted Jan 05, 2012 01:11 PM

    You could try the script from my yadr – A vdisk reporter post