Fix for 'Failed - Cannot change the host configuration' in VMWare ESXi when adding a datastore
Adding a disk as a new datastore in ESXi that was previously used for a Windows install may produce this error:
“Failed - Cannot change the host configuration.”
What! This error doesn’t give you very much information. For some reason a drive that is already partitioned by another operating system seems to produce this error.
It’s an easy fix. Enable SSH in ESXi. Just start the TSM-SSH service. We’ll turn off when done with it.
SSH to your server and list the contents of the /dev/disks directory.
cd /dev/disks
ls
Find the device-id for the disk you are attempting to add. It may look something like this (yes, the device-id is this entire string):
t10.ATA_____HARDRIVE_MODEL_NUMBER_________________________1812E45C45AC________
Use this command to delete existing partitions on the disk:
partedUtil mklabel /dev/disks/DEVICE-ID msdos
Done! Try adding your datastore now. Remember to turn SSH off when done.