VMware vSphere

 View Only
  • 1.  ESXCLI Command to List 'Not Consumed' Devices

    Posted Feb 04, 2022 04:06 PM

    Can anyone help with an esxcli command to list 'not consumed' devices by Device ID (.naa*), LUN and Capacity?

    If I can even get a partial, then I can manually get the rest from the GUI.  



  • 2.  RE: ESXCLI Command to List 'Not Consumed' Devices

    Posted Feb 04, 2022 08:49 PM

    I’ve reported your thread so moderators know it should be moved to the correct area for ESXi.

     



  • 3.  RE: ESXCLI Command to List 'Not Consumed' Devices

    Posted Feb 08, 2022 09:05 AM

    I tried this this but couldn't make it work:

    $AllDisks = get-vmhost | Get-ScsiLun | select CanonicalName | where {$_.CanonicalName -like "naa.*"}

    $DataStoreDisks = Get-Datastore | select @{N='DiskName'; E={$_.ExtensionData.Info.VMFS.extent.diskname}} | where {$_.DiskName -like "naa.*"}

    $NotConsumed = $AllDisks | Where-Object { $_ -notin $DataStoreDisks }

    The -notin comparison operator does not work for some reason.

     

    I found this though which looks like it might get you close to what you want:

    PowerCLI Script that outputs a list of all LUN paths for all ESXi hosts · GitHub

    This produces output like:

    1 host(s) needs to be processed. Please wait...

    Hostname  Datastore    CanonicalName                        # of Paths Path State
    --------  ---------    -------------                        ---------- ----------
    10.0.1.22 MY_LUN_NR_01 naa.1234a5678901b2000000000000000003          2 {Active, Active}
    10.0.1.22              naa.1234a5678901b2000000000000000005          2 {Active, Active}
    10.0.1.22              naa.1234a5678901b2000000000000000021          2 {Active, Active}
    10.0.1.22              mpx.vmhba32:C0:T0:L0                          1 Active
    10.0.1.22              naa.1234a5678901b701000000000000010d          2 {Active, Active}
    10.0.1.22              naa.1234a5678901b701000000000000010e          2 {Active, Active}
    10.0.1.22              naa.1234a5678901b2010000000000000013          2 {Active, Active}
    10.0.1.22 MY_LUN_NR_02 naa.1234a5678901b7000000000000000508          2 {Active, Active}
    10.0.1.22              naa.1234a5678901b2010000000000000014          2 {Active, Active}
    10.0.1.22 MY_LUN       naa.1234a5678901b70000000000000004ac          4 {Active, Active, Active, Active}

     

    In this example all entries without a Datastore name are "not consumed".