Operating System - Linux
1753792 Members
3994 Online
108799 Solutions
New Discussion

Linux VM on ESXi -- RDM Disks - Persistent Naming

 
Alzhy
Honored Contributor

Linux VM on ESXi -- RDM Disks - Persistent Naming

Bonjour.. Long Time no Post!

 

We are starting to run "LARGE" Linux Virtual Servers on ESXi 5.0 (why not KVM or RHEV? different story).  And we are using RDM Physical Disks -- so the SAN LUNS are aactually seen as if they are native disks...

 

scsi_id returns the WWID

SAN Array tools work - i.e. xpinfo (or p900info), evainfo, etc.

 

Of course multipathing is handled by ESXi -- so for no matter how many paths the SAN LUN has - the Linux Virtual sees just one LUN. And we have a requirement to have persistent naming just like what can be achieved via device-mapper-multipath where in via /etc/multipath.conf - our SAN LUNS can be aliased to have descriptive and persistent names and ownerships even.

 

I thought of installing device-mapper-multipath as a Quick n' Easy fix, each multipath will of course have only one sub-path and we can still peruse /etc/multipath.conf as if the server is a Physical Linux server. But I think this is really unnecessary as multipathd just adds another layer of complexity, overhead (?)  and possibly even a bit of a drag to the OS' storage stack.

 

So my question is - is there any way we can do persistent device names to RDM (raw device mapped)  Physical disks in Linux as an ESXi Virtual Server?

 

As I said earlier, scsi_id works - so we can actually identify the WWIDs of each RDM disk:

 

]# scsi_id -g -u -s /block/sdd
360060e8004753f000000753f0000292a

 

I want to have entries for each /dev/sd? in /dev/mapper/SAPDISK00N - just like what we can achieve via device-mapper-multipath. If this means writing UDEV rules -- can soeone point me to resources or an example/quick-through on how this is done?

 

Graci!

 


 

Hakuna Matata.
1 REPLY 1
Alzhy
Honored Contributor

Re: Linux VM on ESXi -- RDM Disks - Persistent Naming

Verify the presented is RDM'd correctly bey getting the WWID of the LUN:

 

/sbin/scsi_id  -g -u -s /block/sdc

 

 

If it returns the WWID -- then it means it is properly RDM'd (physical) to the ESXi virtual Linux Server.

 

In /etc/udev/rules.d: create a rules file named say 99-oracle-asm-disks.rules:

 

KERNEL=="sd*", SYSFS{vendor}=="HP", PROGRAM=="/sbin/scsi_id -g -u -s /block/%k ", RESULT=="360060e8004753f000000753f0000108b", NAME="mapper/OEMDBDISK01", OWNER="oracle", GROUP="dba", MODE="644", RUN+="/bin/bash -c '/sbin/kpartx -a -p p /dev/mapper/OEMDBDISK01'"

 

 

root# udevtest /block/sdc

]# udevtest /block/sdc

main: looking at device '/block/sdc' from subsystem 'block'

run_program: '/lib/udev/usb_id -x'

run_program: '/lib/udev/usb_id' returned with status 1

run_program: '/lib/udev/scsi_id -g -x -s /block/sdc -d /dev/.tmp-8-32'

run_program: '/lib/udev/scsi_id' (stdout) 'ID_VENDOR=HP'

run_program: '/lib/udev/scsi_id' (stdout) 'ID_MODEL=OPEN-V'

run_program: '/lib/udev/scsi_id' (stdout) 'ID_REVISION=5001'

run_program: '/lib/udev/scsi_id' (stdout) 'ID_SERIAL=360060e8004753f000000753f0000108b'

run_program: '/lib/udev/scsi_id' (stdout) 'ID_TYPE=disk'

run_program: '/lib/udev/scsi_id' (stdout) 'ID_BUS=scsi'

run_program: '/lib/udev/scsi_id' returned with status 0

udev_rules_get_name: add symlink 'disk/by-id/scsi-360060e8004753f000000753f0000108b'

run_program: '/lib/udev/path_id /block/sdc'

run_program: '/lib/udev/path_id' (stdout) 'ID_PATH=pci-0000:00:10.0-scsi-0:0:2:0'

run_program: '/lib/udev/path_id' returned with status 0

udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:10.0-scsi-0:0:2:0'

run_program: '/lib/udev/vol_id --export /dev/.tmp-8-32'

run_program: '/lib/udev/vol_id' returned with status 4

run_program: '/lib/udev/edd_id --export /dev/.tmp-8-32'

run_program: '/lib/udev/edd_id' (stderr) 'no kernel EDD support'

run_program: '/lib/udev/edd_id' returned with status 2

run_program: '/sbin/scsi_id -g -u -s /block/sdc '

run_program: '/sbin/scsi_id' (stdout) '360060e8004753f000000753f0000108b'

run_program: '/sbin/scsi_id' returned with status 0

udev_rules_get_name: rule applied, 'sdc' becomes 'mapper/OEMDBDISK01'

udev_device_event: device '/block/sdc' already in database, validate currently present symlinks

udev_node_add: creating device node '/dev/mapper/OEMDBDISK01', major = '8', minor = '32', mode = '0644', uid = '30181', gid = '200'

udev_node_add: creating symlink '/dev/disk/by-id/scsi-360060e8004753f000000753f0000108b' to '../../mapper/OEMDBDISK01'

udev_node_add: creating symlink '/dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:2:0' to '../../mapper/OEMDBDISK01'

main: run: 'socket:/org/kernel/udev/monitor'

main: run: '/lib/udev/udev_run_devd'

main: run: 'socket:/org/freedesktop/hal/udev_event'

main: run: '/sbin/pam_console_apply /dev/mapper/OEMDBDISK01 /dev/disk/by-id/scsi-360060e8004753f000000753f0000108b /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:2:0'

main: run: '/bin/bash -c '/sbin/kpartx -a -p p /dev/mapper/OEMDBDISK01''

 

 

Enshrine, load and activate the rule:

 

[root@flpva030 /root]# udevcontrol reload_rules

[root@flpva030 /root]# start_udev

 

You will NOW have /dev/mapper/ entiries aptly permissioned say for Oracle DB ASM use.

 


 

Hakuna Matata.