<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Accessing VSC information through vmware api/powercli? in VMware Solutions Discussions</title>
    <link>https://community.netapp.com/t5/VMware-Solutions-Discussions/Accessing-VSC-information-through-vmware-api-powercli/m-p/136864#M9140</link>
    <description>&lt;P&gt;Our VDI team is interested in being more cognizent of where datastores live in the cluster so that patching and boot storms don't swamp one node. We have VSC7 appliance deployed which gives all the information they need into the web client by making the aggregate location of a datastore known. This needs to be built into thier automation tools however, which run on .NET and powercli through the vmware APIs. Not having any experience with&amp;nbsp;how vcenter works&amp;nbsp;I'm pretty in the dark here, is there a way to get at the aggregate information VSC provides via powercli?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is specifically what they're looking to locate:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="details.png" style="width: 631px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/7950iEB5B598C042BD4FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="details.png" alt="details.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 14:13:17 GMT</pubDate>
    <dc:creator>tflammger</dc:creator>
    <dc:date>2025-06-04T14:13:17Z</dc:date>
    <item>
      <title>Accessing VSC information through vmware api/powercli?</title>
      <link>https://community.netapp.com/t5/VMware-Solutions-Discussions/Accessing-VSC-information-through-vmware-api-powercli/m-p/136864#M9140</link>
      <description>&lt;P&gt;Our VDI team is interested in being more cognizent of where datastores live in the cluster so that patching and boot storms don't swamp one node. We have VSC7 appliance deployed which gives all the information they need into the web client by making the aggregate location of a datastore known. This needs to be built into thier automation tools however, which run on .NET and powercli through the vmware APIs. Not having any experience with&amp;nbsp;how vcenter works&amp;nbsp;I'm pretty in the dark here, is there a way to get at the aggregate information VSC provides via powercli?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is specifically what they're looking to locate:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="details.png" style="width: 631px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/7950iEB5B598C042BD4FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="details.png" alt="details.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 14:13:17 GMT</pubDate>
      <guid>https://community.netapp.com/t5/VMware-Solutions-Discussions/Accessing-VSC-information-through-vmware-api-powercli/m-p/136864#M9140</guid>
      <dc:creator>tflammger</dc:creator>
      <dc:date>2025-06-04T14:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing VSC information through vmware api/powercli?</title>
      <link>https://community.netapp.com/t5/VMware-Solutions-Discussions/Accessing-VSC-information-through-vmware-api-powercli/m-p/136868#M9141</link>
      <description>&lt;P&gt;Is using the NetApp PowerShell Toolkit an option?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would be very simple to map the VMware datastore NFS mount to the ONTAP SVM LIF + junction path to get the volume (and aggr) info.&amp;nbsp; For block based datastores, it's not much more difficult...use the &lt;A href="https://kb.netapp.com/app/answers/answer_view/a_id/1033595" target="_self"&gt;LUN's naa ID to reverse engineer the ONTAP LUN serial number&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$naluns = Get-NcLun
$ds = Get-Datastore | ?{ $_.Type -eq "VMFS" }

$ds | %{
    Write-Host "Finding LUNs for datastore $($_.Name)" 
    $luns = $_ | Get-ScsiLun | ?{ $_.CanonicalName -match "naa.600a0980*" }

    if ($luns.length -gt 0) {
        Write-Host "    Found $($luns.length) paths"
        $completed = @()

        $luns | %{ 
            if (!$completed.Contains($_.CanonicalName)) {
                $hexSerial = ($_.CanonicalName).Substring(12)
                $serial = for ($i = 0; $i -lt $hexSerial.length; $i += 2) {
                    [char][int]::Parse($hexSerial.substring($i,2), 'HexNumber')
                }

                $ntapSerial = $serial -join ""
                Write-Host "  NetApp LUN serial is: $($ntapSerial)"

                $ntapLun = $naluns | ?{ $_.SerialNumber -eq $ntapSerial }
                Write-Host "    NetApp SVM: $($ntapLun.Vserver)"
                Write-Host "    LUN Path: $($ntapLun.Path)"
                $completed += $_.CanonicalName
            }
        }
    }
}&lt;/PRE&gt;&lt;P&gt;Note that I think ONTAP has two or three different naa IDs, so you'd want to include all of them in the expression above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 19:37:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/VMware-Solutions-Discussions/Accessing-VSC-information-through-vmware-api-powercli/m-p/136868#M9141</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2017-12-20T19:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing VSC information through vmware api/powercli?</title>
      <link>https://community.netapp.com/t5/VMware-Solutions-Discussions/Accessing-VSC-information-through-vmware-api-powercli/m-p/136871#M9142</link>
      <description>&lt;P&gt;Thanks for the suggestion (thankfully our vmware environment is all NFS so no LUN ID monkeybusiness required). &amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll have to run it by the developers, see how complicatd it makes things adding another API to their workspace.&lt;/P&gt;&lt;P&gt;No way to do this with native vmware commands though?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 23:00:13 GMT</pubDate>
      <guid>https://community.netapp.com/t5/VMware-Solutions-Discussions/Accessing-VSC-information-through-vmware-api-powercli/m-p/136871#M9142</guid>
      <dc:creator>tflammger</dc:creator>
      <dc:date>2017-12-20T23:00:13Z</dc:date>
    </item>
  </channel>
</rss>

