<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Datastore_to_LUN_Mapping_%28PowerCLI%29</id>
	<title>Datastore to LUN Mapping (PowerCLI) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Datastore_to_LUN_Mapping_%28PowerCLI%29"/>
	<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Datastore_to_LUN_Mapping_(PowerCLI)&amp;action=history"/>
	<updated>2026-05-09T15:11:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=Datastore_to_LUN_Mapping_(PowerCLI)&amp;diff=1068&amp;oldid=prev</id>
		<title>Sstrutt: typo</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Datastore_to_LUN_Mapping_(PowerCLI)&amp;diff=1068&amp;oldid=prev"/>
		<updated>2010-11-12T09:51:24Z</updated>

		<summary type="html">&lt;p&gt;typo&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:51, 12 November 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l66&quot;&gt;Line 66:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 66:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;soure&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;$objScsiLUN&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;$objScsiLUN&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=Datastore_to_LUN_Mapping_(PowerCLI)&amp;diff=1067&amp;oldid=prev</id>
		<title>Sstrutt: typo</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Datastore_to_LUN_Mapping_(PowerCLI)&amp;diff=1067&amp;oldid=prev"/>
		<updated>2010-11-12T09:51:14Z</updated>

		<summary type="html">&lt;p&gt;typo&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:51, 12 November 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l66&quot;&gt;Line 66:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 66:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/soure&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;$objScsiLUN&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;$objScsiLUN&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=Datastore_to_LUN_Mapping_(PowerCLI)&amp;diff=1066&amp;oldid=prev</id>
		<title>Sstrutt: Initial creation</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Datastore_to_LUN_Mapping_(PowerCLI)&amp;diff=1066&amp;oldid=prev"/>
		<updated>2010-11-12T09:50:44Z</updated>

		<summary type="html">&lt;p&gt;Initial creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;During the running of the script below you come across a number of objects that all have potentially useful information, therefore to make adapting the script easier at a later date I&amp;#039;ve displayed example object displays.&lt;br /&gt;
