Abstract
The following articles explains how to rename disk Agile View Device Special Files for HP-UX 11i v3 Service Guard environment. The introduction of Agile Addressing on HP-UX 11.31 adds new challenges to the old problem of keeping the device special files naming in-sync between ServiceGuard nodes. The co-existence of Agile and Legacy device special files adds a new layer to the problem.
Agile Device Special file name is tighly based on the Device Instance number assigned to the Agile Device H/W Path. That situation mades keeping devices naming in sync on a Service Guard environment somewhat more complex that in the past.
Contents[hide] |
Introduction to Agile and Legacy Device Special File instance numbering
On HP-UX 11i v3 by default, two naming conventions coexists for the disk device class: Agile and Legacy Views.
Legacy
# ioscan -fnkC disk Class I H/W Path Driver S/W State H/W Type Description ======================================================================= disk 5 0/0/3/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-N /dev/dsk/c0t0d0 /dev/rdsk/c0t0d0 disk 0 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/dsk/c2t1d0 /dev/rdsk/c2t1d0 disk 1 0/1/1/0.8.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/dsk/c2t8d0 /dev/rdsk/c2t8d0 disk 2 0/1/1/0.10.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/dsk/c2t10d0 /dev/rdsk/c2t10d0 disk 3 0/1/1/0.12.0 sdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/dsk/c2t12d0 /dev/rdsk/c2t12d0 disk 4 0/1/1/1.0.0 sdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/dsk/c3t0d0 /dev/rdsk/c3t0d0
Agile
# ioscan -fnkNC disk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 6 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk6 /dev/rdisk/disk6 disk 7 64000/0xfa00/0x1 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk7 /dev/rdisk/disk7 disk 9 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk9 /dev/rdisk/disk9 disk 8 64000/0xfa00/0x3 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk8 /dev/rdisk/disk8 disk 10 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk10 /dev/rdisk/disk10 disk 11 64000/0xfa00/0x5 esdisk CLAIMED DEVICE TEAC DV-28E-N /dev/disk/disk11 /dev/rdisk/disk11
Agile to Legacy Device Mapping
# ioscan -m dsf Persistent DSF Legacy DSF(s) ======================================== /dev/rdisk/disk6 /dev/rdsk/c2t1d0 /dev/rdisk/disk7 /dev/rdsk/c2t8d0 /dev/rdisk/disk8 /dev/rdsk/c2t10d0 /dev/rdisk/disk9 /dev/rdsk/c2t12d0 /dev/rdisk/disk10 /dev/rdsk/c3t0d0 /dev/rdisk/disk11 /dev/rdsk/c0t0d0
- Legacy device instance (I) number assignment has precedence over Agile. At system cold-install, the Legacy devices will get assigned the lower instance numbers while the Agile devices will start from the last legacy instance.
- The Agile device name is based on the instance number assigned. This mean that /dev/disk/diskn will have the n instance number.
- Adding additional disk devices, will assigned new instance number to the Legacy devices first and to the Agile devices second.
- Co-existence of both naming schemes is required for backward compatibility with HP-UX releases prior to 11i v3, mainly to support Upgrade-UX.
Due to this fact, is very common when managing large SAN deployments, where each disk has several Legacy Device Special Files associated according to the number of paths, that the Instance Number asigned to the Agile devices reach into the hundreds.
In strict sense, Logical Volume Manager and VxVM handle their respectively Physical Volumes or Disks based on metadata headers place on the actual LUNs, so ther is no technical requirement for the Device Special Files to share the device special file name across the different nodes.
The drawback of keeping different names across the nodes is the added complexity to device identification and day to day management.
Configuration Best Practices
These best practices applies for new installations, were there is no need to keep Legacy Addressing in place. On systems upgraded using Update-UX, migrating the LVM volume group or VxVM diskgroup configuration to Agile Addressing is a prerequiste to Agile Device renumbering.
- Install HP-UX 11i v3 only with the minimal required storage attach to it: a single internal boot disk and DVD.
- Disable Legacy View immediately after system installation and before adding any additional storage.
- Restrict adding new storage, like JBODS or SAN Luns one device or source at a time.
- Use ioinit command to maintain the desired naming scheme. Is common practice, to reserve the first ten (0-15) instance numbers to the system internal or boot devices and those above for external storage device special files. Another common layout is numbering the storage SAN storage devices starting from instance 100.
Day One Agile Device Renaming
The following example explains the execution of this previous best practices after installing the HP-UX 11i v3 Operating System in a system using Logical Volume Manage (LVM).
The external storage was connect at the of the Operating System installation to add additional complexity, that is a common scenario and will allow the opportunity to show to change the instance numbers operates on more than a couple of devices.
Check again the previous output for the system. This server (rp4440) has one internal DVD, two internal drives and three external disks on a DS2100 (JBOD). The Legacy devices occupy instances 0 to 5 while the Agile occupy instances 6 to 11.
The objective is to remove the Legacy devices and renumber the agile devices beginning from instance 0.
After this change has been done, additional information is provided in how to move the device special file to higher numbers.
Disable Legacy View
1. Confirm that no other volume group besides /dev/vg00 are on the system. On new installation when the previous guidelines were followed, that will be the case, but this procedure may be adapted to re-layout a more complex deployment.
LVM and VxVM volume group export or deport procedure can be follow to move the volumes to the new disk schemes. Currently, only LVM is shown in this article.
For example:
# strings /etc/lvmtab | grep dev /dev/vg00 /dev/disk/disk6 # strings /etc/lvmtab_p | grep dev
Take note that the current boot physical volume in this sysgtem configuration is /dev/disk/disk6.
2. Use rmf -L command to remove all the legacy devices.
# rmsf -L WARNING: This command may be disruptive to the system. Before running this command, make sure you have first run iofind(1M) and migrated all applications using legacy device special files. Please refer to the man page of rmsf(1M) to verify the possible side effects of the option '-L'. Do you want to continue ? (You must respond with 'y' or 'n'.): y rmsf: Legacy mode has been successfully disabled
3. Confirm that Legacy device special files has been disable.
# ioscan -fnkC disk
Note that no output should be displayed.
4. Check the Agile Device special files.
# ioscan -NfnkC disk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 6 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk6 /dev/rdisk/disk6 disk 7 64000/0xfa00/0x1 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk7 /dev/rdisk/disk7 disk 9 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk9 /dev/rdisk/disk9 disk 8 64000/0xfa00/0x3 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk8 /dev/rdisk/disk8 disk 10 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk10 /dev/rdisk/disk10 disk 11 64000/0xfa00/0x5 esdisk CLAIMED DEVICE TEAC DV-28E-N /dev/disk/disk11 /dev/rdisk/disk11
5. Use the ioinit -rC disk to reorder the instance number. This will reboot the system.
6. Boot in LVM Maintenance Mode.
7. In LVM Maintenance Mode, verify that the changes were done to the instance numbers.
# ioscan -NfnkC disk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 0 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk6 /dev/rdisk/disk6 disk 1 64000/0xfa00/0x1 esdisk CLAIMED DEVICE TEAC DV-28E-N /dev/disk/disk7 /dev/rdisk/disk7 disk 2 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk8 /dev/rdisk/disk8 disk 3 64000/0xfa00/0x3 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk9 /dev/rdisk/disk9 disk 4 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk10 /dev/rdisk/disk10 disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk11 /dev/rdisk/disk11
Note that while the instance numbers has been reordered, the device special files still points to the former device special files.
8. Recreate the device special files using insf -e.
# insf -e insf: Installing special files for asio0 instance 0 address 0/0/1/0 insf: Installing special files for asio0 instance 1 address 0/0/1/1 insf: Installing special files for ipmi instance 0 address 16 insf: Installing special files for side instance 0 address 0/0/3/0.0 insf: Installing special files for side instance 1 address 0/0/3/0.1 insf: Installing special files for mpt instance 2 address 0/1/1/0 insf: Installing special files for mpt instance 3 address 0/1/1/1 insf: Installing special files for fcd instance 0 address 0/4/1/0/4/0 insf: Installing special files for esdisk instance 0 address 64000/0xfa00/0x0 insf: Installing special files for esdisk instance 1 address 64000/0xfa00/0x1 insf: Installing special files for esdisk instance 2 address 64000/0xfa00/0x2 insf: Installing special files for esdisk instance 3 address 64000/0xfa00/0x3 insf: Installing special files for esdisk instance 4 address 64000/0xfa00/0x4 insf: Installing special files for esdisk instance 5 address 64000/0xfa00/0x5 insf: Installing special files for pseudo driver cn insf: Installing special files for pseudo driver arp insf: Installing special files for pseudo driver mm insf: Installing special files for pseudo driver devkrs insf: Installing special files for pseudo driver ptym insf: Installing special files for pseudo driver ptys insf: Installing special files for pseudo driver iomem insf: Installing special files for pseudo driver dmem insf: Installing special files for pseudo driver diag0 insf: Installing special files for pseudo driver ip insf: Installing special files for pseudo driver nuls insf: Installing special files for pseudo driver rawip insf: Installing special files for pseudo driver stcpmap insf: Installing special files for pseudo driver dev_config insf: Installing special files for pseudo driver strlog insf: Installing special files for pseudo driver sad insf: Installing special files for pseudo driver tcp insf: Installing special files for pseudo driver telm insf: Installing special files for pseudo driver tels insf: Installing special files for pseudo driver tlclts insf: Installing special files for pseudo driver tlcots insf: Installing special files for pseudo driver tlcotsod insf: Installing special files for pseudo driver udp insf: Installing special files for pseudo driver asyncdsk insf: Installing special files for pseudo driver echo insf: Installing special files for pseudo driver dlpi insf: Installing special files for pseudo driver ptm insf: Installing special files for pseudo driver pts insf: Installing special files for pseudo driver beep insf: Installing special files for pseudo driver framebuf insf: Installing special files for pseudo driver diag1 insf: Installing special files for pseudo driver klog insf: Installing special files for pseudo driver sy insf: Installing special files for pseudo driver kepd insf: Installing special files for pseudo driver diag2 insf: Installing special files for pseudo driver root insf: Installing special files for pseudo driver escsi
# ioscan -NfnkC disk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 0 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk0 /dev/rdisk/disk0 /dev/disk/disk6 /dev/rdisk/disk6 disk 1 64000/0xfa00/0x1 esdisk CLAIMED DEVICE TEAC DV-28E-N /dev/disk/disk1 /dev/rdisk/disk1 /dev/disk/disk7 /dev/rdisk/disk7 disk 2 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk2 /dev/rdisk/disk2 /dev/disk/disk8 /dev/rdisk/disk8 disk 3 64000/0xfa00/0x3 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk3 /dev/rdisk/disk3 /dev/disk/disk9 /dev/rdisk/disk9 disk 4 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk10 /dev/rdisk/disk10 /dev/disk/disk4 /dev/rdisk/disk4 disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk11 /dev/rdisk/disk11 /dev/disk/disk5 /dev/rdisk/disk5
Note that two sets of device special files will be assigned to each physical volume.
9. Export /dev/vg00 and import back using the new device special file, /dev/disk/disk0 in this example:
# vgexport -p -s -m /vg00.map /dev/vg00 vgexport: Preview of vgexport on volume group "/dev/vg00" succeeded. # cat /vg00.map VGID 1e69dc324ad20b84 1 lvol1 2 lvol2 3 lvol3 4 lvol4 5 lvol5 6 lvol6 7 lvol7 8 lvol8 9 lvol9 11 lvlog # vgexport /dev/vg00 vgexport: Volume group "/dev/vg00" has been successfully removed. # mkdir -m 755 /dev/vg00 # mknod /dev/vg00/group c 64 0x000000 # vgimport -m /vg00.map /dev/vg00 /dev/disk/disk0 vgimport: Volume group "/dev/vg00" has been successfully created. Warning: A backup of this volume group may not exist on this machine. Please remember to take a backup using the vgcfgbackup command after activating the volume group. Also, upon first activation of an imported bootable volume group, make sure to run lvlnboot(1M) command in recovery mode (-R option) to resync the information on the disk # vgchange -a y /dev/vg00 Activated volume group. Volume group "/dev/vg00" has been successfully changed. # vgcfgbackup /dev/vg00 Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
10. Remove old device special files:
# rm /dev/*disk/disk6 # rm /dev/*disk/disk7 # rm /dev/*disk/disk8 # rm /dev/*disk/disk9 # rm /dev/*disk/disk10 # rm /dev/*disk/disk11
11. Check current ioscan output:
# ioscan -NfnkC disk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 0 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk0 /dev/rdisk/disk0 disk 1 64000/0xfa00/0x1 esdisk CLAIMED DEVICE TEAC DV-28E-N /dev/disk/disk1 /dev/rdisk/disk1 disk 2 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk2 /dev/rdisk/disk2 disk 3 64000/0xfa00/0x3 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk3 /dev/rdisk/disk3 disk 4 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk4 /dev/rdisk/disk4 disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk5 /dev/rdisk/disk5
Note that now the instance numbers match the device special file names.
12. Reboot the server and ensure that everything works as desired.
# vgchange -a n /dev/vg00 Volume group "/dev/vg00" has been successfully changed. # reboot -q ERROR: The kernel configuration changes being held for next boot could not be applied due to a file system error. sync'ing disks (0 buffers to flush): 0 fcache pages still dirty 0 buffers not flushed 0 buffers still dirty Calling function 5c9860 for Shutdown State 5 type 0x1 Closing oen logical volumes... Done
13. Update /stand/bootconf file to reflect that /dev/disk/disk0 has become the boot disk device.
Set custom Instance Numbers
On ServiceGuard environments, it is frequently required to change the disk Instance Number and the corresponding Device Special File to have a consistent disk configuration across multiple nodes.
To accomplish this task, usage of a infile with the ioinit command may be required.
For example, assume that in previous example, the Agile device for devices disk2, disk3 and disk4 are desired to be renumber to 100 + n above, to clearly identified SAN devices.
# ioscan -NfnkC disk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 0 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk0 /dev/rdisk/disk0 disk 1 64000/0xfa00/0x1 esdisk CLAIMED DEVICE TEAC DV-28E-N /dev/disk/disk1 /dev/rdisk/disk1 disk 2 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk2 /dev/rdisk/disk2 disk 3 64000/0xfa00/0x3 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk3 /dev/rdisk/disk3 disk 4 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk4 /dev/rdisk/disk4 disk 5 64000/0xfa00/0x5 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk5 /dev/rdisk/disk5
1. Create an infile
# ioscan -fnkNC disk | grep -e ^disk -e /dev > /tmp/ioscan.out # awk '$1 ~ /^disk/ {printf "%s\tdisk\t%d\n", $3, $2}' /tmp/ioscan.out > /tmp/infile # cat /tmp/infile 64000/0xfa00/0x0 disk 0 64000/0xfa00/0x1 disk 1 64000/0xfa00/0x2 disk 2 64000/0xfa00/0x3 disk 3 64000/0xfa00/0x4 disk 4 64000/0xfa00/0x5 disk 5
2. Modify the infile to reflect the desire change.
# cat /tmp/infile 64000/0xfa00/0x0 disk 0 64000/0xfa00/0x1 disk 1 64000/0xfa00/0x2 disk 2 64000/0xfa00/0x3 disk 103 64000/0xfa00/0x4 disk 104 64000/0xfa00/0x5 disk 105
3. Use ionit command to load the modified infile. Use the -A flag to automatically delete the old device special files.
# ioinit -f /tmp/infile -A ioinit: Input is identical to kernel, line ignored Input line 1: 64000/0xfa00/0x0 disk 0 ioinit: Input is identical to kernel, line ignored Input line 2: 64000/0xfa00/0x1 disk 1 ioinit: Input is identical to kernel, line ignored Input line 3: 64000/0xfa00/0x2 disk 2 # ioscan -NfnkC disk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 0 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk0 /dev/rdisk/disk0 disk 1 64000/0xfa00/0x1 esdisk CLAIMED DEVICE TEAC DV-28E-N /dev/disk/disk1 /dev/rdisk/disk1 disk 2 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk2 /dev/rdisk/disk2 disk 103 64000/0xfa00/0x3 esdisk CLAIMED DEVICE HP 36.4GST336753LC /dev/disk/disk103 /dev/rdisk/disk103 disk 104 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk104 /dev/rdisk/disk104 disk 105 64000/0xfa00/0x5 esdisk CLAIMED DEVICE HP 36.4GST336754LC /dev/disk/disk105 /dev/rdisk/disk105
NOTE: The -A flag in the ionit command required that at least PHCO_38062 - "11.31 ioinit(1M) cumulative patch" is installed in the system to handle the device file renaming operation.
4. Reboot the system to ensure that the changes are preserve.
NOTE: From this moment, every time that a new disk or LUN is presented to the server, the lowest next available instance number will be assigned to it. Repeat this procedure, limited to the new device, to maintain the naming scheme that best suits your environment
0 comments:
Post a Comment