Last active
October 19, 2017 14:33
-
-
Save Zsoldier/bebbde3d3d2c90046d8fea93eb785388 to your computer and use it in GitHub Desktop.
Delete a vSAN Disk Group Forcefully
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
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