Part 23 – Reuse vSAN disks for new vSAN Cluster

This walkthrough covers the process of removing the vSAN partitions from a host should that host need to be reused for rebuilding the new vSAN cluster or redeploying it for vCF . Unless the old partitions are removed, the host cant be repurposed for vCF vSAN deployments.

In a vSAN-enabled host, disks used by vSAN have specific partitions, like vSAN metadata. If you need to remove a disk group or completely reclaim the disks for another purpose, you need to clean up these partitions.

Here’s how you do it step by step:

  1. Put the host into maintenance mode: This is always the first step when making changes to a vSAN host. Log into your vCenter, right-click the host, and select ‘Enter Maintenance Mode’. Make sure to choose the right data evacuation option, depending on whether you want to migrate the data or not.
  2. Remove disk groups: Next, go to the vSAN cluster settings, select ‘Disk Management’, and identify the host. You’ll see its disk groups listed there. Simply select the disk group and click ‘Remove’. This process clears vSAN configurations from the disks.
  3. Verify partition removal: Now, the partitions should be gone, but to be sure, SSH into the ESXi host. Use the command esxcli vsan storage list to confirm there are no vSAN disk groups or devices left.
  4. Manually clean disks if needed: If the vSAN partitions are still visible for some reason, you’ll need to clean them manually. Use the command:

As part of the decommission process, put the host in maintenance mode

Under the evacuation option, choose full data migration

Complete the precheck to check if there are any issues prior to eviction

Host enters in decom state

Click the Configure tab >Under Storage, click Storage Devices >Select one or more devices and click the Erase Partitions icon. This shows the current partitions and also gives you the option to format them but does not work most of the times but when I tried it today we had the below error so unless this is sorted we wont be able to reuse the host.

Remove the host out of the cluster

When you login to to the SSH, at times you can see the current partitions still being listed so this looks like the cleanup hasn’t happened.

esxcli vsan storage list | grep -i “vSAN Disk Group UUID”

Now, note down the VSAN Disk Group UUID details and use it in the below command.

esxcli vsan storage remove – u <VSAN Disk Group UUID>

Run the command and get the VSAN UUID from one of them.

 esxcli vsan storage remove -s 52a3939d-4928-5a06-6a0d-9a690dcde2ed

In this example, there is nothing displayed so should be okay to repurpose this host back to vCF or vSAN deployment but if you are getting an output here, run the command below to remove the host from the cluster and reclaim all the disks. In my example, the host is not part of a vSAN cluster

[root@vcf206:~] esxcli vsan cluster get
Cluster Information
   Enabled: true
   Current Local Time: 2024-12-21T12:58:23Z
   Local Node UUID: 670520e6-a089-cf62-2590-005056a3febb
   Local Node Type: NORMAL
   Local Node State: MASTER
   Local Node Health State: HEALTHY
   Sub-Cluster Master UUID: 670520e6-a089-cf62-2590-005056a3febb
   Sub-Cluster Backup UUID:
   Sub-Cluster UUID: 523d985d-fffc-c10f-02fc-2c5dbfc7dc11
   Sub-Cluster Membership Entry Revision: 0
   Sub-Cluster Member Count: 1
   Sub-Cluster Member UUIDs: 670520e6-a089-cf62-2590-005056a3febb
   Sub-Cluster Member HostNames: vcf-esx302.ash.local
   Sub-Cluster Membership UUID: 88b86667-1a8e-e03f-79ed-005056a3febb
   Unicast Mode Enabled: true
   Maintenance Mode State: OFF
   Config Generation: 0aab8248-721a-4ee0-ba5a-190032890af4 5 2024-12-21T12:43:17.397
   Mode: REGULAR
   vSAN ESA Enabled: true

root@vcf-esx302:~] esxcli vsan cluster leave
[root@vcf-esx302:~]

To resolve this issue of partitions still being left behind, we will use the partedUtil to wipe any data off the disk. Run the command to display all partitions and disks on the ESXI host.

 ls -lthr /vmfs/devices/disks

Find the disk device names, then run:

partedUtil getptbl  /dev/disks/naa.5xxxxxxxx

Delete this partition with the command : partedUtil delete “dev/disks/DeviceName” PartitionNumber

Final state

esxcli vsan storage list

[root@vcf205:~] vdq -iqH
[
]

This deletes the disk group and all the disks under that will be released back. Once the vSAN partitions are removed, the disks are ready to be repurposed. You can add them to another storage pool or use them as standalone storage.



(Visited 36 times, 1 visits today)

By Ash Thomas

Ash Thomas is a seasoned IT professional with extensive experience as a technical expert, complemented by a keen interest in blockchain technology.