VMware Cloud Community
VirtualKenneth
Virtuoso
Virtuoso

Template, not deploying "Gateway" and "DNS" everything else goes well.

Hi,

I'm deploying W2K3 Ent R2 servers, therefor I've created a standard template-file.

I'm reading the template and choosing "Use the customization wizard to temporary adjust the specification before deployment".

When changing the IP configuration the Gateway and DNS settings aren't deployed.

Anyone experienced this be4?

Using ESX 3.0.1 and VC 2.0.1

Cheers,

Kenneth

0 Kudos
62 Replies
mark_chuman
Hot Shot
Hot Shot

I am pleased that they are working on it after two months of waiting:) I'll pick this issue up after Xmas!

0 Kudos
gvfolch
Contributor
Contributor

I am also jumping onto this bandwagon.

I have installed a new VI3 infrastructure (ESX v3.0.1, VC 2.0.1) and also having the same problem.

The default gateway, DNS server and WINS IP's and DNS suffix are empty when deploying VM's using the guest customization wizard. The only entries which remain are the server IP and subnet mask.

I am experiencing this problem with Win2003 Standard, Win2003 Standard SP1, Win2000 Standard and Win2000 Standard SP4.

I will keep tabs on this post for a possible resolution.

Hopefully the VM Techs will see how many of us are having this problem and work on providing a solution quickly.

0 Kudos
mark_chuman
Hot Shot
Hot Shot

I have been very busy at work and looking into this problem is low on my priority list right now, but here is the latest response on my support case. I have not tried the dual Gateway setting theory. Can someone verify that this does anything?

-paste respons--

Thank you for your Support Request.

My name is Mohamed Benbrahim and I am the escalation engineer working on this issue.

VMware is aware of this issue and we are working on a fix which will be included in forthcoming releases or patches of VC 2.x.

As a workaround, you will need to use at least two IP addresses for the "Gateway" network setting during the customization process. For example, you can specify the default gateway IP address and a secondary one. To verify that your network settings are maintained, please follow these steps:

Make sure you customize the new virtual machine using at least two Gateway IP addresses.

If you are using an existing customization XML files, check the Gateway network information section and ensure that at least two IP addresses are specified for the Gateway.

Once the customization is complete and the new virtual machine is booted, open a command prompt and verify that your network settings are maintained by typing the command "ipconfig /all" at the prompt.

Please test this work-around and let me know if your tests are successful.

Looking forward to hearing from you.

Best regards,

0 Kudos
is_nt_admins
Contributor
Contributor

Worth a try but it doesn't help those of us wishing to deploy using DHCP...

0 Kudos
is_nt_admins
Contributor
Contributor

In testing this did not work for me. The behavior was the same as before.

I entered the same IP address for both Gateway entries since we have only one valid gateway, but I don't think that would make any difference.

After it finally finished deploying (not on the domain) an IPconfig listed everything correctly with 1 DFGW entry. Networking was fine, but this information is not getting setup in time to allow the Domain joining to work during the deployment process.

0 Kudos
mark_chuman
Hot Shot
Hot Shot

Yeah, that's what I thought. I'll have more time next week to test another customization. Then I'll send it back to VMware through the open SR.

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

Hold on to your hats, I'm onto something and currently testing.

more information will be posted later on today

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

The workaround indeed works when applying static network settings to the system. Even joining a domain works for me with this workaround!

0 Kudos
mark_chuman
Hot Shot
Hot Shot

Well, atleast static will work. I'll try out the work around this afternoon.

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

Maybe DHCP also works when temporary supplying 2 gateway's?

0 Kudos
is_nt_admins
Contributor
Contributor

I have tried this (the workaround)3 times now and it still fails the same way for me - hangs for a long time trying to join the domain and eventually errors out. After it finishes I am able to join the Domain with no problem.

I have tried different DFGW entries in different orders with no luck.

Message was edited by:

is_nt_admins@fastenal.com

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

I must say that it indeed takes a long time but it doesn't time out over here.

Let me try a few times more tomorrow but I think we agree on this not to be a good workaround at all.

0 Kudos
mark_chuman
Hot Shot
Hot Shot

I am still getting hung on the serial number entry screen. anyone know if there needs to be spaces or dashes in the serial number when entered into the guest customization wizard?

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

dashes

0 Kudos
bstarratt
Contributor
Contributor

This seems pretty straightforward (despite the fact that it is broken):

The commands in cmdlines.txt that set IP info don't run till after the domain has been joined (they run at the very end of sysprep). The sysprep created doesn't have the appropriate sections to assign IP addresses before the domain join, but it does have the

JoinDomain=mydomain.com

The only way it could work was if DHCP was enabled. The InstallDefaultComponents=Yes section directs sysprep to use DHCP.

