Skip to content
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

dracut: add dependency network to ignition-mount.service #1940

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

tormath1
Copy link
Contributor

On some providers (like Equinix Metal), there is a network dependency for the umount stage, network must be still around when ExecStop is executed.

Thanks @dustymabe for the suggestion on the fix. 💪


Tested on Flatcar CI with Equinix Metal tests:

[   17.117250] ignition[1066]: INFO     : Stage: umount
[   17.134237] ignition[1066]: INFO     : no configs at "/usr/lib/ignition/base.d"
[   17.144233] ignition[1066]: INFO     : no config dir at "/usr/lib/ignition/base.platform.d/packet"
[   17.155231] ignition[1066]: INFO     : umount: umount passed
[   17.163285] ignition[1066]: INFO     : POST message to Packet Timeline
[   17.172314] ignition[1066]: INFO     : GET https://metadata.packet.net/metadata: attempt #1
[   17.182386] systemd[1]: Stopping ignition-mount.service - Ignition (mount)...
[   17.192471] systemd[1]: remount-sysroot.service - Remount Root File System was skipped because of an unmet condition check (ConditionPathIsReadWrite=!/sysroot).
[   17.209370] systemd[1]: systemd-udev-trigger.service: Deactivated successfully.
[   17.219369] systemd[1]: Stopped systemd-udev-trigger.service - Coldplug All udev Devices.
[   17.229791] systemd[1]: dracut-pre-trigger.service: Deactivated successfully.
[   17.239272] systemd[1]: Stopped dracut-pre-trigger.service - dracut pre-trigger hook.
[   17.249398] systemd[1]: initrd-cleanup.service: Deactivated successfully.
[   17.258429] systemd[1]: Finished initrd-cleanup.service - Cleaning Up and Shutting Down Daemons.
[   17.525189] ignition[1066]: INFO     : GET result: OK
[   17.790691] ignition[1066]: INFO     : Ignition finished successfully
...
[   17.943385] systemd[1]: Stopped target network.target - Network.
[�[0;32m  OK  �[0m] Stopped target �[0;1;39msockets.target�[0m - Socket Units.
[   21.915639] systemd[1]: Stopped target network.target - Network.
...
[   22.590416] ignition[1212]: INFO     : Ignition 2.19.0
[   22.605169] ignition[1212]: INFO     : Stage: umount
         Stopping �[0;1;39msystemd-networkd.service�[0m - Network Configuration...

[   22.605284] ignition[1212]: INFO     : no configs at "/usr/lib/ignition/base.d"
[   22.629140] ignition[1212]: INFO     : no config dir at "/usr/lib/ignition/base.platform.d/packet"
         Stopping �[0;1;39msystemd-resolved.service�[0m - Network Name Resolution...

[   22.629185] ignition[1212]: INFO     : umount: umount passed
[�[0;32m  OK  �[0m] Stopped �[0;1;39msystemd-udev-trigger.service�[0m - Coldplug All udev Devices.

[   32.565905] ignition[1212]: INFO     : GET error: Get "https://metadata.packet.net/metadata": net/http: timeout awaiting response headers
[   32.766388] ignition[1212]: INFO     : GET https://metadata.packet.net/metadata: attempt #2
�[K[  �[0;31m*�[0;1;31m*�[0m�[0;31m* �[0m] Job ignition-mount.service/stop running (11s / 1min 30s)

�M
�[K[ �[0;31m*�[0;1;31m*�[0m�[0;31m*  �[0m] Job ignition-mount.service/stop running (11s / 1min 30s)

Comment on lines 16 to 17
# and that network is enabled for provider with a network dependency
# like Equinix Metal (Packet)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a fan of more verbosity to try to explain the nuance if you don't mind. Something like:

Suggested change
# and that network is enabled for provider with a network dependency
# like Equinix Metal (Packet)
# and that we order ourselves after network such that
# if networking is brought up it will still be available
# for our ExecStop= command. On some providers like Equinix
# Metal (Packet) there is a network callback sent out
# for each Ignition stage (including umount).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks for the suggestion.

@dustymabe
Copy link
Member

this LGTM - @jlebon @prestist - WDYT?

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch! Commits could be combined but LGTM as is.

@@ -20,6 +20,7 @@ nav_order: 9
### Bug fixes

- Fix Akamai Ignition base64 decoding on padded payloads
- Add network dependency to `ignition-mount.service`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: I guess technically we're not adding a dependency, only a strong ordering. Also these notes are typically written to be more concrete to the end-user. E.g. something like

Suggested change
- Add network dependency to `ignition-mount.service`
- Fix network race when phoning home on Equinix

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to me. Done and I squashed the two commits.

On some providers (like Equinix Metal), there is a network dependency
for the umount stage, network must be still around when ExecStop is
executed.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Co-authored-by: Dusty Mabe <dusty@dustymabe.com>
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@jlebon jlebon merged commit cd1c2cc into coreos:main Sep 13, 2024
9 checks passed
@tormath1 tormath1 deleted the tormath1/ignition branch September 16, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants