VMware Cloud Community
Paulk99
Enthusiast
Enthusiast

Scripted delete of vSAN Partitions

Hi All (also posted in vSAN forum)

Just working up a full vSAN lab to replicate our clients deployment here. Its a stretched cluster, with multiple hosts.

We have 2 PowerShell scripts one which deploys vCenter then vSAN (on pre built ESXi Hosts).

One which removes vSAN all VMs and then destroys vCenter while not totally finished these scripts are so far working well.

.

However whenever we run the "Destroy vSAN Script" it leaves the vSAN partitions behind and I also believe the partitions on the caching disks, Meaning without going in and removing that partition we cannot re-run our "vSAN Deploy" script, where it bitches about not enough capacity.

.

Is there some PowerShell code that can loop through all ESXi hosts and delete the vSAN partition then if required also clear down the vSAN caching disks. [Ideally without using POSH or PLINK but from what I've read so far looks like its a requirement]

Kr

P     

0 Kudos
2 Replies
LucD
Leadership
Leadership

Depending on the order in which you execute the removal, you can use esxcli via the Get-EsxCli cmdlet.
See the section Removing Disk Groups from Hosts no longer in a vSAN Cluster on page 70 in the POWERCLI COOKBOOK FOR VMWARE VSAN


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Paulk99
Enthusiast
Enthusiast

Cheers Luc..

That's a bag of spanners.. Looks like a few have tried similar.

We have got to the point of manually removing the partitions but the install still dumps. Following an ESXi re-install it goes straight through.

Will keep this one on the back burner for now, May potentially look in to a Host restore from a base build  ..???

P

0 Kudos