<?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 Re: Scanning for Inaccessible Templates in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981989#M31380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the next PowerCLI command will show you the names of the templates that don't have a hard disk:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-Template | Where-Object {-not ($_ | Get-HardDisk)}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Dec 2013 18:31:58 GMT</pubDate>
    <dc:creator>RvdNieuwendijk</dc:creator>
    <dc:date>2013-12-02T18:31:58Z</dc:date>
    <item>
      <title>Scanning for Inaccessible Templates</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981988#M31379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to come up with a way to use PowerCLI to scan vCenter for templates that have had their disks deleted but not unregistered from vCenter.&amp;nbsp; Templates aren't going to an inaccessible state like a VM would, so its been proving to be a bit of a challenge to detect this condition.&amp;nbsp; Thus far when looking online, I've only seen cleaning up in the opposite direction, like LucD's Spring Cleaning script for deleting orphaned disks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody have any suggestions for a method on detecting when a template is in vCenter, but the disks for it have been deleted?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 18:19:02 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981988#M31379</guid>
      <dc:creator>jason89s</dc:creator>
      <dc:date>2013-12-02T18:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scanning for Inaccessible Templates</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981989#M31380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the next PowerCLI command will show you the names of the templates that don't have a hard disk:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-Template | Where-Object {-not ($_ | Get-HardDisk)}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 18:31:58 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981989#M31380</guid>
      <dc:creator>RvdNieuwendijk</dc:creator>
      <dc:date>2013-12-02T18:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scanning for Inaccessible Templates</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981990#M31381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RvdNieuwendijk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I gave this a try and it looks like its not returning expected results.&amp;nbsp; I switched it up and ran it as &amp;lt;Get-HardDisk -Template "templatename"&amp;gt; for testing on a template that I know has been deleted from the disk and it still returned all of the associated vmdk's.&amp;nbsp; Browsing the datastore confirms that it has been deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 18:56:58 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981990#M31381</guid>
      <dc:creator>jason89s</dc:creator>
      <dc:date>2013-12-02T18:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scanning for Inaccessible Templates</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981991#M31382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect that this method will only work when the harddisk was removed with for example the Remove-Harddisk cmdlet.&lt;/P&gt;&lt;P&gt;When the VMDK file was deleted from the datastore, via for example the datastore browser, you will have to check if the VMDK is still there.&lt;/P&gt;&lt;P&gt;Something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #5f9ea0;"&gt;Get-Template&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;Select&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"HD Present"&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN style="color: #5f9ea0;"&gt;Get-HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5f9ea0;"&gt;-Template&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;$_&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #5f9ea0;"&gt;Get-HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5f9ea0;"&gt;-DatastorePath&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;$_&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8b4513;"&gt;Filename&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5f9ea0;"&gt;-Datastore&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;$_&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8b4513;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8b4513;"&gt;Split&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)[&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8b4513;"&gt;TrimStart&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)}) &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;-ne&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$null&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 19:12:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981991#M31382</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-12-02T19:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scanning for Inaccessible Templates</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981992#M31383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi LucD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method appears to be working correctly, just with the side effect that it is extremely slow to run.&amp;nbsp; It took nearly 9 hours to collect the information from one lightly loaded datacenter (20 templates, 268 VMs).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 15:45:31 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981992#M31383</guid>
      <dc:creator>jason89s</dc:creator>
      <dc:date>2013-12-03T15:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scanning for Inaccessible Templates</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981993#M31384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is indeed very slow :smileycry:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which PowerCLI version are you using, there were some performance improvements in the last builds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We could try to something similar but with the datastore provider, that should be a bit faster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 19:41:21 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981993#M31384</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-12-03T19:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Scanning for Inaccessible Templates</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981994#M31385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm running PowerCLI 5.5 connecting to a vCenter 5.0 server.&amp;nbsp; For a comparison, I can run a slightly modified version of the "VMX Raiders Revisited" script (targeting templates instead) against the same datacenter in about 12 minutes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 20:00:23 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Scanning-for-Inaccessible-Templates/m-p/981994#M31385</guid>
      <dc:creator>jason89s</dc:creator>
      <dc:date>2013-12-03T20:00:23Z</dc:date>
    </item>
  </channel>
</rss>

