Wednesday, 20 August 2008

Some npar commands

Which npar am I on?
SD32npar:/ # parstatus -w
The local partition number is 1.


What's the 'domes serial number?
SD32npar:/ # parstatus -X
[Complex]
Complex Name : Complex 1
Complex Capacity
Compute Cabinet (8 cell capable) : 1
IO Expansion Cabinet : 1
Active MP Location : cabinet 0
Model : 9000/800/SD32A
Original Serial Number : DEHXXXXJX
Current Product Order Number : A5201A
Original Manufacturer : HP
Complex Profile Revision : 1.0
The total number of partitions present : 2

Translating OS device paths to physical paths on a Superdome

I want to eyeball two network cards to see why they're down

SD32npar1:/ # lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
4/0/12/1/0/6/0 0x00110A42AC64 0 UP lan0 snap0 1 ETHER Yes 119
5/0/6/1/0/6/0 0x00110A428C82 2 DOWN lan2 snap2 3 ETHER Yes 119
5/0/6/1/0/6/1 0x00110A428C83 3 DOWN lan3 snap3 4 ETHER Yes 119


Looking at the actual superdome didn't give anything marked like '5/0/6/1/0/6/1'

Here's an ioscan which doesn't help at all.

SD32npar1:/ # ioscan -kfnC lan
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
lan 0 4/0/12/1/0/6/0 iether CLAIMED INTERFACE HP AB290-60001 PCI/PCI-X 1000Base-T 2-port U320 SCSI/2-port 1000B-T Combo Adapter
lan 1 4/0/12/1/0/6/1 iether CLAIMED INTERFACE HP AB290-60001 PCI/PCI-X 1000Base-T 2-port U320 SCSI/2-port 1000B-T Combo Adapter
lan 2 5/0/6/1/0/6/0 iether CLAIMED INTERFACE HP AB290-60001 PCI/PCI-X 1000Base-T 2-port U320 SCSI/2-port 1000B-T Combo Adapter
lan 3 5/0/6/1/0/6/1 iether CLAIMED INTERFACE HP AB290-60001 PCI/PCI-X 1000Base-T 2-port U320 SCSI/2-port 1000B-T Combo Adapter


The magic command to find the actual devices is 'rad' (thanks to Andy Cassels)

SD32npar1:/ # rad -q
Driver(s)
Slot Path Bus Max Spd Pwr Occu Susp Capable Max Mode
Num Spd Mode
0-0-3-7 4/0/12/1 96 133 133 On Yes No Yes PCI-X PCI-X
0-0-3-8 4/0/11/1 88 133 133 On Yes No Yes PCI-X PCI-X
8-0-1-5 5/0/6/1 48 133 133 On Yes No Yes PCI-X PCI-X
8-0-1-6 5/0/14/1 112 133 133 On Yes No Yes PCI-X PCI-X

Friday, 11 July 2008

get_vgids

This script will get the VGID for the named volume group and it's PDs

#!/usr/bin/ksh

# find all the disks presented to the system that have the VGID of the named
# volume groups.
# This is helpful when you present the BCVs for a devicegroup that has
# a number of volume groups on it.

[[ $# -lt 1 ]] && echo "[FATAL]Must give one or more volume groups" && exit 1
[[ $(uname -s) != 'HP-UX' ]] && echo "[FATAL]Only works on Solaris" && exit 1

# get VGIDs from lvmtab
typeset _volume_groups="$@"
typeset _volume_group
typeset _offset
typeset _vg_path
typeset _vgid
typeset _vgid1
typeset _vgid2
typeset _disk
typeset _disk_vgid

# find the VGID of the volumes.
for _volume_group in $_volume_groups
do
_volume_group=$(basename $_volume_group)
strings -t d /etc/lvmtab | grep $_volume_group | read _offset _vg_path
if [[ -n "$_offset" && -n "$_vg_path" ]]; then
xd -An -j$(($_offset+1024)) -N8 -tuL /etc/lvmtab | grep -vE '^$'| read _vgid1 _vgid2
_vgid="${_vgid1}-${_vgid2}"
print $_vg_path $_vgid
# get VGIDs from PV
for _disk in /dev/rdsk/*
do
_size=$(diskinfo -b $_disk 2> /dev/null)
if [[ $_size -gt 0 ]]; then
_disk_vgid=$(xd -An -j8208 -N8 -tuL $_disk | awk '/[0-9]/ {print $1 "-" $2}')
if [[ "$_disk_vgid" = "$_vgid" ]]; then
print $_vg_path $_disk $_disk_vgid
fi
fi
done
else
print "[FATAL]Can't find $_volume_group in /etc/lvmtab"
fi
done

to add CPU and memory to a vpar


# Unix - Shutdown vpar the target vpar
shutdown -r -o now

# on another vpar in the complex
vparstatus > /var/tmp/vparstatus

# Unix - change cpu's from 4 to 5
vparmodify -p $target_vpar -m cpu::5

# Unix - Change physical memory from 12288 to 16384
vparmodify -p $target_vpar -m mem::16384

# Unix - startup vpar
vparboot -p $target_vpar

# back on $target_vpar
# Unix - check cpu is active and memory is there
# sam->Performance Monitors-> System Properties

lock / unlock account user id on HP-UX trusted system


# lock / unlock account user id on HP-UX trusted system
/usr/lbin/getprpw useraccount

# unlock / enable / reactivate:
/usr/lbin/modprpw -k useraccount

# lock / expire password:
/usr/lbin/modprpw -e useraccount

# Do not use a capital E, as it will expire the password on all user accounts.

to create a tape depot (as a file) from a real depot

Must be run locally to on the depot server

swpackage -d /tmp/SG_A.11.15.00.depot -x target_type=tape -s /tmp/Rel_11.15 B3935DA B7609BA B8324BA

show the current npar


# show the current npar

root@HP-cell_machine:/ # parstatus -w
The local partition number is 2.

# show info about that npa
root@HP-cell_machine:/ # parstatus -Vp 2
[Partition]
Partition Number : 2
Partition Name : Partition 2
Status : Active
IP Address :
Primary Boot Path : 5/0/1/1/0/4/0.10
Alternate Boot Path : 7/0/1/1/0/4/0.8.0
HA Alternate Boot Path : 0/0/0/0/0/0/0/0.0
PDC Revision : 22.3
IODCH Version : 88c0
Cell Architecture : PA-RISC
CPU Compatibility : 35008-PA
CPU Speed : 1100 MHz
Core Cell : cab0,cell5
Core Cell Choice [0] : cab0,cell5
Core Cell Choice [1] : cab0,cell7
Total Good Memory Size : 40.0 GB
Total Interleave Memory: 40.0 GB
Total Requested CLM : 0.0 GB
Total Allocated CLM : 0.0 GB