Package: open-vm-tools
Version: 2:10.3.5-1~bpo9+1
I was debugging some issue where the NIC doesn't get enabled when
deploying a new VM from a template.
It seems this didn't happen every time, so it looked like a race condition.
On a successful run, it gave the following in the logs:
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.
While on a bad run, I had the following:
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.
Those 'No such file or directory' errors where a good pointer :)
If you look at the code
(https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/libDeployPkg/linuxDeployment.c#L1230),
you see it reads a file from /tmp to see which NIC's it needs to be enabled.
But it seems like /tmp was emptied while running the initial guest
customization!
Now the service 'systemd-tmpfiles-setup.service' is responsible for
this, but we don't have any dependency to that service.
I've added the following in an override for open-vm-tools.service:
# cat /etc/systemd/system/open-vm-tools.service.d/override.conf
[Unit]
After=systemd-remount-fs.service systemd-tmpfiles-setup.service
And after that everything seems to be fine! No more broken deploys.
I guess this should be added to the service file shipped.
This is also the case for open-vm-tools 2:10.1.5-5055683-4+deb9u1 in
stretch-stable.
Thanks
Jean-Louis