Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Delete a vSAN Disk Group Forcefully
<#
Author: K. Chris Nakagaki
Source: tech.zsoldier.com
Use at your own risk, simply listed here for demonstration purposes to use how you see fit.
#>
<# Get the host w/ problem disk group #>
$VMhost = Get-VMHost NameofHostwithProblemDiskGroup
<# ESXCLI Connection #>
$VMHostCLI = $VMHost | Get-ESXCLI -V2
<# Find your problem disk group UUID, in this case I'm looking for a disk group that doesn't exist (blank) #>
$BadDisks = $VMHostcli.vsan.storage.list.invoke() | Where-Object {$_.vsandiskgroupname -eq ""}
<# Your capacity disks should all have the same vSAN Disk Group UUID, we're just confirming it here. #>
$BadDiskGroup = $BadDisks | Select-Object -Unique -Property vsandiskgroupuuid
<# This should return only one assuming you only have one bad disk group, if more than one, then you might have more issues. #>
$BadDiskGroup
<# Below is destructive, only do it if you are ABSOLUTELY sure of what you are doing #>
$vmhostcli.vsan.storage.remove.invoke(@{"uuid"=$BadDiskGroup})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.