Comments (3)
Hi @leslie-qiwa
Did you ever resolve this issue?
If so, how did you resolve it?
Thank you.
from esxi-packer-templates.
unfortunately, not yet.
from esxi-packer-templates.
I was able to resolve this issue by delaying/waiting until a connection could be established.
I got the hint from this post:
https://communities.vmware.com/t5/ESXi-Discussions/Imaging-ESX-5-1-MAC-address-issues-with-DHCP/td-p/2152927
Sleep command is critical with out this delay the script executes too fast during the boot process and script will not work at boot time,
#!/bin/sh
# When an ESX VM is cloned, vnic0 gets a new mac from the vmx's
# ethernet0.generatedAddress, but vmk0's mac is persisted in /etc/vmware/esx.conf
# vagrant uses ethernet0.generatedAddress to lookup the VM ip in
# vmnet-dhcpd-vmnet8.leases, reconfigure here if needed.
os_ver=$(uname -r | awk -F. '{print $1}')
while [ "$vnic0_mac" == "" -o "$vmk0_mac" == "" ]
do
if [ "$os_ver" -lt 6 ] ; then
vnic0_mac=$(esxcli --formatter csv network nic list | grep vmnic0 | awk -F, '{print $5}')
vmk0_mac=$(esxcli --formatter csv network ip interface list | grep vmk0 | awk -F, '{print $2}')
else
vnic0_mac=$(esxcli --formatter csv network nic list | grep vmnic0 | awk -F, '{print $7}')
vmk0_mac=$(esxcli --formatter csv network ip interface list | grep vmk0 | awk -F, '{print $3}')
fi
done
if [ "$vnic0_mac" != "$vmk0_mac" ] ; then
esxcli network ip interface remove -i vmk0
esxcli network ip interface add -i vmk0 -M $vnic0_mac -p "Management Network"
esxcli network ip interface ipv4 set -i vmk0 -t dhcp
fi
from esxi-packer-templates.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esxi-packer-templates.