-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debian 9 - bad NIC interpretation (ens160) #172
Comments
Can you please provide the complete 'customization log file' available at /var/log/vmware-imc/toolsDeployPkg.log |
Yes, sure, you can take a look at the whole log here, on gist: CLICK. |
Thanks. It seems the output of 'ifconfig -a' got changed in Debian 9. Will file a new internal bug for further investigation. |
Noticed that this issue was reported already in #130 |
Oh, I didn't search for the closed issues... Ok, from the lecture I understand that it's the vCenter's problem (Customization.pm), not with open-vm-tools. Could you please confirm me that? In one hand ifconfig is deprecated (Red Hat also said that), but on the other hand, is still working, so everything should work perfectly with that tool. And unfortunately, I don't believe VMware's matrixes. :) Even VMware doesn't trust them and matrixes are not the reliable documents for the VMware Support. |
Hi, For the record, I had the same issue coming from net-tools update that changed ifconfig output format. The file was at C:\Program Files\VMware\vCenter Server\vpxd\imgcust\linux\imgcust-scripts\Customization.pm on vCenter server and there's nothing to reload after modifying. Everytime you create a VM with customization this file is copied from the vCenter to the server directly inside the virtual machine filesystem. --- Customization.pm.orig 2017-07-27 20:21:04.259828942 +0200
+++ Customization.pm.new 2017-07-27 20:21:35.559476473 +0200
@@ -756,17 +756,17 @@
if (! defined $ifcfgResult) {
$ifcfgResult = Utils::ExecuteCommand('/sbin/ifconfig -a');
}
+
+ my @interfaces = split/\n\n/, $ifcfgResult;
- my $result = undef;
-
- my $macAddressValid = ($macAddress =~ /^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i);
-
- if ($macAddressValid &&
- ($ifcfgResult =~ /^\s*(\w+?)(:\w*)?\s+.*?$macAddress/mi)) {
- $result = $1;
+ foreach my $interface (@interfaces) {
+ if ($interface =~ /$macAddress/) {
+ print($interface);
+ if ($interface =~ m/^(\w+)(:|\s)/) {
+ return $1;
+ }
+ }
}
-
- return $result;
}
sub GetInterfaceByMacAddressIPAddrShow vcenter_Customization_pm.diff.txt Not heavily tested but I've been able to deploy two machines with it and the method seem to work fine on a machine with legacy net-tools. Regards, Adam. |
This is still an issue for Debian 9.X
As mentioned earlier the problem is the new ifconfig colons. open-vm-tools thinks that ether is the first interface. So network customization fails. Regards, Jesse. |
Hi, You can try patching VMware files with my patch above, it works just fine for me (but I nearly deploy only Debian 9). |
Thanks for your quick reply. This "problem" should be updated. ifconfig is deprecated in favor of iproute2. ifconfig package isn't even installed on Debian 9.x by default. And i presume more and more distros will do this. |
I see ;-) Indeed, ip should be used. But I'm not sure ip command is available on older systems, could be an issue as well... |
Yes, backwards compatibility is a b#$%&. open-vm-tools should just use ip by default and return to ifconfig when ip is not installed. |
@eLvErDe "conditionals" is the answer. :) Please take a look at this code, located in open-vm-tools/scripts/linux/network:
It's possible to create the "if" conditional. And I agree with @Randlemann - ifconfig is deprecated in many systems, for example, Red Hat suggests to use ip instead of ifconfig. They have plans to remove ifconfig completely from the OS environment. |
Well, of course it's possible but I hate Perl and I'm not working at VMWare so I leave it to whom it may concern ;) |
It's weird because
That doesn't work as intended apparently... I'm pretty sure ip is available on my debian 9.x image 😄 |
I still have this issue, also with Debian 9. |
I see this issue in Ubuntu 18.04 as well. |
The fix I mentioned above doesn’t work as expected - vmtools rewrites interfaces and removes the include to interfaces.d :( |
My patch works just fine, I ve been deploying Stretch VMs for ages |
The issue was fixed in latest VMware vCenter releases. (At least 6.7 onwards). Please update the vCenter builds for the fix. |
A newer vcenter doesn't seem to work. Using Ubuntu 20.04, net-tools (1.60+git20180626.aebd88e-1ubuntu1), open-vm-tools (2:11.0.5-4) and VCSA 6.7.0 build 14368073 (aka 6.7u3) I still get a device named "ether" instead of "eth0" or "ethX" basically. The console shows 6.7.0.4000. I'm going to try and remove net-tools altogether and hope it works, no idea why if "ip" is present why it isn't used over "ifconfig". I did also try and set /etc/vmware-tools/scripts/vmware/network to have ifconfig_cmd set to blank (i.e. ""), but that also didn't work. |
You can add 20.04 to /usr/lib/vmware-vpx/imgcust/linux/imgcust-scripts/UbuntuNetplanCustomization.pm on the VCSA to make it works with Ubuntu 20.04. |
Just did it and worked flawlessly (17.10|20.04|1[8-9].(04|10))/i) |
I've just installed the new Debian 9 and I'm trying to customize Debian in the vCloud Director. Unfortunately, I cannot, because script can't customize network properly. Please take a look at this snippet from /var/log/vmware-imc/toolsDeployPkg.log:
As you see, Debian has a link named ens160 instead of eth0. I am not sure why script tries to check eth0, but it's bad. The worst thing is that script thinks NIC should have name "ether". After the customization my /etc/network/interfaces file looks like this:
Ens160 was created by default, so I assume it's a normal behavior on Debian 9. Customization of course fails and I have no network configured.
The text was updated successfully, but these errors were encountered: