Tuesday 9 February 2016

NetworkManager and VMware Customisations Conflict With Each Other

In my last post review Chef Provisioning's Fog driver, I mentioned that I experienced a number of intermittent errors where it appeared that the VMware customisation on the VM had failed to setup the network interface correctly. At the time I had not established what the problem was or how to overcome it.

I believe that after spending some time trawling through log messages and getting nowhere, I inadvertently stumbled on the same problem from a different direction. I was manually configuring the networking to use a static IP address on a VM I had created from my centos71 vApp template. All was well initially, but all of a sudden the network connectivity was lost again. What was going on ?

Well as it turns out, the NetworkManager service was overwriting the ifcfg-ens32 configuration setting the interface back to DHCP. In using packer to create the vApp template, I had forgotten to disable the NetworkManager service which is enabled by default in CentOS7, While it is possible on a per-interface basis to set NM_CONTROLLED=NO in the respective ifcfg-xxx file, it seems that the VMware customisation process does not set that option, and as a result NetworkManager notices the changed configuration and resets it back to what it believes to be correct.

I have updated the packer scripts in https://github.com/skyscape-cloud-services/automation_examples so it ensures that the NetworkManager service is disabled in the vApp Template. Having recreated my centos71 vApp Template used in the subsequent blog posts, the intermittent problems I was experiencing seem to have gone away.