From https://bugs.launchpad.net/fuel/+bug/1262973
The problem is after deployment changed disks naming
Before deployment it looked good
[
{
"disk": "disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0",
"model": "ST3160815AS",
"size": 160041885696,
"name": "sda"
},
{
"disk": "disk/by-path/pci-0000:00:1f.2-scsi-2:0:0:0",
"model": "ST2000DM001-1CH1",
"size": 2000398934016,
"name": "sdc"
},
{
"disk": "disk/by-path/pci-0000:00:1f.2-scsi-1:0:0:0",
"model": "ST2000DM001-1CH1",
"size": 2000398934016,
"name": "sdb"
}
]
But after deployment format was changed
[
{
"model": "ST2000DM001-1CH1",
"disk": "sdc",
"size": 2000398934016,
"name": "sdc"
},
{
"model": "ST2000DM001-1CH1",
"disk": "sdb",
"size": 2000398934016,
"name": "sdb"
},
{
"model": "ST3160815AS",
"disk": "disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0",
"size": 160041885696,
"name": "sda"
}
]
We use `disk` as uniq disk identificator in nailgun.
Name like sdb\sdc in `disk` field use in case if disk wasn't found in /dev/disk/by-path
See https://github.com/stackforge/fuel-web/blob/master/bin/agent#L249-L253
xdeller@ ubuntuprecise: /sys$ find . -name vda pci0000: 00/0000: 00:05.0/ virtio2/ block/vda
./devices/
./block/vda
./class/block/vda
Useful subfiles are: pci0000: 00/0000: 00:03.0/ virtio0/ vendor)
size
vendor(available only under address-based path: /sys/devices/
As I mentioned we can use sysfs-based discovery. Is there any additional hints which may be useful for implementation?