Azure / WALinuxAgent

Microsoft Azure Linux Guest Agent
http://azure.microsoft.com/
Apache License 2.0
543 stars 372 forks source link

[BUG] Symlink problems, ephemeral-disk-warning service and script issues #3248

Open kat-lsg-dev opened 1 month ago

kat-lsg-dev commented 1 month ago

Describe the bug: A clear and concise description of what the bug is.

I found this issue while running the LISA tests (https://github.com/microsoft/lisa). The test that fails is found here: https://github.com/microsoft/lisa/blob/717e7c400be694bc2d34a6ce0ce102e8e93cb569/microsoft/testsuites/core/azure_image_standard.py#L1086C3-L1111C6

There is no "DATALOSS_WARNING_README.txt" file being written to the temporary disk, which is /mnt/ in this case. This file is created to warn users that they are accessing a temporary disk and data will be lost. I believe this issue originates, or has something to do with, an incorrect symlink being generated from this file from the WALinuxAgent: /etc/udev/rules.d/66-azure-storage.rules. There is a systemd unit called ephemeral-disk-warning.service that is responsible for running a script (/etc/sbin/ephemeral-disk-warning) that creates the DATALOSS_WARNING_README file. The script tries to resolve an incorrect symlink, and as a result, the file is never written to the target location.

To recreate: Provision a VM in Azure with the following attributes:

Distro and WALinuxAgent details (please complete the following information):

Additional context Add any other context about the problem here.

kat-lsg-dev commented 1 month ago

@anhvoms please let me know if you'd like more information, happy to get that for you