&lt;br /&gt;
Its also worth checking out the original VMware forum post for further info - http://communities.vmware.com/thread/240466#240466&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;powershell&amp;quot;&amp;gt; &lt;br /&gt;
# Thieved and adapted from the good work by catman...&lt;br /&gt;
# http://communities.vmware.com/thread/240466#240466&lt;br /&gt;
&lt;br /&gt;
$objESX = Get-VMHost &amp;quot;My_ESX*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get .NET views for host and storage system&lt;br /&gt;
$objViewESX = Get-View -id $objESX.id&lt;br /&gt;
$objViewESXstorageSys = Get-View -id $objViewESX.ConfigManager.StorageSystem&lt;br /&gt;
&lt;br /&gt;
# Get FC HBAs&lt;br /&gt;
$HBAs = $objViewESXstorageSys.StorageDeviceInfo.HostBusAdapter | Where-Object {$_.Key -like &amp;quot;*FibreChannelHba*&amp;quot;}&lt;br /&gt;
#$HBAs&lt;br /&gt;
&lt;br /&gt;
foreach ($hba in $HBAs) {&lt;br /&gt;
    # Enumerate LUNs&lt;br /&gt;
    $LUNcount = $objViewESXstorageSys.StorageDeviceInfo.MultiPathInfo.Lun.Length&lt;br /&gt;
    #Write-Host (&amp;quot;Enumerating $LUNcount LUNs on &amp;quot; + $hba.Device)&lt;br /&gt;
    &lt;br /&gt;
    for ($LUNidx = 0; $LUNidx -lt $LUNcount; $LUNidx++ ) {&lt;br /&gt;
        $objScsiLUN = $objViewESXstorageSys.StorageDeviceInfo.MultiPathInfo.Lun[$LUNidx]&lt;br /&gt;
        #$objScsiLUN&lt;br /&gt;
        &lt;br /&gt;
        # Enumerate paths on LUN&lt;br /&gt;
        $PathCount = $objScsiLUN.Path.Length&lt;br /&gt;
        #Write-Host (&amp;quot;Enumerating $PathCount paths on &amp;quot; + $objScsiLUN.Id)&lt;br /&gt;
        &lt;br /&gt;
        for ($PathIdx = 0; $PathIdx -lt $PathCount; $PathIdx++) {&lt;br /&gt;
            $objSCSIpath = $objViewESXstorageSys.StorageDeviceInfo.MultiPathInfo.Lun[$LUNidx].Path[$PathIdx]&lt;br /&gt;
            #Write-Host ($objSCSIpath.Name + &amp;quot; - &amp;quot; + $objSCSIpath.PathState)&lt;br /&gt;
            &lt;br /&gt;
            # Only care about one path, active on current HBA&lt;br /&gt;
            if (($objSCSIpath.PathState -eq &amp;quot;active&amp;quot;) -and ($objSCSIpath.Adapter -eq $hba.Key)) {&lt;br /&gt;
                # Now get the disk that we want&lt;br /&gt;
                $objSCSIdisk = $objViewESXstorageSys.StorageDeviceInfo.ScsiLun | Where-Object{ ($_.CanonicalName -eq $objScsiLUN.Id) -and ($_.DeviceType -eq &amp;quot;disk&amp;quot;) }&lt;br /&gt;
                #$objSCSIdisk&lt;br /&gt;
                &lt;br /&gt;
                # Now get the datastore info for disk&lt;br /&gt;
                $MountCount = $objViewESXstorageSys.FileSystemVolumeInfo.MountInfo.Length&lt;br /&gt;
                #Write-Host (&amp;quot;Enumerating $MountCount mounts on &amp;quot; + $objSCSIdisk.CanonicalName)&lt;br /&gt;
                &lt;br /&gt;
                for ($MountIdx = 0; $MountIdx -lt $MountCount; $MountIdx++ ) {&lt;br /&gt;
                    if ($objViewESXstorageSys.FileSystemVolumeInfo.MountInfo[$MountIdx].Volume.Type -eq &amp;quot;VMFS&amp;quot; ) {&lt;br /&gt;
                        $objVolume = $objViewESXstorageSys.FileSystemVolumeInfo.MountInfo[$MountIdx].Volume&lt;br /&gt;
                        #$objVolume&lt;br /&gt;
                        &lt;br /&gt;
                        $ExtentCount = $objVolume.Extent.Length&lt;br /&gt;
                        #Write-Host (&amp;quot;Enumerating $ExtentCount mounts on &amp;quot; + $objVolume.Name)&lt;br /&gt;
                        &lt;br /&gt;
                        for ($ExtentIdx = 0; $ExtentIdx -lt $ExtentCount; $ExtentIdx++ ) {&lt;br /&gt;
                            $objExtent = $objVolume.Extent[$ExtentIdx]&lt;br /&gt;
                            &lt;br /&gt;
                            # Match extent name to disk name&lt;br /&gt;
                            if ($objExtent.DiskName -eq $objSCSIdisk.CanonicalName) {&lt;br /&gt;
                                Write-Host($objSCSIdisk.Vendor + &amp;quot; &amp;quot; + $objSCSIdisk.Model + &amp;quot; &amp;quot; + $objSCSIdisk.CanonicalName + &amp;quot;`t&amp;quot; + $objVolume.Name)&lt;br /&gt;
                            }&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$objScsiLUN&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Key                    : key-vim.host.MultipathInfo.LogicalUnit-vmhba3:0:13&lt;br /&gt;
Id                     : vmhba3:0:13&lt;br /&gt;
Lun                    : key-vim.host.ScsiDisk-vmhba3:0:13&lt;br /&gt;
Path                   : {vmhba3:0:13, vmhba3:1:13, vmhba4:0:13, vmhba4:1:13}&lt;br /&gt;
Policy                 : VMware.Vim.HostMultipathInfoFixedLogicalUnitPolicy&lt;br /&gt;
StorageArrayTypePolicy :&lt;br /&gt;
DynamicType            :&lt;br /&gt;
DynamicProperty        :&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$objSCSIdisk&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Capacity         : VMware.Vim.HostDiskDimensionsLba&lt;br /&gt;
DevicePath       : /vmfs/devices/disks/vml.02000d0000600508b40006b8e40000d00001280000485356323030&lt;br /&gt;
Key              : key-vim.host.ScsiDisk-vmhba3:0:13&lt;br /&gt;
Uuid             : 02000d0000600508b40006b8e40000d00001280000485356323030&lt;br /&gt;
Descriptor       :&lt;br /&gt;
CanonicalName    : vmhba3:0:13&lt;br /&gt;
DisplayName      :&lt;br /&gt;
LunType          : disk&lt;br /&gt;
Vendor           : HP&lt;br /&gt;
Model            : HSV200&lt;br /&gt;
Revision         : 6110&lt;br /&gt;
ScsiLevel        : 6&lt;br /&gt;
SerialNumber     : unavailable&lt;br /&gt;
DurableName      : VMware.Vim.ScsiLunDurableName&lt;br /&gt;
AlternateName    : {4, 3, 5, 5}&lt;br /&gt;
StandardInquiry  : {0, 0, 5, 18...}&lt;br /&gt;
QueueDepth       :&lt;br /&gt;
OperationalState : {ok}&lt;br /&gt;
Capabilities     :&lt;br /&gt;
VStorageSupport  :&lt;br /&gt;
DeviceName       : /vmfs/devices/disks/vml.02000d0000600508b40006b8e40000d00001280000485356323030&lt;br /&gt;
DeviceType       : disk&lt;br /&gt;
DynamicType      :&lt;br /&gt;
DynamicProperty  :&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$objVolume&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BlockSizeMb      : 1&lt;br /&gt;
MaxBlocks        : 262144&lt;br /&gt;
MajorVersion     : 3&lt;br /&gt;
Version          : 3.31&lt;br /&gt;
Uuid             : 48944e24-b5e93716-aa5c-001cc4466ba8&lt;br /&gt;
Extent           : {vmhba3:0:8}&lt;br /&gt;
VmfsUpgradable   : False&lt;br /&gt;
ForceMountedInfo :&lt;br /&gt;
Type             : VMFS&lt;br /&gt;
Name             : VMFSVol8&lt;br /&gt;
Capacity         : 536602476544&lt;br /&gt;
DynamicType      :&lt;br /&gt;
DynamicProperty  :&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
</feed>