I am provisioning a Debian virtual machine on Azur...
# azure
b
I am provisioning a Debian virtual machine on Azure, utilizing
customData
with
cloud-init
for initial configuration and simultaneously deploying the Azure Monitor Agent VM extension. It appears that
cloud-init
continues its setup processes, including package installations via
dpkg
, in the background even after Azure signals the VM as "ready." Consequently, when the Azure platform attempts to install the Monitoring Agent extension, it also tries to use
dpkg
. This creates a conflict, as both processes attempt to acquire a lock on
dpkg
concurrently, leading to the failure of the Monitoring Agent extension installation. Are there any "hacks" for e.g. making pulumi wait with provisioing of the monitoring agent? I'm using pulumi-java 1.11 and azure-native 3.4.0
If anybody ever comes over this I seem to have to solved in a pretty hacky way by just using runcmd in cloud-init to 1. wait for the azuremonitoragent.service file to appear in the systemd directory and then also wait to the service to start with the handy --wait argument to systemctl. After that I install packages with apt non interactive in further runcmd. Since I don't have much other to there at the moment I postponed extracting it to a script.