Azure / azure-init

A minimal provisioning agent designed for Azure Linux VMs.
MIT License
7 stars 10 forks source link

azure-init should not assume provisioning media is always at /dev/sr0 #66

Closed anhvoms closed 3 months ago

anhvoms commented 4 months ago

Description

Currently azure-init assumes that /dev/sr0 location is where the provisioning iso will surface. While this is true many of the times, it's not always the case. For example, in FreeBSD it will be at /dev/cd0. In some special environment, it might show up as /dev/vda1

The right mechanism to find the device is to enumerate block devices and process all devices that have fstype of iso9660 and udf. Because /dev/sr0 will be the correct choice for > 99% of cases, we might default to /dev/sr0 and fall back to enumeration if /dev/sr0 isn't the right choice. See cloud-init handling of this issue for reference

Impact

azure-init won't be able to mount the provisioning iso if the iso isn't showing up at /dev/sr0

Expected behavior

azure-init should be able to find the provisioning iso in all Azure environments

dongsupark commented 3 months ago

I am working on this issue. To avoid running command line tools like blkid, I am trying to write a function that makes use of native Rust crates for getting devices list, like libparted.

anhvoms commented 3 months ago

@dongsupark
https://lib.rs/crates/block-utils