Azure: Support ephemeral disk handling on Gen2 VMs

Bug #1797480 reported by Stephen A. Zarkos
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Chad Smith

Bug Description

Generation 2 VMs are becoming available in Azure, first for Azure Confidential Computing (ACC). The current portal experience is exposed through https://aka.ms/ccvm. But folks can also use the CLI to deploy Standard_DC2s or Standard_DC4s VMs in East US or West Europe and provision Gen2 VMs in Azure.

The current ephemeral disk handling makes use of a "contract" relating to how the OS and ephemeral disks are attached to the VM. With typical Gen1 VMs in Azure these disks are IDE disks, however Gen2 VMs only support SCSI disks. See "RESOURCE_DISK_PATH" and 66-azure-ephemeral.rules in the Azure datasource.

On new Gen2 VMs, the OS disk will be added to <SCSI,0,0> and the resource disk will be added to <SCSI,0,1>. The cloud-init and the above udev rule will need to be modified to properly detect the ephemeral disk for either Gen1 or Gen2 VMs.

We're making a similar change to the Azure agent - https://github.com/Azure/WALinuxAgent/issues/1362

Related branches

Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks Stephen,

Looking over udevadm info on /dev/sda & sdb on the Gen2 instances, it seems the deviceid of both is the following:

    ATTRS{device_id}=="{f8b3781a-1e82-4818-a1c3-63d806ec15bb}"

Since I don't just want cloud-init to attempt to setup links based solely on target luns, I'd like to be able to filter our udev rule matches by device_id or some portion of the device_id prefix if we think that is expected to be stable on Gen2 instances.

Do we know if device_id or some portion of that device_id exposed the Gen2 instances is expected to be static?

Example for Gen1 rule matching:

ATTRS{device_id}=="?00000000-0000-*", ENV{fabric_name}="azure_root", GOTO="ci_azure_names"
ATTRS{device_id}=="?00000000-0001-*", ENV{fabric_name}="azure_resource", GOTO="ci_azure_names"

Proposal on Gen2 matching:

ATTRS{device_id}=="?f8b3781a-1e82-*", SUBSYSTEMS="scsi", KERNELS="0:0:0:0", ENV{fabric_name}="azure_root", GOTO="ci_azure_names"
ATTRS{device_id}=="?f8b3781a-1e82-*", SUBSYSTEMS="scsi", KERNELS="0:0:0:1", ENV{fabric_name}="azure_resource", GOTO="ci_azure_names"

Revision history for this message
Chad Smith (chad.smith) wrote :

udevadm info on Gen2 sda(root) http://paste.ubuntu.com/p/QgNSZvkr3V/
udevadm info on Gen2 sdb(resource) http://paste.ubuntu.com/p/GdHTrNdqtT/

Revision history for this message
Ryan Harper (raharper) wrote :

could you re-run those with:

udevadm info -q all /sys/class/block/sda
udevadm info -q all /sys/class/block/sdb

Revision history for this message
Chad Smith (chad.smith) wrote :

Updated and reduced the udev rule conditionals by dropping the SUBSYSTEMS=="scsi" check as it's uncecessary given the KERNELS target/lun string format.

Updated proposal on Gen2 matching:

ATTRS{device_id}=="?f8b3781a-1e82-*", KERNELS=="0:0:0:0", ENV{fabric_name}="azure_root", GOTO="ci_azure_names"
ATTRS{device_id}=="?f8b3781a-1e82-*", KERNELS=="0:0:0:1", ENV{fabric_name}="azure_resource", GOTO="ci_azure_names"

Revision history for this message
Chad Smith (chad.smith) wrote :
Chad Smith (chad.smith)
Changed in cloud-init:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Chad Smith (chad.smith)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit 3b332c93 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=3b332c93

Changed in cloud-init:
status: In Progress → Fix Committed
Chad Smith (chad.smith)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.