How to cleanup disk previously used by vSAN 6.x

In the VCSA Web Client, there is a function called Erase partitions under Storage Devices, that allows you to erase and remove all partitions on the local hard disk(s). However, sometimes when you try to erase partitions, you are presented with the error “Cannot change the host configuration“, and the partitions are not removed. One of the options was to boot up the server using gParted utility and erase partitions. However, this can be done using partedUtil utility on the ESXi host.

Connect to ESXi host using SSH and list your local disks

# esxcli storage core device list | grep Local

Now we can start to remove partition using partedUtil utility

# partedUtil setptbl /vmfs/devices/disks/naa.500XXXXXXXXXXXXX:1 msdos

You should receive the following output:

msdos
0 0 0 0

Wait for a couple of minutes and then remove the second partition using the same command

# partedUtil setptbl /vmfs/devices/disks/naa.500XXXXXXXXXXXXX:2 msdos

Wait again for a couple of minutes and then clean the entire disk

# partedUtil setptbl /vmfs/devices/disks/naa.500XXXXXXXXXXXXX msdos

Should you fail to wait you will be presented with the following error: “Error: Read-only file system during write on /dev/disks/naa.500xxxxxxx – WriteNewPtable : Unable to commit to disk“. Solution: Wait and try again.

3 Replies to “How to cleanup disk previously used by vSAN 6.x”

  1. What about using esxcli vsan storage remove?
    Putty into the appropriate ESXi host and list the vsan storage.
    # esxcli vsan storage list
    Displays a bunch of vsan info but it shows each disk (VSAN UUID:)and the associated (VSAN Disk Group UUID:) the disk is in. You will need to record these number for use with the “remove” command. You can remove each disk individually or remove the entire disk group with one command. It’s fast and no extra tools required.

    # esxcli vsan storage remove -u [VSAN UUID]
    # esxcli vsan storage remove -u [VSAN Disk Group UUID]

    There’s no turning back on this .. “measure twice cut once”

  2. Your instructions were spot on but after running them then trying to install the Vcenter Server Virtual Appliance installer (Phase 1) I got stuck at 9% with the following:

    2018-10-11T23:42:26.143Z – error: Error occurred in bootstraping VSAN: Cannot change the host configuration.

    2018-10-11T23:42:26.143Z – debug: Cannot change the host configuration.

    2018-10-11T23:42:26.152Z – info: Cancelling the ping timer for session mgmt

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.