To make this work without DHCP you would need to see a \[MS_TCPIP parameters] section and a NIC specific PARAMS section so that IP would be set before the domain join happens.

Blah...I'll make my own sysprep and have the machine prompt till they fix this!!!

If its helpful to anyone who doesn't already know this: during sysprep you can hit Shift-F10 to bring up a command prompt to check ipconfig (or anything else). Make sure the console has the focus first.

0 Kudos
mark_chuman
Hot Shot
Hot Shot

The resolution offerred by VMWARE (two gateways) works for me.

0 Kudos
Erwin_Zoer
Contributor
Contributor

For those who do not wish to use the 'two gateways' option, the fixed version of the script can be found below:

\*** START SCRIPT ***

0 then

set shell = CreateObject("WScript.Shell")

shell.logevent 1, "Setnet: Failed to SetTcpipNetBios for "_

& "MACAddress = " & .Item("MACAddress")_

& ", NetBios = " & .Item("NetBios")_

& ", return code = " & ret & ": " & ErrorMessage(ret)

set shell = nothing

wscript.quit

end if

end if

end with

end sub

'----


'main : ' Get the service

set service = GetObject("winmgmts:\{impersonationLevel=impersonate}!//./root/cimv2")

if service is nothing then

set shell = CreateObject("WScript.Shell")

shell.logevent 1, "Setnet: Could not get WMI services object"

wscript.quit

end if

'The params had better be OK, because we can 't really handle any errors here

with wscript.arguments.named

'make up a query to find the right nic

if not .Exists("MACAddress") then

set shell = CreateObject("WScript.Shell")

shell.logevent 1, "Could not configure network - MACAddress was not specified"

wscript.quit

end if

wscript.echo(.Item("MACAddress"))

query = "SELECT * FROM Win32_NetworkAdapter WHERE MACAddress = '" & .Item("MACAddress") & "'"

set ethernetCards = service.ExecQuery(query, "WQL", wbemFlagReturnWhenComplete)

'if there's no card that matches, log an error :

if ethernetCards.count = 0 then

set shell = CreateObject("WScript.Shell")

shell.logevent 1, "setnet: Could not find a network adapter with MACAddress = " & .Item("MACAddress")

wscript.quit()

end if

'get the associated configuration and set the values. there should only

'be one card, but we need to use the enumerator to get it

for each card in ethernetCards

set configs = card.Associators_(, "Win32_NetworkAdapterConfiguration")

'again there's only one

for each config in configs

useDHCP = false

if .Exists("UseDHCP") then

if .Item("UseDHCP") = "yes" then

useDHCP = true

end if

end if

if useDHCP then

DoEnableDHCP config

else

DoEnableStatic config

DoSetGateways config

DoSetDNSServerSearchOrder config

DoSetDNSDomain config

DoSetWINSServer config

'Set the DNS suffixes search order for all the adapters

set objNetworkSettings = service.Get("Win32_NetworkAdapterConfiguration")

DoSetDNSSuffixSearchOrder objNetworkSettings

set objNetworkSettings = nothing

end if

'do this regardless of dhcp DoSetTcpipNetBios config

next

'There should only be one card with the specifies MAC, but we'll

'jump out here regardless

exit for

next

'success - celebrate :

set shell = CreateObject("WScript.Shell")

shell.logevent 0, "setnet: Successfully configured network adapter with MACAddress = " & .Item("MACAddress")

end with

set shell = nothing

set service = nothing

set ethernetCards = nothing

set configs = nothing

</script>

</job>

\*** END SCRIPT ***

The problem with the script is that it expects two valid arrays (default gateways and metrics) to be passed to the 'DoSetGateways' function. The problem is that the default gateway array only contains one element whereas the metrics array for some reason always contains two elements. The fixed VB code checks to see if more than one default gateway was passed. If so, it assumes that both arrays are correct. If not, it attempts to correct the default gateway and metrics arrays.

The file should be copied to the following location:

\Program Files\VMware\VMware VirtualCenter 2.0\scripts

I hope this helps.

Erwin

0 Kudos
is_nt_admins
Contributor
Contributor

Sorry...what filename should it be saved as or replace in the scripts folder?

Thanks!

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso

Yeah, this is interesting. Do we need to see this as some kind of update that is coming out for VC later on?

0 Kudos
is_nt_admins
Contributor
Contributor

I replaced setnet.wsf with this new script and tested twice deploying new VM's and automatically attempting to join the Domain with a Specification which uses DHCP. Both times it still failed in the same way.

After it finally gives up and gives the error about not being able to access the Domain because of network problems it finishes up and I am able to login and join the Domain without making any changes. There is still some kind of timing problem going on.

0 Kudos