Archives For January 2010

vg00 mirroring

January 27, 2010 — 1 Comment

This is a small cookbook about mirroring the vg00 I’ve compiled throughout the years, well it’s really more like a list with the commands but I believe it can be of usefulness for some of the newbies out there. It covers HP-UX 11.23 for PA-RISC and 11.23 and 11.31 for IA64.

  • PA-RISC 11.23:

First initialize the disk.

root@ayane:/# pvcreate -f -B /dev/rdsk/c0t6d0

Now make the disk bootable writing the LIF header.

root@ayane:/# mkboot -l /dev/dsk/c0t6d0

And the LIF files, I’m using the unenforced quorum option because in my example the vg00 has only two PVs.

root@ayane:/# mkboot -a 'hpux -lq' /dev/dsk/c0t6d0

Add the new PV to vg00.

root@ayane:/# vgextend vg00 /dev/dsk/c0t6d0

Create the mirrors of the logical volumes within vg00 in the new PV.

root@ayane:/# for i in $(vgdisplay -v vg00 | grep "LV Name" | awk '{ print $3 };')
> do
> lvextend -m 1 $i /dev/dsk/c0t6d0
> done

When the mirror is finished.

root@ayane:/# lvlnboot -r /dev/vg00/lvol3 /dev/vg00
root@ayane:/# lvlnboot -b /dev/vg00/lvol1 /dev/vg00
root@ayane:/# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
root@ayane:/# lvlnboot -d /dev/vg00/lvol2 /dev/vg00

Specify the new disk as alternate boot path and add it to  /stand/bootconf.

root@ayane:/# setboot -a 0/0/0/3/0.6.0
root@ayane:/# cat /stand/bootconf
l  /dev/dsk/c0t5d0
l  /dev/dsk/c0t6d0
root@ayane:/#

And it’s done. To check that everything correct.

root@ayane:/# vgdisplay -v vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      10
Open LV                     10
Max PV                      16
Cur PV                      2
Act PV                      2
Max PE per PV               4384
VGDA                        4
PE Size (Mbytes)            32
Total PE                    8748
Alloc PE                    4076
Free PE                     4672
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

 --- Logical volumes ---
.
.
.
 --- Physical volumes ---
 PV Name                     /dev/dsk/c0t5d0
 PV Status                   available
 Total PE                    4374
 Free PE                     2336
 Autoswitch                  On
 Proactive Polling           On

 PV Name                     /dev/dsk/c0t6d0
 PV Status                   available
 Total PE                    4374
 Free PE                     2336
 Autoswitch                  On
 Proactive Polling           On

root@ayane:/#
root@ayane:/# lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
 /dev/dsk/c0t5d0 (0/0/0/3/0.5.0) -- Boot Disk
 /dev/dsk/c0t6d0 (0/0/0/3/0.6.0) -- Boot Disk
Boot: lvol1     on:     /dev/dsk/c0t5d0
                        /dev/dsk/c0t6d0
Root: lvol3     on:     /dev/dsk/c0t5d0
                        /dev/dsk/c0t6d0
Swap: lvol2     on:     /dev/dsk/c0t5d0
                        /dev/dsk/c0t6d0
Dump: lvol2     on:     /dev/dsk/c0t5d0, 0

root@ayane:/#
root@ayane:/# setboot
Primary bootpath : 0/0/0/3/0.6.0
HA Alternate bootpath : 0/0/0/0/0.0.0
Alternate bootpath : 0/0/0/3/0.5.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)

root@ayane:/#
root@ayane:/# lifls -l /dev/dsk/c0t6d0
volume ISL10 data size 7984 directory size 8 05/09/22 09:37:09
filename   type   start   size     implement  created
===============================================================
HPUX       -12928 584     1024     0          06/10/27 14:23:07
ISL        -12800 1608    242      0          05/09/22 09:37:09
AUTO       -12289 1856    1        0          05/09/22 09:37:09
PAD        -12290 1864    1468     0          05/09/22 09:37:09
LABEL      BIN    3336    8        0          07/07/17 19:42:29
root@ayane:/#
  • Itanium 11.23:

