在我的 vSphere 6.7 U3 环境中,我有一个由打包程序生成的 Ubuntu 18.04 模板,然后我使用 Terraform 来部署它的两个副本。我遇到了一个问题,即部署的 VM 的 NIC 断开连接,从而阻止 Terraform 完成部署。
我遵循了来自 vmware 的以下 KB:https ://kb.vmware.com/s/article/56409虽然有人提到这个问题应该在我的 vSphere 和 open-vm-tools 版本中得到修复跑步。我在 Packer 生成的模板中的 KB 中列出了修复程序。
To resolve this issue, follow below provided steps and do not skip the steps.
Open the tmp.conf under /usr/lib/tmpfiles.d/tmp.conf file.
Go to the line 11 and add the prefix # .
For example
#D /tmp 1777 root root -
If you have open-vm-tools installed, open the /lib/systemd/system/open-vm-tools.service file.
In certain version path may be different the use find command locate the file
#find / -iname open-vm-tools.service
Add this line “After=dbus.service” under [Unit]
有没有其他人遇到过这个?我没有使用 cloud-init 自定义方法。这是我在 /var/log/vmware-imc/toolsDeployPkg.log 文件中看到的唯一错误:
[2020-07-17T18:17:57.140Z] [ error] Customization command failed with exitcode: 2, stderr: 'Can't locate File/stat.pm in @INC (you may need to install the File::stat module) (@INC contains: /var/run/.vmware-imgcust-dk2xFAt/scripts /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /var/run/.vmware-imgcust-dk2xFAt/scripts/Utils.pm line 26.
BEGIN failed--compilation aborted at /var/run/.vmware-imgcust-dk2xFAt/scripts/Utils.pm line 26.
Compilation failed in require at /var/run/.vmware-imgcust-dk2xFAt/scripts/Customize.pl line 24.
BEGIN failed--compilation aborted at /var/run/.vmware-imgcust-dk2xFAt/scripts/Customize.pl line 24.
问题在这里:
open-vm-tools
需要包含 的包,File/stat.pm
在 Ubuntu 18.04 LTS 上是perl-modules-5.26
. 确保已安装此软件包。