VMware Cloud Community
dsincavage
Contributor
Contributor
Jump to solution

Unable to join domain using vCD guest customization

I have vCloud Director installed and running.  I've created a vApp and edited the properties to allow guest customization and most everything works so far except the computer will not join the domain.  I've tried using Organization customization, as well as customizing the vApp after its deployed.  As soon as the server is finished with the customization and is powered on, I can log on and join the domain manually without any problems, I just cant get the guest customization to do this for me.   Its a Windows 2008 R2 server.  I found this entry near the end of the customize-guest log on the server:

executing command netsh= interface ip set dns 12 static xxx.xxx.xxx.xxx (it has the correct address for my DNS server)

Command execution succeeded, command output:

The configured DNS server is incorrect or does not exist

Any thoughts?

Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

This is a farily well known issue.  For Domain joins to work in vCloud Director you need to have DHCP onyour subnet.  Many people do this using the vShield Edge device that is on Org Network.  The process of sysprep runs before the VMware tools is running (which applies the satic IP address to the guest).  It is sort of a chicken or egg situation that the guest has ip when in sysprep so the easy fix to make it work is DHCP.  The other way people have done it is to port a lab manager post custization script over to vCD that joins the domain after the sysprep is completely done and the guest has it's static IP.  Frankly it is an Order of Operations thing that is causing the issue.  We are looking into this for other customers but right now your options are

1) Add DHCP to the subnet using your own DHCP server OR using vShield Edge

2) add a post customization script to join the domain this can be inserted into the guest customizaion area as well.

Hope this helps you stop banging your head on the wall Smiley Happy

View solution in original post

Reply
0 Kudos
4 Replies
admin
Immortal
Immortal
Jump to solution

This is a farily well known issue.  For Domain joins to work in vCloud Director you need to have DHCP onyour subnet.  Many people do this using the vShield Edge device that is on Org Network.  The process of sysprep runs before the VMware tools is running (which applies the satic IP address to the guest).  It is sort of a chicken or egg situation that the guest has ip when in sysprep so the easy fix to make it work is DHCP.  The other way people have done it is to port a lab manager post custization script over to vCD that joins the domain after the sysprep is completely done and the guest has it's static IP.  Frankly it is an Order of Operations thing that is causing the issue.  We are looking into this for other customers but right now your options are

1) Add DHCP to the subnet using your own DHCP server OR using vShield Edge

2) add a post customization script to join the domain this can be inserted into the guest customizaion area as well.

Hope this helps you stop banging your head on the wall Smiley Happy

Reply
0 Kudos
dconvery
Champion
Champion
Jump to solution

Chris -

I am actually working with Dave S on this situation.

I have tried this in my lab:

1. I added the following lines to the customization script in the VM properties:

if "%1%" == "precustomization" (

   goto end

) else if "%1%" == "postcustomization" (

   netdom join %COMPUTERNAME% /domain:dclabs.local /ou:OU=vCloud,DC=dclabs,DC=local /userd:dclabs\administrator /passwordd:xxxxx

)

:end

The script completes, but cannot find the domain because it cannot find the DNS servers to resolve the name.

2. If I enable DHCP, the above works fine.

3. If I run the same netdom command from an elevated cmd prompt after the system comes up, it joins fine.

So, the chicken and egg thing still exists, even with the above attempt. My next step is to try the old "%windir%\Setup\Scripts\SetupComplete.cmd" trick from Lab Manager, but I am thinking the above script just gets inserted in the same place anyway... If all else fails, I will need to do some vCO trickery.

Dave

Dave Convery, VCDX-DCV #20 ** http://www.tech-tap.com ** http://twitter.com/dconvery ** "Careful. We don't want to learn from this." -Bill Watterson, "Calvin and Hobbes"
Reply
0 Kudos
dconvery
Champion
Champion
Jump to solution

I GOT IT!!!!

I stole this from Lab Manager, but it works:

Create the file %windir%\Setup\Scripts\SetupComplete.cmd

Add the netdom.exe command:

netdom.exe join %COMPUTERNAME% /domain:dclabs.local  /ou:OU=vCloud,DC=dclabs,DC=local /userd:dclabs\administrator  /passwordd:**** /reboot

And it works like a charm. Since this is a Windows 2008 system, the netdom bits were already there. I may have added the remote management feature, I'm not really a winders guy.

It will probably work for Windows 7 as well as long as the netdom bits are there.

Dave

Message was edited by: dconvery Forget to mention this: The script needs to be added to the VM before the vApp is added to a catalog. Guest Customization also needs to be enabled before adding it to the catalog.

Dave Convery, VCDX-DCV #20 ** http://www.tech-tap.com ** http://twitter.com/dconvery ** "Careful. We don't want to learn from this." -Bill Watterson, "Calvin and Hobbes"
Reply
0 Kudos
dsincavage
Contributor
Contributor
Jump to solution

Thank you, adding DHCP to the subnet worked.

Reply
0 Kudos