The procedure of mirroring the vg00 in an Itanium HP-UX 11.23, although shares some part with the PA-RISC differs in some critical area. The main difference is the partitioning of the disk, the boot disks in an Integrity server must have an specific layout with three paritions:

  1. EFI
  2. HPUX
  3. HPSP (HP Service Partition)

Preparation of the disk:

root@asoka:/# touch /tmp/partitionfile
root@asoka:/# cat <<EOF >> /tmp/partitionfile
> 3
> EFI 500MB
> HPUX 100%
> HPSP 400MB
> EOF
root@asoka:/# cat partitionfile
3
EFI 500MB
HPUX 100%
HPSP 400MB
root@asoka:/#
root@asoka:/# idisk -wqf /tmp/partitionfile /dev/rdsk/c1t1d0

Make it bootable and copy the AUTO file. As it can be viewed in the example below an s<number_of_partition> has been added to the device in order to identify the partition in which the operation will be executed.

root@asoka:/# insf -eCdisk
root@asoka:/# mkboot -e -l /dev/rdsk/c1t1d0
root@asoka:/# echo "boot vmunix -lq" >> /tmp/AUTO.lq
root@asoka:/# efi_cp -d /dev/rdsk/c1t1d0s1 /tmp/AUTO.lq /EFI/HPUX/AUTO

Create the HPSP partition.

root@asoka:/# dd if=/dev/rdsk/c0t1d0s3 of=/dev/rdsk/c1t1d0s3 bs=1024k

Like in PA-RISC initialize the PV and add it to the VG.

root@asoka:/# pvreate -f -B /dev/rdsk/c1t1d0s2
root@asoka:/# vgextend vg00 /dev/dsk/c1t1d0s2

Mirror the Logical Volumes.

root@asoka:/# for i in $(vgdisplay -v vg00 | grep "LV Name" | awk '{ print $3 };')
> do
> lvextend -m 1 $i /dev/dsk/c1t1d0s2
> done

Set the content of the LABEL file, edit the /stand/bootconf like in the PA-RISC procedure and add the new disk as alternate HA bootpath.

root@asoka:/# setboot -h <HW_PATH>

To check that everything is properly configured you can use the same commands as in PA-RISC and the command idisk to check the correct partitioning of the disk.

root@asoka:/# idisk -p /dev/rdsk/c1t1d0
idisk version: 1.32

EFI Primary Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0xa498de56
        MyLbaLo                   = 0x1
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x88aacbf
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x22
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x88aac9c
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 24e8312a-20cf-11dd-8001-d6217b60e588
        PartitionEntryLbaLo       = 0x2
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0xae99dcc3

  Primary Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 24e83378-20cf-11dd-8002-d6217b60e588
        Starting Lba Lo            = 0x22
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xfa021
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 24e83396-20cf-11dd-8003-d6217b60e588
        Starting Lba Lo            = 0xfa022
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x87e2821
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 24e833b4-20cf-11dd-8004-d6217b60e588
        Starting Lba Lo            = 0x87e2822
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x88aa821
        Ending Lba Hi              = 0x0
root@asoka:/#
  • Itanium 11.31:

The 11.31 section will be short since the procedure is almost equal to the 11.23 one. You have to take into account that if you have migrated to the new agile view (and you should have ;-D ) a few things will change. The new agile view use _p1,_p2 and _p3 to identify the partitions of the disk instead of the classic s1, s2 & s3 and the paths will change from dsk/rdsk to disk/rdisk, the names of the devices as well.

A few of examples will show it.

root@piroko:/# efi_cp -d /dev/rdisk/disk4_p1 /tmp/AUTO.lq /EFI/HPUX/AUTO
root@piroko:/# pvcreate -fB /dev/rdisk/disk4_p2
root@piroko:/# vgextend rootvg /dev/disk/disk_p2
root@piroko:/# for i in $(vgdisplay -v vg00| grep "LV Name" | awk '{ print $3 };')
> do
> lvextend -m 1 $i /dev/disk/disk4_p2
> done

