Azure / Azure/WALinuxAgent

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

Open
#3,248 1 comment 0 reactions 1 assignee Claimed by @anhvoms View on GitHub
provisioning
Dominant language
Python
Stars
581
Forks
397
Avg merge
2d 15h
Merged PRs (30d)
9

Description

**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:
- Image: canonical ubuntuserver 18_04-lts-gen2 18.04.202106220
- VM Size: Standard_NV12s_v3
Check the rules: cat /etc/udev/rules.d/66-azure-storage.rules
Check symlinks: udevadm info --query=all --name=/dev/disk/azure/
Check systemd unit ephemeral-disk-warning: systemctl edit --full ephemeral-disk-warning.service
Check ephemeral-disk-warning script: cat /usr/sbin/ephemeral-disk-warning

**Distro and WALinuxAgent details (please complete the following information):**
- Distro and Version: canonical ubuntuserver 18_04-lts-gen2 18.04.202106220
- WALinuxAgent version: WALinuxAgent-2.2.45 running on ubuntu 18.04

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.