<?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 Clear VSAN partitions with PowerCLI in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968326#M111937</link>
    <description>&lt;P&gt;Common task for R&amp;amp;D Lab. I have moderately large VSAN cluster with large number of disks previously participated in VSAN.&lt;BR /&gt;vCenter task "Erase all partitions" fails&lt;BR /&gt;The only way to clean is to ssh to all ESXi hosts and "esxcli vsan strorage remove"&lt;BR /&gt;&lt;BR /&gt;Current status: I can get all GroupUUID by host and generate .sh files for each host with corresponding&amp;nbsp;"esxcli vsan storage remove --uuid 521a2882-0d7f-ef06-a117-d436718c6248"&lt;BR /&gt;&lt;BR /&gt;It makes life easier, but still a lot of manual work for 10+ hosts cluster.&lt;BR /&gt;&lt;BR /&gt;Get-ESXCli provides vsan.storage abstraction with remove method, but with unclear documentation and no examples.&lt;/P&gt;&lt;P&gt;Please point me to right direction - how can I clear VSAN partitions 100% automated?&lt;/P&gt;</description>
    <pubDate>Sat, 13 May 2023 18:31:25 GMT</pubDate>
    <dc:creator>AntonVZhbankov</dc:creator>
    <dc:date>2023-05-13T18:31:25Z</dc:date>
    <item>
      <title>Clear VSAN partitions with PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968326#M111937</link>
      <description>&lt;P&gt;Common task for R&amp;amp;D Lab. I have moderately large VSAN cluster with large number of disks previously participated in VSAN.&lt;BR /&gt;vCenter task "Erase all partitions" fails&lt;BR /&gt;The only way to clean is to ssh to all ESXi hosts and "esxcli vsan strorage remove"&lt;BR /&gt;&lt;BR /&gt;Current status: I can get all GroupUUID by host and generate .sh files for each host with corresponding&amp;nbsp;"esxcli vsan storage remove --uuid 521a2882-0d7f-ef06-a117-d436718c6248"&lt;BR /&gt;&lt;BR /&gt;It makes life easier, but still a lot of manual work for 10+ hosts cluster.&lt;BR /&gt;&lt;BR /&gt;Get-ESXCli provides vsan.storage abstraction with remove method, but with unclear documentation and no examples.&lt;/P&gt;&lt;P&gt;Please point me to right direction - how can I clear VSAN partitions 100% automated?&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2023 18:31:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968326#M111937</guid>
      <dc:creator>AntonVZhbankov</dc:creator>
      <dc:date>2023-05-13T18:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Clear VSAN partitions with PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968331#M111938</link>
      <description>&lt;P&gt;When you use the V2 switch, help is available&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;$esxcli = Get-EsxCli -VMHost &amp;lt;MyEsx&amp;gt; -V2
$esxcli.vsan.storage.remove.Help()&lt;/LI-CODE&gt;
&lt;P&gt;You can create the hash table, fill in the required parameter, and then Invoke the method.&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;$remVSAN = $esxcli.vsan.storage.remove.CreateArgs()
$remVSAN['uuid'] = &amp;lt;a groupUuid&amp;gt;
$esxcli.vsan.storage.remove.Invoke($remVSAN)&lt;/LI-CODE&gt;
&lt;P&gt;You can loop over all ESXi nodes and then all UUIDs&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2023 19:20:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968331#M111938</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-05-13T19:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Clear VSAN partitions with PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968351#M111939</link>
      <description>&lt;P&gt;Great help, may thanks.&lt;BR /&gt;&lt;BR /&gt;Working code for reference:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;foreach ($vmhost in $vmhosts) {
  $esxcli = Get-EsxCli -VMHost $vmhost -V2

  [String[]]$diskGroups = @()

  $diskgroups += $esxcli.vsan.storage.list.Invoke() | findstr "pUUID"
  [String[]]$uniqueDiskGroups = $diskGroups | Sort-Object -Unique

  Write-Host 'Processing host' $vmhost.Name
  Write-Host ' - Disk groups found '

  $uniqueDiskGroups

  Write-Host ' -'

  foreach ($groupUUID in $uniqueDiskGroups) {
    $UUID = $groupUUID.Substring(31, 36)
    Write-Host 'Removing '$UUID
    $remVSAN = $esxcli.vsan.storage.remove.CreateArgs.Invoke()
    $remVSAN.uuid = $UUID;
    $esxcli.vsan.storage.remove.Invoke($remVSAN)
  }

  Write-Host ' -'
  Write-Host ' '
}&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 14 May 2023 01:34:00 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968351#M111939</guid>
      <dc:creator>AntonVZhbankov</dc:creator>
      <dc:date>2023-05-14T01:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Clear VSAN partitions with PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968365#M111940</link>
      <description>&lt;P&gt;I think you have a typo in 1 line.&lt;BR /&gt;This&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;$remVSAN = $esxcli.vsan.storage.remove.CreateArgs.Invoke()&lt;/LI-CODE&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;$remVSAN = $esxcli.vsan.storage.remove.CreateArgs()&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 14 May 2023 05:01:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968365#M111940</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-05-14T05:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Clear VSAN partitions with PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968366#M111941</link>
      <description>&lt;P&gt;Well, it worked with .Invoke()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 05:05:34 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968366#M111941</guid>
      <dc:creator>AntonVZhbankov</dc:creator>
      <dc:date>2023-05-14T05:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Clear VSAN partitions with PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968368#M111943</link>
      <description>&lt;P&gt;Strange, that seems to work indeed.&lt;BR /&gt;One learns something new every day&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://communities.vmware.com/html/@677206E94727C39F3BB2721E5A55F2C1/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 05:12:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Clear-VSAN-partitions-with-PowerCLI/m-p/2968368#M111943</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-05-14T05:12:17Z</dc:date>
    </item>
  </channel>
</rss>