And we are done. As always every comment or correction will be welcome.

See you next time.

Juanma.

idisk -p /dev/rdsk/c0t0d0
idisk version: 1.32EFI Primary Header:
Signature                 = EFI PART
Revision                  = 0x10000
HeaderSize                = 0x5c
HeaderCRC32               = 0xa498de56
MyLbaLo                   = 0x1
MyLbaHi                   = 0x0
AlternateLbaLo            = 0x88aacbf
AlternateLbaHi            = 0x0
FirstUsableLbaLo          = 0x22
FirstUsableLbaHi          = 0x0
LastUsableLbaLo           = 0x88aac9c
LastUsableLbaHi           = 0x0
Disk GUID                 = 24e8312a-20cf-11dd-8001-d6217b60e588
PartitionEntryLbaLo       = 0x2
PartitionEntryLbaHi       = 0x0
NumberOfPartitionEntries  = 0xc
SizeOfPartitionEntry      = 0x80
PartitionEntryArrayCRC32  = 0xae99dcc3

Primary Partition Table (in 512 byte blocks):
Partition 1 (EFI):
Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
Unique Partition GUID     = 24e83378-20cf-11dd-8002-d6217b60e588
Starting Lba Lo            = 0x22
Starting Lba Hi            = 0x0
Ending Lba Lo              = 0xfa021
Ending Lba Hi              = 0x0
Partition 2 (HP-UX):
Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
Unique Partition GUID     = 24e83396-20cf-11dd-8003-d6217b60e588
Starting Lba Lo            = 0xfa022
Starting Lba Hi            = 0x0
Ending Lba Lo              = 0x87e2821
Ending Lba Hi              = 0x0
Partition 3 (HPSP):
Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
Unique Partition GUID     = 24e833b4-20cf-11dd-8004-d6217b60e588
Starting Lba Lo            = 0x87e2822
Starting Lba Hi            = 0x0
Ending Lba Lo              = 0x88aa821
Ending Lba Hi              = 0x0

Because a picture is worth a thousand words.

This is my laptop, an HP 6730b with a  Core 2 Duo 2.53GHz processor and 2GB of RAM, running 5 VMs with different flavors of BSD along with other applications. The VMs are running OpenBSD 4.6 (two of them, one with XDM), NetBSD 5.0.1, FreeBSD 7.2 and DragonflyBSD 2.4.1 and some of the other applications are AIMP2, TweetDeck, MS Outlook and Console2 with a Powershell tab.

The System Information window from Sysinternals Process Explorer is showing the amount of RAM consumed, still 300MB free :-D

Like I said BSD… don’t you love it?

Juanma.

May be you already know it or may be not, but Console2 is one of those pieces of software that when you discover it you ask yourself “How was my life before we meet dear?”

I spent so much time in Windows, my corporate laptop has Window XP, the PC at customer site as well so for years I’ve been looking for something to replace the default CMD window. I’ve been using Puttycyg for Cygwin but I still needed something for CMD and Powershell and one day I found Console2 at Mihai Criveti’s blog and since then it has replaced every cli interface in my windows boxes.

It has everything you always wanted for a terminal but MS didn’t provide, tabs, transparency, multiple shells supported, highly customizable, etc.

Juanma.

Is there a future for HP-UX sysadmins? Is our beloved OS going to die like others did? For example True64 just to name one.

May be I’m just being a paranoid but I have to admit that I’m a little worried, specially after a post in Olivier’s excellent blog, another one from Brian Cox in the Mission Critical Computing Blog about HP-UX and Itanium future and the RedHat announcement about dropping support for the Itanium platform in their future RedHat 6. Olivier commented that may be it is time to think about a change after 2015.

