mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
nuageinit: support fetching configuration on multiple iface
On some environement a VM can be connected to multiple ifaces but only
one will respond to dhcp and able to fetch the metadata.
Launch the early dhclient on all available ifaces and as soon as one
dhcp has successfully configured an iface, proceed with fetching the
metadata.
MFC After: 1 week
Reported by: [email protected]
Tested by: [email protected]
Sponsored by: OVHcloud
(cherry picked from commit 90a7728cd8)
This commit is contained in:
1 parent
6415be5503
commit
f2f6f1467b
1 file changed
+8
-3
@@ -56,10 +56,15 @@ nuageinit_start()
|
||||
OpenStack*)
|
||||
mkdir -p /media/nuageinit/openstack/latest
|
||||
ifaces=$(ifconfig -l ether)
|
||||
set -- $ifaces
|
||||
dhclient -p /tmp/ephemeraldhcp.pid $1
|
||||
for iface in $ifaces; do
|
||||
dhclient -p /tmp/ephemeraldhcp.$iface.pid $iface
|
||||
done
|
||||
pids=$(cat /tmp/ephemeraldhcp.*.pid)
|
||||
left=$(pwait -op $pids 2>/dev/null)
|
||||
for iface in $left; do
|
||||
kill -15 $left
|
||||
done
|
||||
fetch_openstack
|
||||
pkill -F /tmp/ephemeraldhcp.pid
|
||||
citype=config-2
|
||||
;;
|
||||
*)
|
||||
|
||||
Reference in new issue
Block a user