When deploying a VI Workload Domain in VMware Cloud Foundation (VCF), the deployment fails at the Prepare ESXi Hosts for vSAN task.
The domainmanager.log (located at /var/log/vmware/vcf/domainmanager/domainmanager.log on the SDDC Manager VM) contains an error similar to:
ERROR [vcf_dm,...] [c.v.e.s.c.c.v.vsphere.VcManagerBase,dm-exec-1] Task: (MOR:haTask--vim.FileManager.deleteFile-####) (Name:deleteFile) Entity: (Name:null) is failedcom.vmware.vim.binding.vim.fault.InvalidDatastore: Invalid datastore format 'datastore-name -vsan01'.
VCF 5.2.x
This issue occurs when the vSAN datastore name defined during the Workload Domain creation workflow contains invalid characters or formatting, specifically a trailing or leading space within the name string (e.g., 'datastore-name -vsan01' instead of 'datastore-name-vsan01'). The SDDC Manager and underlying vSphere APIs cannot validate or manage a datastore name containing these unexpected space characters.
To resolve this issue, correct the datastore name in the deployment configuration and retry the workflow.
Step 1: Identify the Invalid Name
Invalid datastore format.name -vsan').
Step 2: Correct the Configuration
datastoreName field and remove the invalid space.
Step 3: Clean up ESXi Hosts (if necessary)
If the task partially succeeded on some hosts, they may have a stale vSAN configuration:
esxcli vsan cluster get to check for ghost cluster membership.esxcli vsan cluster leave
Step 4: Retry the Deployment
Return to the SDDC Manager UI and click Retry on the failed Workload Domain deployment task.