Currently there are no sings from inside the company suggesting the post-2015 scenario Olivier  is talking about, and of course as an HP employee my very well brainwashed and pro-HP point of view is telling me that we are not going to drop our major product for the critical mission market like Jacob Van Ewyk wrote in a comment to Olivier’s post:

“I know that at HP, we truly believe in a multi-OS strategy, although the pragmatic side of our business does realize that most HP Integrity server users, such as yourself, run HP-UX 11i”

I really don’t know which one is the correct answer for to concerns, we will see how things develop in the future. If someone is really reading this blog and have any thoughts regarding this please share because I’m really lost.

Juanma.

Configuring APA

January 11, 2010 — 2 Comments

Long time since my last post, Christmas you know ;-) BTW Merry Christmas and Happy New Year to all of you.

During this weeks I’ve been configuring APA failover groups in some of  my blades and I thought It would be interesting to post how I did it. There are two ways to configure APA in HP-UX 11.31, through the SMH and with the nwmgr command. The screenshots are in Spanish since this is how the SMH of my servers are configured.

  • SMH:

Log into the server SMH and go to Tools -> Network Interface Configuration -> Auto Port Aggregation.

Now click on Create Failover Group and select the interfaces to add, you can also configure the advanced parameters for the group, when you’re done click OK to finish the operation.

Now  in the main page of APA the new group will be shown instead of the LAN interfaces the are part of the group:

And this is it, the new APA Failover Group is configured and completely transparent to the users.  From this point you can show the information about the newly created APA interface.

  • NWMGR command:

The nwmgr command has replaced the old lanscan, lanadmin and linkloop commands in 11.31. I have to say that I prefer this way instead of the SMH one to do any APA or LAN related tasks. SMH require the 2301 and 2381 ports to be open and accessible and this is not always possible mainly because security policies but to use nwmgr you only need access to the server through SSH.

To begin show the current configuration:

[root@ignite] ~ # nwmgr -g 

Name/          Interface Station          Sub-   Interface      Related
ClassInstance  State     Address        system   Type           Interface
============== ========= ============== ======== ============== =========
lan2           DOWN      0x001E0B45E09A igelan   1000Base-SX
lan0           UP        0x001E0B45E09C igelan   1000Base-SX    lan900
lan1           UP        0x001E0B45E09D igelan   1000Base-SX    lan900
lan3           DOWN      0x001E0B45E09B igelan   1000Base-SX
lan900         UP        0x001E0B45E09C hp_apa   hp_apa
lan901         DOWN      0x000000000000 hp_apa   hp_apa
lan902         DOWN      0x000000000000 hp_apa   hp_apa
lan903         DOWN      0x000000000000 hp_apa   hp_apa
lan904         DOWN      0x000000000000 hp_apa   hp_apa
[root@ignite] ~ # nwmgr -g -S apa
Class    Mode        Load      Speed-               Membership
Instance             Balancing Duplex
======== =========== ========= ==================== ===========================
lan900   Not_Enabled LB_MAC    0 Mbps                -
lan901   Not_Enabled LB_MAC    0 Mbps                -
lan902   Not_Enabled LB_MAC    0 Mbps                -
lan903   Not_Enabled LB_MAC    0 Mbps                -
lan904   Not_Enabled LB_MAC    0 Mbps                -
[root@ignite] ~ #

Now proceed with the creation of the new failover group:

[root@ignite] ~ # nwmgr -a -S apa -c lan900 -A links=0,1 -A mode=LAN_MONITOR
Addition of links 0, 1 to lan900 succeeded.
[root@ignite] ~ # nwmgr -s -S apa -A all --saved --from cu
[root@ignite] ~ #

Specific advanced parameters can also be set, in the example I used the parameters rapid_arp_count and poll_interval:

[root@ignite] / # nwmgr -a -S apa -c lan901 -A links=2,1,3 -A mode=LAN_MONITOR -A rapid_arp_count=5 -A poll_interval=0,500000
Addition of links 0, 1 to lan900 succeeded.
[root@ignite] / # nwmgr -s -S apa -A all --saved --from cu
[root@ignite] / #

