Closed donnydavis closed 5 years ago
thanks @donnydavis for raising this, can you include a detailed description in your commit message about the issue that this change fixes?
@ahkok were you going to work a better solution for this?
I asked @donnydavis to provide some INFO - I need to know if I potentially can rely on device nodes becoming available through udev / systemd.
The device we are looking for should always be /dev/sr0
In Openstack it would be atypical to connect a cdrom device for a different purpose
That's not usable. /dev/sr0 could also be another OS. I need to at least have the proper name of dev-disk-by\x2dpartlabel-primary.swap
type autogenerated unit, but then for config-2
obviously...
If someone has a different OS in sr0 it's highly unlikely they are using a config-drive for provisioning.
I meant: they could have a virtual CDROM inserted with a debian OS. We can't just depend on just /dev/sr0
. We have to use the label at minimum.
In Openstack someone would have to really go out of their way to make that happen, but on an older virt platform it could be possible. But if that was the case, I wouldn't imagine they would care or use ucd.
Here is the output from a clear instance on openstack
/dev/disk:
total 0
drwxr-xr-x 7 root root 140 Aug 28 17:39 .
drwxr-xr-x 17 root root 3160 Aug 28 17:39 ..
drwxr-xr-x 2 root root 60 Aug 28 17:39 by-id
drwxr-xr-x 2 root root 80 Aug 28 17:39 by-partlabel
drwxr-xr-x 2 root root 80 Aug 28 17:39 by-partuuid
drwxr-xr-x 2 root root 180 Aug 28 17:39 by-path
drwxr-xr-x 2 root root 80 Aug 28 17:39 by-uuid
/dev/disk/by-id:
total 0
drwxr-xr-x 2 root root 60 Aug 28 17:39 .
drwxr-xr-x 7 root root 140 Aug 28 17:39 ..
lrwxrwxrwx 1 root root 9 Aug 28 17:39 ata-QEMU_DVD-ROM_QM00001 -> ../../sr0
/dev/disk/by-partlabel:
total 0
drwxr-xr-x 2 root root 80 Aug 28 17:39 .
drwxr-xr-x 7 root root 140 Aug 28 17:39 ..
lrwxrwxrwx 1 root root 10 Aug 28 17:39 EFI -> ../../vda1
lrwxrwxrwx 1 root root 10 Aug 28 17:39 '\x2f' -> ../../vda2
/dev/disk/by-partuuid:
total 0
drwxr-xr-x 2 root root 80 Aug 28 17:39 .
drwxr-xr-x 7 root root 140 Aug 28 17:39 ..
lrwxrwxrwx 1 root root 10 Aug 28 17:39 9b3d7703-01d1-441f-bfc3-8482a362e058 -> ../../vda2
lrwxrwxrwx 1 root root 10 Aug 28 17:39 9cc084f0-d922-44d3-859e-cb56e98bd51f -> ../../vda1
/dev/disk/by-path:
total 0
drwxr-xr-x 2 root root 180 Aug 28 17:39 .
drwxr-xr-x 7 root root 140 Aug 28 17:39 ..
lrwxrwxrwx 1 root root 9 Aug 28 17:39 pci-0000:00:01.1-ata-1 -> ../../sr0
lrwxrwxrwx 1 root root 9 Aug 28 17:39 pci-0000:00:04.0 -> ../../vda
lrwxrwxrwx 1 root root 10 Aug 28 17:39 pci-0000:00:04.0-part1 -> ../../vda1
lrwxrwxrwx 1 root root 10 Aug 28 17:39 pci-0000:00:04.0-part2 -> ../../vda2
lrwxrwxrwx 1 root root 9 Aug 28 17:39 virtio-pci-0000:00:04.0 -> ../../vda
lrwxrwxrwx 1 root root 10 Aug 28 17:39 virtio-pci-0000:00:04.0-part1 -> ../../vda1
lrwxrwxrwx 1 root root 10 Aug 28 17:39 virtio-pci-0000:00:04.0-part2 -> ../../vda2
/dev/disk/by-uuid:
total 0
drwxr-xr-x 2 root root 80 Aug 28 17:39 .
drwxr-xr-x 7 root root 140 Aug 28 17:39 ..
lrwxrwxrwx 1 root root 10 Aug 28 17:39 12FE-150D -> ../../vda1
lrwxrwxrwx 1 root root 10 Aug 28 17:39 f92a94e9-c552-474b-8454-9766f43f59d8 -> ../../vda2
Well, micro-config-drive isn't just for openstack, so, we have to assume it may run almost everywhere.
Here is the output from a clear instance on openstack
I see sr0
but nothing labeled config-2
... what does lsblk
say?
root@test/home/clear # blkid
/dev/vda1: UUID="12FE-150D" TYPE="vfat" PARTLABEL="EFI" PARTUUID="9cc084f0-d922-44d3-859e-cb56e98bd51f"
/dev/vda2: UUID="f92a94e9-c552-474b-8454-9766f43f59d8" TYPE="ext4" PARTLABEL="/" PARTUUID="9b3d7703-01d1-441f-bfc3-8482a362e058"
/dev/sr0: UUID="2019-08-28-17-39-11-00" LABEL="config-2" TYPE="iso9660"
root@test/home/clear # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 470K 0 rom
vda 254:0 0 20G 0 disk
├─vda1 254:1 0 63M 0 part
└─vda2 254:2 0 20G 0 part /
abandon in favor of udev rules
This patch is to require ucd to start and also bring it up later in the boot process.