We are currently wasting about 10 minutes per deploy waiting for
DHCP on interfaces that will never get it. By default, the timeout
seems to be 5 minutes (the 10 minutes is because we boot both the
IPA ramdisk and the deployed image, and each waits for 5 minutes),
which is excessively long to get a DHCP response. This change
shortens the time to 30 seconds. If an interface hasn't gotten a
response in 30 seconds, chances are it's not going to. A 30
second wait should reduce our wasted time to 1 minute, which is
more reasonable.
This is being done in the systemd unit file because the -timeout
option to dhclient doesn't seem to override what is configured in
dhclient.conf, and doing it in the systemd file means that this
change will be limited to only the interfaces configured by
dhcp-all-interfaces.
Change-Id: Ia8610e3def39c937eb0c861fdc9bc571ec39f9f4
Closes-Bug: 1626673
Dependency to start network-pre (which
depends on network.target) before
dhcp-interface@.service collides with
Ubuntu's own network.target that suupose
to start after network-pre.
Change-Id: I9e59c970bfb1ebdaa15b4ec6b545761ede3ca056
Closes-bug: #1619816
Currently there is no way for a service to become aware that
dhcp-all-interfaces is finished configuring all the interfaces at
boot time. This causes problems for applications like the
ironic-python-agent which scans the interfaces when it first starts as
part of the inspection stage and can race against dhcp-all-interfaces
bringing up the interfaces, leading to inconsistent results.
This patch ensures that the dhcp-all-interfaces script runs before any
network interface is configured and brought up by the rest of the
system, and also ensures that the ironic-agent element also waits for
the network to be online before starting. This is done by using the
network targets provided by systemd.
Change-Id: Id9583b7f54361aa603a6229da598ad6a0f0f7938
Updates the dhcp-all-interfaces element to fix a race
with the recent udev rules implementation on Fedora.
With the new approach we make the udev rule want (require
to startup) a generic dhcp-interface@.service template which
can be started individually for each interface that is
discovered.
The dhcp-interface@.service is setup such that it:
1) It calls dhcp-all-interfaces <iface> directly with
a pre-exec script. This creates the ifcfg file right
before we need it but avoids the case where network.service
might get greedy and try to start it itself.
2) Only runs if the ifcfg script doesn't already exist. This
is important because we only need to bootstrap the DHCP configs...
Once they exist the network.service will take care of starting them
on reboots, upgrades, etc.
3) On initial boot ensure that the initial DHCP interfaces come
up after network.service. Since we really only want
dhcp-all-interfaces to help bootstrap that haven't already
been configured this seems reasonable.
4) We also try to ensure that cloud-init
comes up after the DHCP interfaces. Cloud init has a decently
long timeout that this wasn't a functional problem but it keeps
log file spew down.
Change-Id: I71b026f027182aad49c3435bb903e5e38e524685
Closes-bug: #1294803