[rhelv6-list] How can I uniquely identify my disk in RHEL6 installed on Citrix Xenserver?

John Haxby john.haxby at gmail.com
Fri Oct 19 07:38:50 UTC 2012


On 19 October 2012 07:32, neo3 matrix <neo3matrix at gmail.com> wrote:

> Hi all,
>
> I have installed RHEL6 as guest OS on Citrix Xen Server. After
> installation of OS, I can see disk names as /dev/xvda, /dev/xvdb instead of
> traditional convention like /dev/sda, /dev/sdb on guest OS.
>
> Generally, on physical machines, in /proc/scsi/scsi file, we get a unique
> entry for every disk connected to the system. For e.g. string
> "scsi02:00:00:01" indicates that this disk is connected to the machine via
> Host=2, Channel=00, Id=00 Lun=01. This helps me in my project to uniquely
> identify each and every disk in scenarios where many times after reboot OR
> in SAN boot cases OR in some Disaster Recovery procedures, disk names might
> change from say /dev/sda to /dev/sdb after reboot. But, this
> Host:Channel:ID:Lun combination remains same for every disk and I can
> uniquely identify the disks though their /dev/sd* names have changed.
>
> For my project, on Citrix Xenserver, I need to know the unique disk
> location for such Xen guest OS devices by which I can easily identify disks
> across the reboots for the above mentioned cases.
>
>

Oooh.   Complicated question.

To start with, those SCSI-type disk identifiers are not as deterministic as
you might hope.  "Host=2" merely refers to the SCSI controller that was
discovered at position number 2.   These days, discovery order counts for
nothing: devices are discovered and initialised concurrently, more or less,
so while you might get devices discovered in the "right" order almost all
the time, you might find that powering on a machine on a particularly cold
morning changes the order in which things are discovered.   Even worse, if
what used to be /dev/sdb goes AWOL then you're not left with a hole in the
sequence, everything from what used to be /dev/sdc onwards gets renamed.

The good news with Xen disks is that they really do have deterministic
slots.   The virtual disk in slot xvdb will always be xvdb (the "vbd-NNN"
numbers simply refer to event channels, they aren't random but they might
as well be).  You would need to edit the VM definition in the host to
change the virtual disks.

Even more good news: you don't need to use the /dev/sdX, /dev/xvdX, etc
names at all.

If you look in /dev/disk you'll find several directories.  The one you're
probably most interested in is /dev/disk/by-uuid: entries in /etc/fstab
should be using the UUID= format to identify things that aren't logical
volumes (logical volumes are named within their volume group and the
physical volumes that make up a volume group aren't tied to specific
devices although they do have specific UUIDs).

Running "blkid" (as root) is quite useful as well.

jch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhelv6-list/attachments/20121019/a26c47be/attachment.htm>


More information about the rhelv6-list mailing list