To show the new config:

[root@ignite] ~ # nwmgr -g

Name/          Interface Station          Sub-   Interface      Related
ClassInstance  State     Address        system   Type           Interface
============== ========= ============== ======== ============== =========
lan2           DOWN      0x001E0B45E09A igelan   1000Base-SX
lan0           UP        0x001E0B45E09C igelan   1000Base-SX    lan900
lan1           UP        0x001E0B45E09D igelan   1000Base-SX    lan900
lan3           DOWN      0x001E0B45E09B igelan   1000Base-SX
lan900         UP        0x001E0B45E09C hp_apa   hp_apa
lan901         DOWN      0x000000000000 hp_apa   hp_apa
lan902         DOWN      0x000000000000 hp_apa   hp_apa
lan903         DOWN      0x000000000000 hp_apa   hp_apa
lan904         DOWN      0x000000000000 hp_apa   hp_apa
[root@ignite] ~ # netstat -ni
Name      Mtu  Network         Address         Ipkts              Ierrs Opkts              Oerrs Coll
lo0      32808 127.0.0.0       127.0.0.1       10100925           0     10100956           0     0
lan900    1500 10.31.4.0       10.31.4.37      256                0     92                 0     0
[root@ignite] ~ #
[root@ignite] ~ # nwmgr -g -S apa
Class    Mode        Load      Speed-               Membership
Instance             Balancing Duplex
======== =========== ========= ==================== ===========================
lan900   LAN_MONITOR LB_HS     1 Gbps Full Duplex   0,1
lan901   Not_Enabled LB_MAC    0 Mbps                -
lan902   Not_Enabled LB_MAC    0 Mbps                -
lan903   Not_Enabled LB_MAC    0 Mbps                -
lan904   Not_Enabled LB_MAC    0 Mbps                -
[root@ignite] ~ #
[root@ignite] ~ # nwmgr -S apa -I 900
Class    Parent APA         Mode        Load      Membership
Instance PPA    State                   Balancing
======== ====== =========== =========== ========= =============================
lan900    -     Up          LAN_MONITOR LB_HS     0,1
[root@ignite] ~ #
[root@ignite] ~ # nwmgr -g -S apa -I 900 -v
lan900 current values:
 Speed = 1 Gbps Full Duplex
 MTU = 1500
 Virtual Maximum Transmission Unit = 0
 MAC Address = 0x001e0b45e09c
 Network Management ID = 6
 Features = Linkagg Interface
 IPV4 Recv CKO
 IPV4 Send CKO
 VLAN Support
 VLAN Tag Offload
 64Bit MIB Support
 Load Distribution Algorithm = LB_HS
 Mode = LAN_MONITOR
 Parent PPA =  -
 APA State = Up
 Membership = 0,1
 Active Port(s) = 0
 Ready Port(s) = 1
 Not Ready Port(s) =  -
 Connected Port(s) = 1
 Polling Interval = 10000000
 Dead Count = 3
 Rapid ARP = on
 Rapid ARP Interval = 1.0 second(s)
 Rapid ARP Count = 10
 Failover Policy = PRIORITY_BASED
[root@ignite] ~ # ifconfig lan900
lan900: flags=1843<UP,BROADCAST,RUNNING,MULTICAST,CKO>
 inet 10.31.4.37 netmask ffffff00 broadcast 10.31.4.255
[root@ignite] ~ #

If you want to delete an existent failover group:

[root@ignite] ~ # nwmgr -d -S apa -A links=all -c lan900 --force
Deletion of links all ports from lan900 succeeded.
[root@ignite] ~ # nwmgr -s -S apa -A all --saved --from cu
[root@ignite] ~ #

Or if you just want to remove a interface from the group:

[root@ignite] ~ # nwmgr -d -S apa -c lan901 -A links=1

And we are finished, I still have 11.23 systems and I want APA for them too so I will post how to do it with the lanadmin command.

See you next time.

Juanma.