vmware / open-vm-tools

Official repository of VMware open-vm-tools project
http://sourceforge.net/projects/open-vm-tools/
2.26k stars 427 forks source link

Deploy from template has disconnected NIC after guest customization #208

Open gstorme opened 6 years ago

gstorme commented 6 years ago

Referencing #86

Hi,

We deploy Debian 9 from a template on vCenter 6.0 The open-vm-tools package version is 10.1.5-5055683-4+deb9u1 The NIC is a VMXNET3 adapter

About 1 out of 10 deploys from the same template end up with a disconnected NIC after guest customization has completed. An extract from /var/log/vmware-imc/toolsDeployPkg.log on such a failed deploy:

Transitioning from state INPROGRESS to state Done.
ENTER STATE Done
EXIT STATE INPROGRESS
Setting deploy error: Error removing lock /tmp/.vmware-deploy.INPROGRESS (No such file or directory)
Setting deploy error: Error deleting old state INPROGRESS.(Error removing lock /tmp/.vmware-deploy.INPROGRESS (No such file or directory))
Deployment succeded.
No nics to enable.
Launching cleanup.

This full log is available on https://gist.github.com/gstorme/97b6604251b75c37a45ee0fa2841b074

On a successful deploy:

Transitioning from state INPROGRESS to state Done.
ENTER STATE Done
EXIT STATE INPROGRESS
Deployment succeded.
Wait before set enable-nics stats in vmx.
Trying to connect network interfaces, attempt 1
Got VMX response 'queryNicsSupported'
Got VMX response 'disconnected'
Got VMX response 'connected'
The network interfaces are connected on 1 second
Launching cleanup.

The vCenter event log is the same for both deployments:

Customization of VM myvm succeeded. 
Customization log located at /var/log/vmware-imc/toolsDeployPkg.log in the guest OS.
Started customization of myvm <masked>.
Customization log located at /var/log/vmware-imc/toolsDeployPkg.log in the guest OS.
vmwzhangv commented 6 years ago

Please make sure that the VM has a NIC before starting the customization. This can be easily checked in the VM settings.

gstorme commented 6 years ago

This is a deploy from a vm template, which as a nic. So yes, the deployed vm from the template always has a NIC, before the customization starts

vmwzhangv commented 6 years ago

I would like to help you debug this. Would you be able to upload content of this directory of the VM after the customization failed ?

/var/log/vmware-imc/

vmwzhangv commented 6 years ago

Looking at the existing log, the customization has trouble creating file /etc/dhcp3/dhclient.conf. Not sure what is causing it though, since it is happening only in some runs.

ERROR: Fatal error occoured during customization !! Customization halted. ERROR: Error : Could not create file /etc/dhcp3/dhclient.conf! at /tmp/.vmware-imgcust-dlQhBL3/scripts/Utils.pm line 546.

INFO: Return code is 252. Exiting

dupondje commented 5 years ago

Fixed with https://github.com/bzed/pkg-open-vm-tools/commit/e4697c7880b7167b4365fdf40241ed7a1e5a2536