VCSA: 'Active Directory Enabled' Fails During Setup Wizard

During the setup wizard of the vCenter Server Appliance I experienced an error at the step to make it Active Directory Enabled.

In this instance I received the below error:

Failed to execute ‘/usr/sbin/vpxd_servicecfg ‘ad’ ’test’ ‘sunnydale\vcentersvc’ CENSORED ‘sunnydale.local’’: VC_CFG_RESULT=309(Error: Invalid hostname. FQDN is required for joining a domain.)

Initially I thought it may be something to do with how I was specifying the AD domain name or username. Didn’t get very far with that, so I skipped it for the time being and decided to come back to it later.

This setting can later be configured from vCenter Server, Authentication . Attempting the same from there results in a similar error:

AD Authentication settings Error: Invalid hostname. FQDN is required for joining a domain.

What the error (obviously) actually means is that the hostname specified on the Network page is the full FQDN and not a standalone hostname. So I had not specified that correctly as part of the initial setup.

Not this:

 

Rather this:

 

Also, make sure you have created a DNS A record for this server.

Once that was resolved I had some further issues with the formatting of the Domain and Admin User, in the end the below worked, i.e. username in the format [email protected]  . (Note I had been experimenting with a change to the administrator account rather than the vcentersvc service account which is why that is different below, I don’t think that was the cause of the issue)