Like many of you out there, when I am creating a VM, there are times I want a virtual hard drive larger than 256GB. Unfortunately VMware defaults the DataStore block size to 1MB, which limits you to a virtual HDD of only that size. In a previous post (here), I walked you through deleting and recreating the DataStore to get the larger block size needed for a VHDD of up to 2TB. But what happens when you can’t delete the DataStore to recreate it. This is the error I am talking about: “Error during the configuration of the host: DestroyVmfsDatastore: can’t delete partition 3 on lun vmhba1:0:0″
It is no surprise when you install VMware, it installs some other information on the drives for the OS, but I was surprised to see files on the local hard drives when I was installing VMware on the embedded SDcard we typically specify with our servers. Despite installing the actual OS on a separate flash drive, the install actually wrote some data to one of the drives on the server.
Compare DataStore1 which has VMware ESXi installed on it to DataStore 2 which has nothing but VM’s on it. You can see there are a lot more partitions, which is why the DataStore won’t delete. If VMware was installed on an embedded flash drive you would see less partitions on DataStore1, but still a lot more than on DataStore2.
The easiest way to avoid this is if you are installing to an embedded SD card is to not attach your hard drives or configure your virtual disks if you are using a RAID card until after the ESXi installation. If the drives aren’t there, then the installation can’t write files to them.
If, however you have already installed VMware ESXi to the flash drive and don’t want to reinstall it again with the drives disconnected, the easiest way it from inside the RAID card utility at startup, just re-initialize the offending drive, which will delete all data that has been written to it and then you will be able to create the DataStore with the larger block size.
If you do not have the option of installing to an embedded flash drive, then my recommendation would be to create a 1GB virtual disk in your RAID card first, install VMware there, and then create the remaining disks in the RAID utility after. Then, when you are creating the DataStore in VMware, you can specify the block size then.
I hope this helps take away some of the confusion on why you cant delete a DataStore on a clean install with no VM’s even created.