[fedora-virt] uniquely identifying drives in virt configurations
Daniel P. Berrange
berrange at redhat.com
Thu Feb 4 10:23:46 UTC 2010
On Wed, Feb 03, 2010 at 07:54:05PM -0500, Bill McGonigle wrote:
> Hi, all,
>
> I'm wondering what folks are doing for uniquely identifying plain disks
> in their virtual machine configs.
>
> For instance, I'm trying out the new Xen version and stuck a couple SATA
> drives in a box. I'd like to use them as physical devices, but not
> break my vm config if I re-cable the drives (or move them to another
> machine).
>
> I could create a degraded RAID mirror, and then reference them by mdX
> and let md worry about the UUID's, but that's ugly. If I were using
> luks on the drives they'd get tagged and could be referenced uniquely.
> Same with iscsi, those are available uniquely under /sys.
>
> Maybe something with device mapper? But I'm actually interested in
> benchmarking ZFS through Xen with this, so I'd hate to add another layer
> just for this purpose, since it's only needed at setup time. I could
> script some ugly hacks but I'd rather not.
>
> I was hoping to find a /sys/block/scsi/model/serialnumber type of thing
> symlinked back to the ../../devices/pci... , but I didn't. So, I hope
> I'm missing something obvious and folks here have this solved.
I suspect you are looking for /dev/disk/by-id whcih gives you a stable
links based on model/serial number details
$ ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx. 1 root root 9 2010-02-03 18:04 ata-HTS721010G9SA00_MPCZ12Y0GNGWSE -> ../../sda
lrwxrwxrwx. 1 root root 10 2010-02-03 18:04 ata-HTS721010G9SA00_MPCZ12Y0GNGWSE-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 2010-02-03 18:04 ata-HTS721010G9SA00_MPCZ12Y0GNGWSE-part2 -> ../../sda2
lrwxrwxrwx. 1 root root 9 2010-02-03 18:04 scsi-SATA_HTS721010G9SA00_MPCZ12Y0GNGWSE -> ../../sda
lrwxrwxrwx. 1 root root 10 2010-02-03 18:04 scsi-SATA_HTS721010G9SA00_MPCZ12Y0GNGWSE-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 2010-02-03 18:04 scsi-SATA_HTS721010G9SA00_MPCZ12Y0GNGWSE-part2 -> ../../sda2
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the virt
mailing list