question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] WALinuxAgent service should start after the cloud-config service

See original GitHub issue

Currently (On Canonical UbuntuServer 18.04-LTS) the WALinuxAgent service and cloud-init run in parallel on start-up causing issues with contention of the package repository.

I believe that WALinuxAgent should start after the cloud-config service to ensure that:

Distro and WALinuxAgent details:

  • Distro and Version: [e.g. Ubuntu 18.04 latest image]
  • WALinuxAgent version
WALinuxAgent-2.2.45 running on ubuntu 18.04
Python: 3.6.9
Goal state agent: 2.2.48.1

Additional context My current situation when starting an Ubuntu 18.04 VM, with the Log Analytics extension is that:

  1. WALinuxAgent starts, installs the Log Analytics agent (through extension) then;
  2. Shortly after (~2 seconds or so) cloud-init starts with the following configuration:
package_upgrade: true
package_reboot_if_required: true
  1. WALinuxAgent or Log Analytics agent has the package repository lock, and causes cloud-init to fail

My current solution is to modify the service behaviour by adding this override to /etc/systemd/system/walinuxagent.service.d/override.conf from within bootcmd using cloud-init:

[Unit]
After=cloud-config.service

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
carldjohnstoncommented, Jul 12, 2020

Update on this; my proposed solution doesn’t appear to work reliably.

I believe that the walinuxagent service needs to start after cloud-final to be more robust. I’m achieving that with the following in cloud-init:

bootcmd:
  - mkdir -p /etc/systemd/system/walinuxagent.service.d
  - echo "[Unit]\nAfter=cloud-final.service" > /etc/systemd/system/walinuxagent.service.d/override.conf
  - sed "s/After=multi-user.target//g" /lib/systemd/system/cloud-final.service > /etc/systemd/system/cloud-final.service
  - systemctl daemon-reload
1reaction
ma-armentacommented, Nov 17, 2021

Good workaround but this should be fix, or allow extension sequencing for customScript extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure: cannot start walinux agent (Transaction order is cyclic.)
When bringing up the Azure datasource in cloud-init.service, cloud-init tries 'service start walinuxagent'. That previously worked fine, and the ...
Read more >
1474226 – [WALA][cloud] cloud-init dhclient-hook script has ...
9-7 that caused dhclient and NetworkManager hook scripts to run on Microsoft Azure even when the cloud-init service was not enabled at boot....
Read more >
cannot start walinux agent (Transaction order is cyclic.)
Public bug reported: When bringing up the Azure datasource in cloud-init.service, cloud-init tries 'service start walinuxagent'.
Read more >
Swap file is not re-created after a Linux VM restarts
Describes how to resolve the problem that prevents a swap file from being re-created after a restart of a Linux virtual machine.
Read more >
Azure — cloud-init 20.4.1 documentation
If you are configuring walinuxagent yourself, you will want to ensure that you have ... Azure provides the instance metadata service (IMDS) which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found