Skip to content

Azure snapshot backup fails on partitioned data disks and NVMe-only VMsΒ #1191

Open

Description

@jihokim-tibero

Summary

barman's Azure snapshot backup resolves the mounted volume for a data disk solely through the /dev/disk/azure/scsi1/lun{N} symlink. That symlink is created by the Azure Linux agent only for SCSI controllers and points only at the raw disk device. As a result the backup fails in two common configurations:

  • Partitioned data disks (SCSI): lun{N} points at the raw disk (e.g. /dev/sda), but the filesystem is mounted from a partition (/dev/sda1). findmnt on the raw disk returns nothing.
  • NVMe-only VMs (v6 / Ebsv5 / other NVMe-enabled SKUs): the /dev/disk/azure/scsi1/ hierarchy is not created at all for NVMe-attached data disks, so the symlink does not exist.

Both surface as the same error:

SnapshotBackupException: Could not find volume with lun N at any mount point

Affected entry points

The snapshot code lives in barman/cloud_providers/azure_blob_storage.py and is shared by both:

  • barman-cloud-backup --cloud-provider azure-blob-storage --snapshot-instance ... (barman-cli-cloud)
  • barman backup with backup_method = snapshot against Azure (barman server)

Root cause

AzureCloudVolumeMetadata.resolve_mounted_volume (master and release/3.19.0, unchanged):

lun_symlink = "/dev/disk/azure/scsi1/lun{}".format(self._lun)
mount_point, mount_options = cmd.findmnt(lun_symlink)
...
if mount_point is None:
    raise SnapshotBackupException(
        "Could not find volume with lun %s at any mount point" % self._lun)

findmnt matches only when the supplied device is itself the mount source. A raw disk whose filesystem lives on a partition is not matched, and a non-existent symlink yields no result. There is no fallback to partition symlinks, NVMe paths, or block-device enumeration.

Two distinct problems

1. SCSI, partitioned data disk

  • /dev/disk/azure/scsi1/lun{N} β†’ raw disk, e.g. /dev/sda
  • filesystem mounted from /dev/sda1
  • findmnt /dev/disk/azure/scsi1/lun{N} β†’ empty β†’ exception

The Azure Linux agent already creates partition symlinks for exactly this case β€” /dev/disk/azure/scsi1/lun{N}-part1 (documented in azure-vm-utils). barman never looks at them.

2. NVMe-only VM

  • /dev/disk/azure/scsi1/lunN is SCSI-specific and is not created on NVMe-only VMs.
  • The official NVMe equivalent is /dev/disk/azure/data/by-lun/<lun>, provided by the azure-vm-utils package / udev rules.
  • barman has no awareness of this path, so resolution fails before a mount point is ever checked.

Comparison with the AWS provider

The AWS provider already handles NVMe. AwsCloudVolumeMetadata.resolve_mounted_volume (barman/cloud_providers/aws_s3.py) enumerates /sys/block and matches Nitro/NVMe devices by EBS volume ID read from /sys/block/{dev}/device/serial. The Azure provider has no equivalent.

So NVMe support is a gap specific to the Azure provider, not a barman-wide limitation. Partition handling, by contrast, is missing in both providers (each resolves only raw block devices, never partitions).

Suggested fix

Resolve the volume through additional, officially-supported paths instead of the single raw symlink:

  1. Keep /dev/disk/azure/scsi1/lun{N} (raw SCSI disk β€” current behaviour).
  2. Fall back to /dev/disk/azure/scsi1/lun{N}-part* for partitioned SCSI disks (official WALinuxAgent symlinks).
  3. Fall back to /dev/disk/azure/data/by-lun/{N} and its partitions for NVMe data disks (official azure-vm-utils symlinks β€” note this requires the azure-vm-utils package, present in recent marketplace images but not all).
  4. As a robust final fallback, resolve the symlink with realpath and use lsblk to find the mount point of the disk or any of its partitions. This works for SCSI and NVMe alike with no extra package dependency.

References:

Workaround (current 3.19.0, no code change)

  • SCSI partitioned disk: format and mount the data disk as a whole-disk device (no partition table) so the lun{N} symlink is itself the mount source. This is one of the two officially documented disk setups, so it is a supported configuration β€” but it must be decided at provisioning time (converting an already-partitioned disk is destructive).
  • NVMe-only VM: no supported workaround β€” the scsi1/lunN path does not exist. Using a SCSI-based VM SKU is the only way to keep snapshot backups working without a code change.

Environment

  • barman / barman-cli-cloud: 3.19.0 (and current master)
  • Confirmed against the release/3.19.0 source β€” resolve_mounted_volume is identical on master.

cc @didorgas @martinmarques

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions