Role of Device Special File in HP-UX

Device Special File Overview

UNIX applications access peripheral devices such as tape drives, disk drives, printers,

terminals, and modems via special files in the /dev directory called Device Special Files

(DSFs). Every peripheral device typically has one or more DSFs.

DSF Attributes

DSF file attributes determine which device a DSF accesses, and how

  • Type: Access the device in block or character mode?
  • Permissions: Who can access the device?
  • Major#: Which kernel driver does the DSF use?
  • Minor#: Which device does the DSF use? And how?
  • Name: What is the DSF name?

Use ll to view a device file’s attributes

# ll /dev/*disk/disk*

brw-r—– 1 bin sys 3 0x000004 Jun 23 00:34 /dev/disk/disk30

brw-r—– 1 bin sys 3 0x000005 Jun 23 00:34 /dev/disk/disk31

crw-r—– 1 bin sys 22 0x000004 Jun 23 00:34 /dev/rdisk/disk30

crw-r—– 1 bin sys 22 0x000005 Jun 23 00:34 /dev/rdisk/disk31

The lsdev command lists the drivers configured in the kernel, and their associated major

numbers.

 

# lsdev

Character Block Driver Class

22 3 esdisk disk

23 -1 estape tape

DSF Types: Legacy vs. Persistent

  • 11i v1 and v2 only support “legacy” DSFs
  • 11i v3 still supports legacy device files, but introduces new “persistent” DSFs

DSF Directories

DSFs are stored in a directory structure under /dev

Persistent DSFs- /dev/disk, /dev/rdisk, /dev/rtape, /dev/rchgr

Legacy DSF- /dev/dsk, /dev/rdsk, /dev/rmt, /dev/rac

Legacy DSF Names

Legacy DSF names are based on a device path’s controller instance, target, and LUN

# ioscan –kf

Class I H/W Path Description

=====================================================

ext_bus 5 1/0/2/1/0.6.1.0.0 FCP Array Interface

disk 3 1/0/2/1/0.6.1.0.0.0.1 HP HSV101  1st path

ext_bus 7 1/0/2/1/0.6.2.0.0 FCP Array Interface

disk 6 1/0/2/1/0.6.2.0.0.0.1 HP HSV101  2nd path

ext_bus 9 1/0/2/1/1.1.2.0.0 FCP Array Interface

disk 9 1/0/2/1/1.1.2.0.0.0.1 HP HSV101  3rd path

ext_bus 11 1/0/2/1/1.1.3.0.0 FCP Array Interface

disk 12 1/0/2/1/1.1.3.0.0.0.1 HP HSV101  4th path

/dev/dsk/c11t0d1options

 

Persistent DSF Names

# ioscan –kfNn

Class I H/W Path Driver S/W State H/W Type Description

=================================================================

disk 30 64000/0xfa00/0x4 esdisk CLAIMED DEVICE HP HSV101

/dev/disk/disk30options

LUN, Disk, and DVD DSF Names

Legacy DSFs(Blcok DSF)

/dev/dsk/c5t0d1

/dev/dsk/c7t0d1

/dev/dsk/c9t0d1

/dev/dsk/c11t0d1

Legacy DSFs(RAW DSF)

/dev/rdsk/c5t0d1

/dev/rdsk/c7t0d1

/dev/rdsk/c9t0d1

/dev/rdsk/c11t0d1

Persistent DSF(Block DSF)

/dev/disk/disk30

Persistent DSF(RAW DSF)

/dev/rdisk/disk30

 

Boot Disk DSF Names

Integrity boot disks are subdivided into three “EFI” disk partitions

  • Each EFI partition requires block and raw DSFs

− Legacy DSFs identify EFI partitions via suffixes s1, s2, s3

− Persistent DSFs identify EFI partitions via suffixes p1, p2, p3

  • Though not shown below, boot disks may be multi-pathed, too

Execute the lvlnboot –v command to determine your boot disk device file

# lvlnboot –v

Boot Definitions for Volume Group /dev/vg00:

Physical Volumes belonging in Root Volume Group:

/dev/disk/diska_p2 — Boot Disk

Boot: lvol1 on: /dev/disk/diska_p2

Root: lvol3 on: /dev/disk/diska_p2

Swap: lvol2 on: /dev/disk/diska_p2

Dump: lvol2 on: /dev/disk/diska_p2, 0

Legacy Block DSF for boot partition

dev/dsk/c0t1d0

/dev/dsk/c0t1d0s1

/dev/dsk/c0t1d0s2

/dev/dsk/c0t1d0s3

Legacy RAW DSF for boot partition

/dev/rdsk/c0t1d0

/dev/rdsk/c0t1d0s1

/dev/rdsk/c0t1d0s2

/dev/rdsk/c0t1d0s3

Persistent Block DSF for boot partition

/dev/disk/disk27

/dev/disk/disk27_p1

/dev/disk/disk27_p2

/dev/disk/disk27_p3

Persistent RAW DSF for boot partition

/dev/rdisk/disk27

/dev/rdisk/disk27_p1

/dev/rdisk/disk27_p2

/dev/rdisk/disk27_p3

 

Tape Drive DSF Names

Feature                                                                        Legacy DSF in /dev/rmt                              Persistent DSF /dev/rtape
Best density, autorewind, AT&T style                     c0t0d0BEST + 0m                                       tape0_BEST
Best density, no autorewind, AT&T style                c0t0d0BESTn + 0mn                                 tape0_BESTn
Best density, autorewind, Berkeley style                c0t0d0BESTb + 0mb                                tape0_BESTb
Best density, no autorewind, Berkeley style           c0t0d0BESTnb + 0mnb                          tape0_BESTnb

 

Listing Legacy DSFs

# ioscan –kfn list all devices and their legacy DSFs

# ioscan -kfnC disk list all disk class devices and their legacy DSFs

# ioscan -kfnC tape list all tape class drives and their legacy DSFs

# ioscan –kfnH 0/0/1/0/0.0.0 list a specific device/path and its legacy DSFs

# ioscan –kfn /dev/rmt/0m list a specific device/path and its legacy DSFs

 

Listing Persistent DSFs

# ioscan –kfnN list all devices and their persistent DSFs

# ioscan -kfnNC disk list all disk class devices and their persistent DSFs

# ioscan -kfnNC tape list all tape class drives and their persistent DSFs

# ioscan –kfnNH 64000/0xfa00/0x0 list a specific device and its persistent DSFs

# ioscan –kfnN /dev/rtape/tape0 list a specific device and its persistent DSFs

Correlating Persistent DSFs with LUNs and lunpaths

# ioscan –m lun

Class I H/W Path Driver SW State H/W Type Health Description

====================================================================

disk 30 64000/0xfa00/0x4 esdisk CLAIMED DEVICE online HP HSV101

1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

1/0/2/1/0.0x50001fe150031128.0x4001000000000000

1/0/2/1/1.0x50001fe15003112d.0x4001000000000000

1/0/2/1/1.0x50001fe150031129.0x4001000000000000

/dev/disk/disk30 /dev/rdisk/disk30

# ioscan –m lun -H 64000/0xfa00/0x4

Class I H/W Path Driver SW State H/W Type Health Description

====================================================================

disk 30 64000/0xfa00/0x4 esdisk CLAIMED DEVICE online HP HSV101

1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

1/0/2/1/0.0x50001fe150031128.0x4001000000000000

1/0/2/1/1.0x50001fe15003112d.0x4001000000000000

1/0/2/1/1.0x50001fe150031129.0x4001000000000000

/dev/disk/disk30 /dev/rdisk/disk30

 

# ioscan –m lun –D /dev/disk/disk30

Class I H/W Path Driver SW State H/W Type Health Description

====================================================================

disk 30 64000/0xfa00/0x4 esdisk CLAIMED DEVICE online HP HSV101

1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

1/0/2/1/0.0x50001fe150031128.0x4001000000000000

1/0/2/1/1.0x50001fe15003112d.0x4001000000000000

1/0/2/1/1.0x50001fe150031129.0x4001000000000000

/dev/disk/disk30 /dev/rdisk/disk30

 

Correlating Persistent DSFs with WWIDs:

View the WWID for all LUNs, or a specific LUN hardware path or DSF

# scsimgr get_attr -a wwid all_lun

SCSI ATTRIBUTES FOR LUN : /dev/rdisk/disk30

name = wwid

current = 0x600508b400012fd20000a00000250000

default =

saved =

SCSI ATTRIBUTES FOR LUN : /dev/rdisk/disk31

name = wwid

current = 0x600508b400012fd20000900001900000

default =

# scsimgr get_attr -a wwid -H 64000/0xfa00/0x4

SCSI ATTRIBUTES FOR LUN : /dev/rdisk/disk30

name = wwid

current = 0x600508b400012fd20000a00000250000

default =

saved =

# scsimgr get_attr -a wwid -D /dev/rdisk/disk30

SCSI ATTRIBUTES FOR LUN : /dev/rdisk/disk30

name = wwid

current = 0x600508b400012fd20000a00000250000

default =

saved =

Recall that you can also use the scsimgr command to obtain a LUN’s LUNID.

# ioscan –m lun –D /dev/disk/disk30

Class I H/W Path Driver SW State H/W Type Health Description

====================================================================

disk 22 64000/0xfa00/0x4 esdisk CLAIMED DEVICE online HP HSV101

1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

1/0/2/1/0.0x50001fe150031128.0x4001000000000000

1/0/2/1/1.0x50001fe15003112d.0x4001000000000000

1/0/2/1/1.0x50001fe150031129.0x4001000000000000

/dev/disk/disk30 /dev/rdisk/disk30

# scsimgr get_attr \

-a lunid \

-H 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

name = lunid

current =0x4001000000000000 (LUN # 1, Flat Space Addressing)

default =

saved =

 

Correlating Persistent DSFs with Legacy DSFs:

Map all persistent DSFs to corresponding legacy DSFs

# ioscan –m dsf

Map a specific legacy DSF to an associated persistent DSF

# ioscan -m dsf /dev/dsk/c5t0d1

Persistent DSF Legacy DSF(s)

========================================

/dev/disk/disk30 /dev/dsk/c5t0d1

 

Map a specific persistent DSF to associated legacy DSFs:

# ioscan -m dsf /dev/disk/disk30

Persistent DSF Legacy DSF(s)

========================================

/dev/disk/disk30 /dev/dsk/c5t0d1

/dev/dsk/c7t0d1

/dev/dsk/c9t0d1

/dev/dsk/c11t0d1

 

Decoding Persistent and Legacy DSF Attributes:

Decode a legacy DSF’s major and minor numbers

# lssf /dev/rmt/c0t0d0BESTnb

stape card instance 0 SCSI target 0 SCSI LUN 0

Berkeley No-Rewind BEST density

at address 0/0/1/0/0.0.0 /dev/rmt/c0t0d0BESTnb

 

Decode a persistent DSF’s major and minor numbers:

# lssf /dev/rtape/tape0_BESTnb

estape Berkeley No-Rewind BEST density

at address 64000/0xfa00/0x0 /dev/rtape/tape0_BESTnb

 

Managing Device Files

  • HP-UX automatically creates DSFs for most devices during system startup
  • HP-UX 11i v3 automatically creates persistent DSFs for dynamically added LUNs, too
  • HP-UX also provides tools for manually creating and managing device files
  • insf Create default DSFs for auto-configurable devices
  • mksf Create non-default DSFs for auto-configurable devices
  • mknod Create custom DSFs for non-auto-configurable devices
  • rmsf Remove devices and DSFs

Creating DSFs via insf

Scan for new hardware

# ioscan

Create DSFs for newly added devices

# insf –v

insf: Installing special files for stape instance 0 address 0/1/1/1.4.0

insf: Installing special files for estape instance 1 address

64000/0xfa00/0x0

making rtape/tape1_BEST c 23 0x000009

making rtape/tape1_BESTn c 23 0x00000b

making rtape/tape1_BESTb c 23 0x00000c

making rtape/tape1_BESTnb c 23 0x00000d

 

Create DSFs for new devices and re-create missing DSFs for existing devices

# insf –v –e

insf: Installing special files for stape instance 0 address 0/1/1/1.4.0

insf: Installing special files for estape instance 1 address

64000/0xfa00/0x9

making rtape/tape1_BEST c 23 0x000009

making rtape/tape1_BESTn c 23 0x00000b

making rtape/tape1_BESTb c 23 0x00000c

making rtape/tape1_BESTnb c 23 0x00000d

(creates DSFs for all other devices, too)

 

Create or recreate DSFs for a specific hardware path or class

# insf –v –e -H 64000/0xfa00/0x0

insf: Installing special files for estape instance 1 address

64000/0xfa00/0x0

making rtape/tape1_BEST c 23 0x000009

making rtape/tape1_BESTn c 23 0x00000b

making rtape/tape1_BESTb c 23 0x00000c

making rtape/tape1_BESTnb c 23 0x00000d

 

# insf –v –e –C estape

insf: Installing special files for stape instance 0 address 0/1/1/1.4.0

insf: Installing special files for estape instance 1 address

64000/0xfa00/0x0

making rtape/tape1_BEST c 23 0x000009

making rtape/tape1_BESTn c 23 0x00000b

making rtape/tape1_BESTb c 23 0x00000c

making rtape/tape1_BESTnb c 23 0x00000d

 

Creating DSFs via mksf:

Use mksf to configure device files for other unusual combinations of options;

Configure a DDS2, no-rewind DSF for the tape drive at 64000/0xfa00/0x0 :

# mksf –v –H 64000/0xfa00/0x0 –b DDS2 –n

Creating DSFs via mknod

Device File Name Block/Character Major# Minor#

  • If a device isn’t configurable via insf or mksf,

manually create DSFs with custom major/minor numbers using mknod

  • mknod must be used to create LVM volume group DSFs,

and may be necessary to create DSFs for other vendors’ devices

# mknod /dev/vg01/group c 64 0x010000

Removing DSFs via rmsf

List DSFs associated with non-existent “stale” devices (11i v3 only)

# lssf -s

Remove DSFs associated with non-existent “stale” devices (11i v3 only)

# rmsf –v –x

Remove a specific DSF

# rmsf –v /dev/disk/disk1

Remove all of the device files associated with a device, and the device definition

# rmsf –v -a /dev/disk/disk1

Or … specify the device’s hardware path

# rmsf –v –H 64000/0xfa00/0x1

Disabling and Enabling Legacy Mode DSFs

Determine whether legacy mode is currently enabled

# insf -v -L

Disable legacy mode and remove legacy mode DSFs

# rmsf –v –L

Re-enable legacy mode and recreate legacy DSFs

# insf –L

Advertisements

Configure New Hardware in HP-UX 11i v3

HP-UX systems have several hardware components:

  • One or more Itanium single-, dual-, or quad-core CPUs for processing data
  • One or more Cell Boards or Blades hosting CPU and memory
  • One or more System/Local Bus Adapters that provide connectivity to expansion buses
  • One or more PCI I/O expansion buses with slots for add-on Host Bus Adapters
  • One or more Host Bus Adapter cards for connecting peripheral devices
  • One or more Core I/O cards with built-in LAN, console, and boot disk connectivity
  • An iLO / Management Processor to provide console access and system management

Determining your Processor Type

On 11i v1 and v2 systems, you can determine your processor type via the SAM system

properties screen.

# sam -> Performance Monitors -> System Properties -> Processor

On Integrity systems, you can determine your processor type and configuration via the

machinfo command.

# machinfo

Online Replacement, Addition, Deletion (Interface Card OL*)

Some of the entry-class servers, and all of the current mid-range and high-end servers, now

support HP’s Interface Card OL* functionality, which makes it possible to add and replace

(11i v1, v2, and v3), or remove (11i v3 only) interface cards without shutting down the

system.

# olrad –q

 

Integrity Server Overview

Rackmount & Cell-Based Integrity Servers

High-End Cell-Based Server:

HP Integrity Superdome (64p/128c)

Mid-Range Cell-Based Servers:

HP Integrity rx8640 (16p/32c)

HP Integrity rx7640 (8p/16c)

 

Entry-Class rackmount Servers:

HP Integrity rx2800 i2 (2p/8c) New!

HP Integrity rx6600 (4p/8c)

HP Integrity rx3600 (2p/4c)

HP Integrity rx2660 (2p/4c)

 

 

Blade-Based Integrity Servers

High-End Server:

HP Integrity Superdome 2 (32p/128c) New!

 

Blade Servers:

Integrity BL890c i2 Blades (8p/32c) New!

Integrity BL870c i2 Blades (4p/16c) New!

Integrity BL860c i2 Blades (2p/8c) New!

Integrity BL870c Blades (4p/8c)

Integrity BL860c Blades (2p/4c)

 

Viewing the System Configuration View the system model string

# model

# uname –a

 

View processor, memory, and firmware configuration information

# machinfo

 

View cell boards, interface cards, peripheral devices, and other components

# ioscan all components

# ioscan –C cell                 :To view cell board class components

# ioscan –C lan                  :To view LAN interface class components

# ioscan –C disk                 :To View disk class devices

# ioscan –C fc                      :To view fibre channel interfaces

# ioscan –C ext_bus          :To view fibre channel interfaces

# ioscan –C processor      :To view processors

# ioscan –C tty                   :To view serial (teletype) class components

 

Hardware Addresses

Legacy vs. Agile View Hardware Addresses

  • 11i v1 and v2 implement a “legacy” mass storage stack and addressing scheme
  • 11i v3 implements a new mass storage stack, with many new enhancements
  • 11i v3 uses new “agile view” addresses, but still supports legacy addresses, too

 

Legacy HBA Hardware Addresses

1/0/0/2/0

Cell /SBA/LBA/device/function

 

Legacy Parallel SCSI Hardware Addresses

1/0/0/2/0.1.0

HBA hardware address/Device/ Target/ LUN ID

 

Legacy FC Hardware Addresses

1/0/2/1/0.6.1.0.0.0.1

HBA hardware address /              SAN domain/area/                port Array LUN ID

 

Viewing Legacy HP-UX Hardware Addresses

# ioscan      //short listing of all devices

# ioscan -f  //full listing of all devices

# ioscan –kf   // full listing, using cached information

# ioscan -kfH 0/0/0/3/0    //full listing of all devices below 0/0/0/3/0

# ioscan -kfC disk    //full listing of “disk” class devices

 

Agile View HBA Hardware Addresses

1/0/0/2/0

Cell/ SBA /LBA /device/function

Agile View Parallel SCSI Hardware Addresses

1/0/0/2/0.0xa.0x0

HBA hardware address/                                   Target LUN ID

 

Agile View FC Lunpath Hardware Addresses

1/0/2/1/0.0x64bits.0x64bits

HBA hardware address                        /WW Port Name                           /LUN Address

 

Agile View FC LUN Hardware Path Addresses

64000/0xfa00/0x4

virtual root node              /virtual bus              /virtual LUN ID

Viewing LUN Hardware Paths via Agile View

Search and list all devices using legacy hardware addresses.

# ioscan

 

Search and list all devices using Agile View addresses.

# ioscan –N

 

Display a kernel-cached full list of devices using Agile View addressing.

# ioscan –kfN

Display a kernel-cached listing of disk class devices using Agile View addressing.

# ioscan –kfNC disk

Display a kernel-cached listing of a device at a specific hardware path.

# ioscan –kfNH 64000/0xfa00/0x4

Viewing LUNs and their lunpaths via Agile View

# ioscan –m lun [-H 64000/0xfa00/0x4]

# ioscan –m lun

Viewing HBAs and their lunpaths via Agile View

# ioscan –kfNH 1/0/2/1/0

Viewing LUN Health via Agile View

Report the health status of all disks/LUNs.

# ioscan –P health –C disk

 

Report the health status of a specific disk/LUN, or fibre channel adapter.

# ioscan –P health –H 64000/0xfa00/0x4

 

Report the status of all fibre channel adapters.

# ioscan –P health –C fc

 

Report the health status of a specific fibre channel adapter and its lunpaths.

# ioscan –P health –H 1/0/2/1/0

Viewing LUN Attributes via Agile View

Use a LUN hardware path to determine a disk’s WWID

 

# scsimgr get_attr -a wwid [all_lun]|[-H 64000/0xfa00/0x4]

name = wwid

current = 0x600508b400012fd20000a00000250000

default =

saved =

 

Use one of the LUN’s lunpath hardware addresses to determine a disk’s LUNID

# scsimgr get_attr \

-a lunid \

-H 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

name = lunid

current =0x4001000000000000 (LUN # 1, Flat Space Addressing)

default =

saved =

Obtaining LUN IDs

# scsimgr get_attr \

-a lunid \

-H 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

name = lunid

current =0x4001000000000000 (LUN # 1, Flat Space Addressing)

default =

saved =

Enabling and Disabling lunpaths via Agile View

Disable a lunpath

# scsimgr -f disable

–H 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

LUN path 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

disabled successfully

 

Determine lunpath status

# ioscan -P health -H 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

Class I H/W Path health

===================================================================

lunpath 5 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000 disabled

 

Reenable a lunpath

# scsimgr enable

-H 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

LUN path 1/0/2/1/0.0x50001fe15003112c.0x4001000000000000

enabled successfully

 

Slot Address Overview

  • HP-UX hardware addresses are useful when managing devices, but …
  • HP-UX slot addresses identify an interface card’s physical location on the system
  • Interface cards slot addresses provide the following information:

− The slot’s cabinet

− The slot’s I/O bay

− The slot’s I/O chassis

− The slot’s slot number

Viewing Slot Addresses

# olrad -q

Driver(s) Capable

Slot Path Bus Max Spd Pwr Occu Susp OLAR OLD Max Mode

Num Spd Mode

0-0-1-1 1/0/8/1 396 133 133 Off No N/A N/A N/A PCI-X PCI-X

0-0-1-2 1/0/10/1 425 133 133 Off No N/A N/A N/A PCI-X PCI-X

0-0-1-3 1/0/12/1 454 266 266 Off No N/A N/A N/A PCI-X PCI-X

0-0-1-4 1/0/14/1 483 266 66 On Yes No Yes Yes PCI-X PCI

0-0-1-5 1/0/6/1 368 266 66 On Yes No Yes Yes PCI-X PCI

0-0-1-6 1/0/4/1 340 266 266 On Yes No Yes Yes PCI-X PCI-X

0-0-1-7 1/0/2/1 312 133 133 On Yes No Yes Yes PCI-X PCI-X

0-0-1-8 1/0/1/1 284 133 133 On Yes No Yes Yes PCI-X PCI-X

# rad -q

Slot Path Bus Speed Power Occupied Suspended Capable

0-0-0-1 0/0/8/0 64 66 On Yes No Yes

0-0-0-2 0/0/10/0 80 66 On Yes No Yes

0-0-0-3 0/0/12/0 96 66 On Yes No Yes

Managing Card and Devices

Installing Interface Cards w/out OL* (11i v1, v2, v3)

1)Verify card compatibility

2)Verify that the required driver is configured in the kernel

3)Properly shutdown and power off the system

4)Install the interface card

5)Power up

6)Run ioscan to verify that the card is recognized

 

Installing Interface Cards with OL* (11i v1)

  • Installing a new interface card with OL* in 11i v1:
  • Verify card compatibility
  • Verify that the required driver is configured in the kernel
  • Go to the SAM “Peripheral Devices -> Cards” screen
  • Select an empty slot from the object list
  • Select “Actions -> Light Slot LED” to identify the card slot
  • Select “Actions -> Add” to analyze the slot
  • Insert the card as directed
  • Wait for SAM to power on, bind, and configure the card

Check ioscan to verify that the card is recognized

Installing Interface Cards with OL* (11i v2, v3)

1) Installing a new interface card with OLAR:

2) Verify card compatibility

3) Verify that the required driver is configured in the kernel

4) Go to the SMH “Peripheral Device Tool -> OLRAD Cards” screen

5) Select an empty slot

6) Click “Turn On/Off Slot LED”

7) Click “Add Card Online”

8) Click “Run Critical Resource Analysis”

9) Click “Power Off” to power-off the slot

10) Insert the new card

11) Click “Bring Card Online”

Check ioscan to verify that the card is recognized

 

Installing New Devices (11i v1, v2, v3)

 

Configuring a new LUN or hot-pluggable device

  • Verify device compatibility
  • Verify that the required driver is configured in the kernel
  • Connect or configure the device
  • Run ioscan to add the device to the kernel I/O tree (not necessary in 11i v3)
  • Run insf to create device files (not necessary in 11i v3)
  • Run ioscan –kfn or ioscan –kfnN to verify the configuration

 

 

 

 

Configuring a new non-hot-pluggable device

  • Verify device compatibility
  • Verify that the required driver is configured in the kernel
  • Shutdown and power off the system
  • Connect the device

5)   Power-on and boot the system

6)   Run ioscan –kfn or ioscan –kfnN to verify the configuration

 

User Administration in HP-UX 11 i v3

Use the id command to determine a user’s UID and primary group membership.

# id user1

uid=301(user1) gid=301(class)

Use the groups command to determine a user’s secondary group memberships.

# groups user1

class class2 users

Three Key Files in User Administration

/etc/passwd

/etc/group

/etc/shadow – by default disabled.

To edit /etc/passwd file

#/usr/sbin/vipw

Use /usr/sbin/pwck to check the /etc/passwd file syntax.

 

Enable Long Username in HP-UX11.31

11i v3 supports usernames up to 255 characters in length. However, this

functionality must be manually enabled by temporarily stopping the pwgrd

password hashing daemon, executing the lugadmin (long username

groupname) command, and restarting pwgrd.

# /sbin/init.d/pwgr stop

pwgrd stopped

# lugadmin –e

Warning: Long user/group name once enabled cannot

be disabled in future.

Do you want to continue [yY]: y

lugadmin: Note: System is enabled for

long user/group name

# /sbin/init.d/pwgr start

pwgrd started

To determine if long usernames are enabled, execute lugadmin –l. 64

indicates that the maximum username length is 8 characters. 256 indicates

that long usernames are enabled.

# lugadmin –l

256

 

To determine your system’s maximum UID, check the MAXUID

parameter in /usr/include/sys/param.h.

 

Configuring Shadow Passwords:

By default, the /etc/shadow file doesn’t exist. Use the cookbook below to convert to a

shadow password system:

  1. Shadow password support is included by default in 11i v2 and v3. HP-UX 11i v1

administrators, however, must download and install the ShadowPassword patch bundle

from http://software.hp.com/. Use the swlist command to determine if the

product has already been installed.

# swlist ShadowPassword

  1. Run pwck to verify that there aren’t any syntax errors in your existing /etc/passwd file.

# pwck

  1. Use the pwconv command to move your passwords to the /etc/shadow file.

# pwconv

  1. Verify that the conversion succeeded. The /etc/passwd file should remain worldreadable,

but the /etc/shadow file should only be readable by root. The encrypted

passwords in /etc/passwd should have been replaced by “x”s.

# ll /etc/passwd /etc/shadow

-r–r–r– 1 root sys 914 May 18 14:35 /etc/passwd

-r——– 1 root sys 562 May 18 14:35 /etc/shadow

  1. You can revert to the traditional non-shadowed password functionality at any time via the

pwunconv command.

# pwunconv

 

Enabling SHA-512 Passwords in /etc/shadow:

Traditionally, HP-UX has used a variation of the DES encryption algorithm to encrypt user

passwords in /etc/passwd. HP-UX 11i v2 and v3 now support the more secure SHA-512

algorithm if you install the Password Hashing Infrastructure patch bundle from

http://software.hp.com. HP-UX 11i v3 also supports long passwords up to 255

characters if you add the LongPass11i3 patch bundle, too. Use the following commands to

determine if your system has these patch bundles:

In 11i v2:

# swlist SHA

In 11i v3:

# swlist PHI11i3 LongPass11i3

These patches are not available for 11i v1.

After installing the software, add the following two lines to /etc/default/security to

enable SHA512 password hashing:

# vi /etc/default/security

CRYPT_DEFAULT=6

CRYPT_ALGORITHMS_DEPRECATE=__unix__

 

Enabling Long Passwords in /etc/shadow:

On 11i v3 systems, you can also enable long passwords up to 255 characters in length by

adding this line to /etc/default/security:

# vi /etc/default/security

CRYPT_DEFAULT=6

CRYPT_ALGORITHMS_DEPRECATE=__unix__

LONG_PASSWORD=1

 

Creating User Accounts:

# useradd –o \ # allow a duplicate UID

-u 101 \ # define the UID

-g users \ # define the primary group

-G class,training \ # define secondary groups

-c “student user” \ # define the comment field

–m –d /home/user1 \ # make a home directory for the user

–s /usr/bin/sh \ # define the default shell

-e 1/2/09 \ # define an account expiration date

-p fnnmD.DGyptLU \ # specify an encrypted password

-t /etc/default/useradd \ # specify a template

user1 # define the username

 

Interactively set a password for the new account:

# passwd user1 # interactively specify a password or…

# passwd –d user1 # set a null password

# passwd –f user1 # force a password change at first login

 

Creating useradd Templates in /etc/default/

Administrators who manage many user accounts often configure useradd template files in

the /etc/default/ directory.

# useradd –D \ # update defaults for a template

-t /etc/default/useradd.cusers \ # template file location

-b /home \ # base for home directories

-c “C programmer” \ # comment

-g developer \ # primary group

-s /usr/bin/csh # default shell

 

To verify that the template was created, execute useradd with just the –D and –t options,

or simply cat the file.

# useradd -D -t /etc/default/useradd.cusers

GROUPID 20

BASEDIR /home

SKEL /etc/skel

SHELL /usr/bin/csh

INACTIVE -1

EXPIRE

COMMENT programmer

CHOWN_HOMEDIR no

CREAT_HOMEDIR no

ALLOW_DUP_UIDS no

 

The example below uses the new template to create a user account. Recall that –m creates a

home directory for the new user.

# useradd –m -t /etc/default/useradd.cusers user1

# tail -1 /etc/passwd

user1:*:101:20:programmer:/home/user1:/usr/bin/csh

 

Modifying User Accounts:

Modify a user account (Administrators):

# usermod –l user01 user1 # change the user’s username

# usermod –o -u 101 user1 # change the user’s UID

# usermod -g users user1 # change the user’s primary group

# usermod -G class,training user1 # change the user’s secondary group(s)

# usermod -c “student” user1 # change the user’s comment field

# usermod –m -d /home/user01 user1 # move the user’s home directory

# usermod –s /usr/bin/ksh user1 # change the user’s default shell

# usermod –e 1/3/09 user1 # change the user’s account expiration

# usermod -p fnnmD.DGyptLU user1 # non-interactively change a password

 

Modify a user password (Administrators):

# passwd user1 # interactively change a password

Modify a user account or password (Users):

$ passwd # change the user’s password

$ chsh user1 /usr/bin/ksh # change the user’s shell

$ chfn user1 # change the user’s comment field

 

Deactivate a user account

# passwd –l user1

Reactivate a user account

# passwd user1

Remove a user’s home directory

# rm –rf /home/user1

Or… Remove the user’s files from every directory

# find / -user user1 –type f –exec rm –i +

# find / -user user1 –type d –exec rmdir +

Or… Transfer ownership to a different user

# find / -user user1 –exec chown user2 +

 

Delete a user account, but leave the user’s files untouched

# userdel user1

Delete a user account and remove the user’s home directory

# userdel –r user1

Or… Remove the user’s files from every directory

# find / -user user1 –type f –exec rm –i +

# find / -user user1 –type d –exec rmdir +

Or… Transfer ownership to a different user

# find / -user user1 –exec chown user2 +

 

Find files owned by non-existent users or groups

# find / -nouser –exec ll –d +

# find / -nogroup –exec ll -d +

 

Configuring Password Aging:

Password aging may be enabled via the /usr/bin/passwd command:

# passwd -n 7 -x 70 –w 14 user1

<min> argument rounded up to nearest week

<max> argument rounded up to nearest week

<warn> argument rounded up to nearest week

 

You can check the password status of a user’s account with the -s option.

# passwd -s user1

user1 PS 03/21/05 7 70 14

# passwd -sa

user1 PS 03/21/05 7 70 14

user2 PS

user3 PS

Configuring Password Policies:

 

# vi /etc/default/security

MIN_PASSWORD_LENGTH=

PASSWORD_MIN_UPPER_CASE_CHARS=

PASSWORD_MIN_LOWER_CASE_CHARS=

PASSWORD_MIN_DIGIT_CHARS=

PASSWORD_MIN_SPECIAL_CHARS=

PASSWORD_MAXDAYS=

PASSWORD_MINDAYS=

PASSWORD_WARNDAYS=

 

Managing Groups:

Create a new group

# groupadd -g 200 accts

Change a group name

# groupmod -n accounts accts

 

Add, modify, or delete a list of users to or from a group:

# groupmod –a –l user1,user2 accounts add a list of users to a group

# groupmod –m –l user3,user4 accounts replace the list of users in a group

# groupmod –d –l user3,user4 accounts delete a list of users from a group

 

Delete a group:

# groupdel accounts

Change a specific user’s primary and secondary group membership:

# usermod –g users user1

# usermod –G class,training user1

 

View a user’s group memberships:

# groups user1

Automating User Account Creation:

write a simple shell script to automatically create the user accounts. Initially, you can assign the null passwords, but force them to change their

passwords after their first successful login. Assign /usr/bin/sh as the users’ startup

shell.

Create a Shell script useradd_stud_accts.sh

#!/usr/bin/sh

n=1

while ((n<=50))

do

echo stud$n

useradd –m –s /usr/bin/sh stud$n

passwd –d –f stud$n

((n=n+1))

done

 

Make script executable and run:

# chmod +x useradd_stud_accts.sh

# ./useradd_stud_accts.sh

 

To clean up the accounts, create script userdel_stud_accts.sh.

#!/usr/bin/sh

n=1

while ((n<=50))

do

echo stud$n

userdel stud$n

rm -rf /home/stud$n

((n=n+1))

done

 

Managing Users and Groups via the SMH:

# smh -> Accounts for Users and Groups or…

# ugweb

 

HP Integrity VM/vPar Administration

vPars/HPVM v6.1 software requirements:

HP VM/vPar can installed on following servers:

c-class i2/i4 blade server, Superdome Server 2, rx2800 server.

Host on which virtualization software is installed is called as VSP.

Virtualization server platform (VSP) requirements:

  • HP-UX11.31 with AR1203+ (1209+ for i4 blades) running v6.1 vPars/HPVM
  • BB068AA and VirtualBase (AR1203 VSE-OE,DC-OE or application media)
  • GUIDMGR (required separate ISU)
  • VMMGR (required separate ISU)

Install VSP software depot on base machine

# swinstall  –s -x autreboot=true BB068AA VirtualBase GUIDMGR VMMGR

# swlist BB068AA VirtualBase VMMGR

vPars/VM Configuration files:

/var/opt/hpvm/guests/name/vmm_config.current

/var/opt/hpvm/guests/name/vmm_config.next

/var/opt/hpvm/guests/name/vmm_config.prev

Commands:

/opt/hpvm/bin

vPar/VM log files:

/var/opt/hpvm/common/hpvm_mon_log

/var/opt/hpvm/common/command.log

/var/opt/hpvm/guests/name/log

/var/opt/hpvm/guests/name/console/consolelog *read with strings

VSP boot time configuration:

/etc/rc.config.d/hpvmconf

/sbin/rc2.d/S533hpvm   ->  /sbin/init.d/hpvm

/sbin/rc1.d/K467hpvm   ->  /sbin/init.d/hpvm

Verify VSP is running on base server:

# ps –ef | grep –e hpvm

# vparsratus

# hpvminfo

# more /var/opt/hpvm/common/hpvm_mon_log

Verify VSP Resources Displays

It displays available resources on vsp which will used to create vpar/vm

# hpvmstatus –s

Display Cores allocated/available to vsp and vpar/vm

# hpvmhwmgmt –lp cpu

Display Memory for vsp and vpar/vm

# hpvmhwmgmt –lp memory

Display Direct I/O

# hpvmhwmgmt –lp dio

Device Management Database file location

/var/opt/hpvm/common/hpvm_mgmtdb

To view entries:

# hpvmdevmgmt –l rdev|gdev|env|server|all

Or

# hpvmdevmgmt –l all

View the restricted devices listed in the HPVM device database. These are devices that are reserved for the VSP only to use:

# hpvmdevmgmt –l rdev | more

Example: Add /opt directory as restricted directory and change recursive attribute for /opt directory

# hpvmdevmgmt –a rdev:/opt

# hpvmdevmgmt –l rdev | grep /opt

# hpvmdevmgmt –m rdev:/opt:attr:RECURSIVE=DIR

# hpvmdevmgmt –l rdev:/opt

Managing Backing Store:

Resources on the VSP assigned to one or more vpar/vm as raw storage space.

# hpvmdevmgmt –S 20G /hpvmdisks/vmg0disk1

# hpvmdevmgmt –m gdev:/backing_store:attr:SHARE=YES

Creating Virtual Switches:

Vparnet and hpvmnet command are used to create virtual switches

Check network interfaces available on VSP first using

#  nwmgr

Or

#  lanscan

Create virtual switch on selected network interface

#  vparnet –c –S vswlan1 –n 1

Or

# hpvmnet –c –S vswlan1 –n 1

c – indicates creation of switch

S – Specify virtual switch name

n – select instance id of physical nic

#  vaprnet

Or

#  hpvmnet

Cloning Virtual switch

# vparnet –C –S vswlan1 –N NewVsw –n 2

Show properties of virtual switch

# hpvmnet –p all –S vswlan1

# hpvmnet –p all –S NewVsw

List the devices in HPVM database. Find the entries related with new vswitch.

# hpvmdevmgmt –l all | grep –e SWITCH –e lan

Start Virtual Switch

# vparnet –b –S vswlan1

-b : boot virtual switch

-S : vswitch name

-r : restart vswitch

-h : halt vswitch

Check status

# vparnet

Or

# nwmgr

Creation of vPar and VM:

Example1:  Create a vPar with following parameters

Name: vPar27

ID: 27

Cores: 4 total, min 2, max 6

Memory: 2GB

Graceful timeout: 90 seconds

# vparcreate   –P   vPar27   -p  27  -a   cpu::4:2:6  -a  mem:2048  -x  graceful_timeout=90

Example2: Create vm with following parameters

Name: VFinDB

vCPU: 2 total, min 1, max4

CPU entitlement: 40%

Memory: 4GB

Graceful timeout: 60 Second

# hpvmcreate –P vFinDB  -c  2:1:4  -r 4G  -e  40  -x  graceful_timeout=45

Additional Options available in vparcreate and hpvmcreate commands:

-P:          vpar/vm name

-a:           Add new resources/device to vpar/vm

-K :               ssh or telnet IP Address of the Virtual iLo/remote console

-L:           subnet mask

-l:            label to the vpar and vm

-u  login:admin | oper    Virtual console user access

-g  group:admin | oper  Virtual console grop access

-x  active_config=true | false

True= assign resources exclusively when created; this is default option

False= create in standby mode without assigning resources: can’t be started

-e :         cpu entitlement in %

-E : cpu entitlement in MHz or GHz

(cpu entitlement is a minimum percentage of the CPU processing power that is guaranteed to the guest)

Add Virtual Switch to the vPar/VM

# hpvmmodify –P vFinDB  –a  network:avio_lan::vswitch:vswlan0

Here,    avio_lan : Adapter Type

:: Adapter arguments (opt) bus, device, MAC

Add vNIC with a specific vMAC to the vPar, backed by a port on vswlan1

# vparmodify –P  vPar27  -a network:avio_lan:,,aa-aa-aa-05-20-56:vswitch:vswlan1

Add Direct Network to the vPar and VM

DIO pNIC must be defined as a DIO device in the database before assigning

# ioscan –fnClan

Add physical NIC to the HPVM device management database

# hpvmhwmgmt  -a  dio  0/0/0/4/0/0/1

Add a DIO vNIC with specific vMAC to the vPar

# vparmodify  -P  vPar27  -a  lan:dio:,,aa-aa-aa-05-47-56:hwpath:0/0/0/4/0/0/1

Adding Storage Device to the vPar/VM

aviostor (Emulated single ported parallel SCSI MPT storage adapter)

A virtual server is up to having 256 AVIO storage devices. All storage devices is addressed from virtual PCI buses. There are total seven PCI bus on each virtual server. Each PCI bus has eight slots into which virtual PCI adapters can be placed.

aviostor is used to connect 15 SCSI target devices to the virtual server.

-a  disk: aviostor: 1,1,2: disk:/dev/rdisk/disk34

Here,     disk: devicetype

Aviostor: Adapter type

1,1,2: PCI bus (0-6), PCI slot (0-7) , scsi target (0-14)

Example1: Add virtual disk backed by file to vPar

# hpvmdevmgmt –S 45G /BootDisks/vPar27boot

# vparmodify –p 27  -a  disk:aviostor::file:/BootDisks/vPar27boot

Example2: Add virtual disk backed by an LV to vPar

# lvcreate –L 400  –n   vPar27LV    /dev/vg4vPars

# vparmodify p -27 –a disk:aviostor::lv:/dev/vg4vPars/vPar27LV

Example3: Add a virtual disks backed by VSP physical disk or SAN LUN, with virtual hardware path 1/0/2/0.3.0 to VM

# hpvmmodify –p 2 –a disk:avio_stor:1,2,3:disk:/dev/rdisk/disk5

Or

# vparmodify -p abc -a disk:avio_stor::disk:/dev/rdisk/disk5

Example4: Add virtual disk backed by a logical volume to the VM

# lvcreate –L 4000 –n  vFinDBLV  /dev/vg4vPars

# hpvmmodify –p 2  –a  disk:avio_stor::lv:/dev/vg4vPars/vFinDBLV

Guest Devices in the Database

# hpvmdevmgmt   –l    gdev

vPars/VM manage their device database in flat ASCII file  /var/opt/hpvm/common/hpvm_mgmtdb

only hpvmdevmgmt command will be used to display these file.

Viewing Status and Configuration

View Storage details of vm

# hpvmdevinfo  -Vp  27

# vparstatus   -vp   27

# hpvmstatus  -vp  27                       ( Use –V for more information)

Accessing Virtual Machine console

# vparconsole  -p  27

# hpvmconsole  -p  27

Powering Up a vPar or VM

# vparboot  -p  27

# vparconsole  -p  27  -c  “pc  -on”

# vparconsole  -p  27

[vpar27]  vMP>  pc  -on

OR

# hpvmstart  -p  28

# hpvmconsole  -p  28  -c  “pc  -on”

# hpvmconsole  -p  28

[vFinDB]  vMP>  pc  -on

Power Down vPar

# vparstatus  -p  27

#vparreset   -p  27 –fh

Here, -g: waits graceful_stop_timeout # of seconds; reboot inhibited

-d: power off;  reboot inhibited

-h: reset and reboot

-t: ToC; default

-f: force; Required

OR

# vparconsole  -p  27  -c  “pc  -off”

Powering Down VM

# hpvmstatus  -p   2

#  hpvmstop  -p  2

OR

# hpvmconsole   -p  2  -c  “pc  -off”

Removing  vPar/VM

vPar/VM must be powerd off before removed

# vparremove  -fp  27

# vpvmremove  -P  vFinDB

Set Virtual Server Primary Boot Path

After creation of virtual machine set primary boot path for vm/vPar

# grep   –i  boot   /var/adm/syslog/syslog.log

Copy hardware path from this file

#  setboot  -p

Confirm with setboot command

# setboot

Monitoring VSP Resources

Display VSP Resources

# hpvmstatus –s     or   # vparstatus –A

VSP Resource Pools

# hpvmhwmgmt  -lp  memory

# hpvmhwmgmt  -lp cpu

# hpvmhwmgmt  -lp dio

Example: Move a core from the vPars/VM CPU pool to the VSP CPU Pools

# vparhwmgmt  -p cpu  -d  1

Now check available core to vPar/VM

# vparhwmgmt  -lp  cpu

Olarstarpolicy for CPU pools of vPar/VM and VSP

Set to host, changes VSP CPU Pool

Set to guest, changes vPar/VM Pool

# vparhwmgmt  -p  cpu   -x  olarstarpolicy=[host  | guest]

# hpvmhwmgmt  -p  cpu  -x  olarstarpolicy=[host  | guest]

Virtual iLo Remote Access Control

# vparmodify  -P vPar27  -K   10.0.15.111  -L  255.255.255.0

Here,  -K = iLO IP Address

-L = Subnet mask

Access to vPar/VM for Non-Super Users

# useradd –s  /opt/hpvm/bin/vparconsole  -r  no  -d  /var/opt/guests/vPar27   vPar27

# passwd vPar27

# hpvmmodify  -p  27 –u  vPar27:oper

OR

# hpvmmodify  -p  27  -u  vPar27:admin

Managing Backing Store

Attached Devices: Tapes, DVD, USB

Example:  device_type : avio_stor :: attach_path : lun_path

Adding Tape drive to Vpar/VM

#  vparmodify  -P vPar27  -a  tape:avio_stor::attach_path:0/5/0/0/0/0.0×50001.0x0

# hpvmmodify –P vFinDB  -a  tape:avio_stor::attach_path: 0/5/0/0/0/0.0×50001.0x0

Devices are not shared by default, but can be made sharable

# hpvmdevmgmt –m  gdev:: 0/5/0/0/0/0.0×50001.0x0:attr:SHARE=YES

NOTE:

Virtual Storage devices are assigned to vPar/VM dynamically they are hot pluggable but Virtual adapters are not hot pluggable.

Adding DVD drive to vPar/VM

Map virtual DVD to Physical DVD

# vparmodify  -p 27  -a  dvd:aviostor::disk:/dev/rdisk/disk28

Map Virtual DVD to an .iso file

# vparmodify –p 27 –a dvd:aviostor::file:/ISOs/image1.iso

Map Virtual DVD to null Device

# vparmodify –p 27 –a dvd:aviostor::null:/ISOs

Control Media Selection on vMP of the vPar

vMP>  in

vMP>  ej

-Not recommended for OS installations, guest reboot will cause media to eject.

Installing Guest OS

Install from DVD

-hpvmstart and vparboot automatically boot from DVD before a R/W boot disk is installed

-Ignite adds the selected disk to the vEFI boot manager

-Map physical DVD drive to Virtual DVD drive

# vparmodify  -p  27 –a dvd:aviostor::disk:/dev/rdisk/disk28

-Map an ISO image of a bootable install DVD to an virtual DVD drive

# vparmodify –p 27 –a dvd:aviostor::file:/var/iso/image_1203_dvd1.iso

Network Installations

-Create an entry for the vPars vNIC into /etc/booptab file of Ignite server

-Start the vPar/VM

-from virtual console, interrupt the boot and go to EFI shell

Shell> lanboot select

Configuring Boot Parameters

Display vPar/VM boot manager menu

# hpvmnvram  -lp  vPar27

Configure vPar/VM vEFI boot options (vPar/VM must be down)

#  hpvmnvram –P vPar27  -a  /dev/rdisk/disk35: 3 :\efi\hpux\hpux.efi

Examples:

-a  Add an entry for file-backed DVD to position 2

# hpvmnvram –p 27 –a /var/iso/Image_1203_dvd1.iso: 2 : \INSTALL.EFI

-m  Move Entry 3  to position 2

#  hpvmnvram –p 27  -m 3:2

-d  Delete entry  4

# hpvmnvram –p 47 –d 4

 

VLAN Configurations on Virtual Switches

Note: Ports are not assigned to vPar/VM by default

Vswitch ports may be assigned to VLAN before being assigned to vPars or VM’s

VLAN tagging is done at port level in vPar/VM

# vparnet –S vParsw0  -u  portid:1:vlanid:147

# vparnet –S vParsw0  -u  portid:2:vlanid:147

# vparnet  -S vParsw0  –p all

Assign particular port to vPar/VM

# hpvmmodify –p 27 –a network:aviolan::vswitch:vParsw0:portid:1

OR

# vparmodify –p 27 –a network:aviolan::vswitch:vParsw0:portid:2

Configuring Dynamic Resources to Virtual Machine

VM must be down to set Dynamic memory parameters

Assigning Dynamic Memory to VM

# hpvmmodify –p 27 –x  ram_dyn_type=any  \

-x   ram_dyn_min=512M \

-x  ram_dyn_max=1G \

-x  ram_dyn_target_start=512M \

-x  dynamic_memory_control=1

Other Options:

-x ram_dyn_entitlement  (Guarenteed amount of memory to VM) in MB or GB

-x amr_enable (Enable automatic memory reallocation) 1  or 0

-x amr_chunk_size (Granule size for automatic memory reallocation in MB or GB)

Check Dynamic Memory Information of VM

# hpvmstatus   -VP vFinDB

OR

On guest machine or vm

# hpvmmgmt  -V –l ram

To Enable Automatic Memory reallocation to VM edit parameter in /etc/rc.config.d/hpvmconf file of VSP

# vi  /etc/rc.config.d/hpvmconf

HPVMAMRENABLE=1        ; 1= start hpvmamrd deamon with host software

Guest Configuration

# hpvmmodify –P vPar27 –x  amr_enable=1 –x amr_chunk_resize=512

Dynamic vCPU Management in VM

On VSP check cpu status

# hpvmhwmgmt –lp  cpu

On VM

Check current cpu status of VM

# hpvmmgmt  -l  cpu

Enable only 2 vCPU in VM

# hpvmmgmt –c  2

Note: However disabled vCPU still appear in hpvmsar command, to changing actual number of vCPU in VM configuration requires VM to be down at the time of modification.

Cloning Virtual Server

Create Template to clone virtual server

# vparcreate –P vParTemplate –a cpu:::1:4

-a network:aviolan::vswitch:vswlan1

-a mem::2048

-x active_config=false

# hpvmclone –P vParTemplate –N New1

# hpvmstatus

Note:

While creating template active_config attribute set to false, because it just a template so resources are not reserved to template.

After creation of vPar/Vm it need to change active_config attribute to true

# vparmodify –P vPar27  -x  active_config=true

# hpvmmodify –P vPar27  -x active_config=true

When cloning a vPar, the clone fails when non sharable devices are configured. To clone vPar, all devices assigned to existing vPar must be sharable

When cloning a VM, warning message will displays when non sharable devices are configured, but the clone continues.

Converting a vPar to VM

A VSP can host a vPar or VM, but not both in v6.1

# vparstatus

# vparmodify –p 27 –x vm_type=shared

# vparstatus

Converting VM to vPar

# hpvmstatus

# hpvmmodify  -p 27 –x vm_type=vpar

# hpvmstatus

Monitoring Virtual Servers on VSP

Configurations, Consoles, Log Files

/var/opt/hpvm/guests/Name

Vmm_config.current                    current configurations

Vmm_config.prev                          last known configurations

Log                                                        ASII Control files

Console/conslog                             vPar/VM data console; read with string command on VSP

VSP Log files:

Command Log file

/var/opt/hpvm/common/command.log   (on VSP # hpvmstatus –e to read this file)

Monitor Log File

/var/opt/hpvm/common/hpvm_mon_log

vPars/VM Processes on the VSP

From a  ps –ef  following processes are displays

Powered-up processes

/opt/hpvm/lbin/hpvmapp –d vPar27

/opt/hpvm/lbin/hpvmapp –d vPar1

Vswitches processes

/opt/hpvm/lbin/hpvmnetd –c –I vparsw0 –n 0 –p

/opt/hpvm/lbin/hpvmnetd –c –I localnet

Glance on the VSP

On vsp xterminal

# xglance

Glance has the logical system report this report provides a list of virtual servers and displays information of them

Performance agent collects all metrics for virtual systems every 5 minutes. Edit the file /var/opt/perf/parm to enable logical system class to collect virtual machine performance data.

hpvmsar command to monitor cpu and lan performance

# hpvmsar –a

# hpvmsar –S vswlan1  -n 2

Other options

-s  seconds          sample rate

-n #                        # of additional samples (1+n); 0=continues; default=5

-h #                        # of lines of output between header redisplay; default=8

-M                          vCPU data

-A                           all guests

-a                            all running guests

Migrating Integrity Virtual Machines

Requirements:

  • Virtual machine backing stores likes SAN Lun’s are visible to source and target VSP
  • DIO Devices are labelled identically on source and target VSP
  • vswitch names used by the vPar or VM are identical on both VSP
  • Source and destination VSP network properly configured.

Online migration requires both VSP are having same processor family.

# machinfo –v  | grep –I family

Family  32, model 2, stepping 4

Online migration of virtual machine is limited to processor families 31 and 32.

VSP Network and Encryption Configuration

Two variables in /etc/rc.config.d/hpvmconf file set the encryption defaults

HPVM_OVMM_ENCRYPT_BY_DEFAULT

1= Encrypt unless overridden by hpvmmigrate –Y

0= clear text unless overridden by hpvmmigrate –y

HPVM_OVMM_ENCRYPT_ALGORITHM

Sets the encryption algorithm aes-128-cbc (default) or aes-256-cbc(stronger encryption)

SSH-Key based Configuration for both VSP

Example:

  • On both VSP, verify hostname/IP resolution includes files

# grep hosts  /etc/nsswitch.conf

Hosts:  files  dns

  • On both VSP verify that /etc/hosts resolves only host-hpvm-migr to the private network address.

# grep  migr  /etc/hosts

10.3.81.141         vsp1-hpvm-migr               vsp1-hpvm-migr.usv1.net

10.3.81.142         vsp2-hpvm-migr               vsp1-hpvm-migr.usv2.net

  • On both VSP secure communication between the VSP’s

On VSP1:

# /opt/hpvm/bin/secsetup  -r  VSP2-hpvm-migr

On VSP2

# /opt/hpvm/bin/secsetup  -r VSP1-hpvm-migr

  • Test Secure communication between the VSP’s

On VSP1:

#hpvmmigrate  -s  -h  VSP2-hpvm-migr

VSP ssh Configuration

Disable  /etc/issue banner for SSH

# vi /etc/opt/ssh/sshd_config:

#banner  /etc/issue

banner none

Restart SSH service

# /sbin/init.d/secsh stop

# /sbin/init.d/secsh start

Offline Virtual Server Migration

Perform Pre-Migration compatibility checking between the local VSP and target VSP

# hpvmmigrate –s  -h  target_IP_or_hostname

Here, -h = perform compatibility checking

Without –h option it actually performs migration.

# hpvmmodify –P  vm_name –x runnable_status= enabled

More Options for hpvmmigrate command-

-D = Delete vpar from source VSP; default is not to delete and disable runnable status

-b = automatically boot the vpar on target VSP

-n = start the migration in background

-N = Assign new name to vpar on the target VSP. If the vpar has same name on target VSP then its UUID must have same and marked not runnable on target VSP.

-d = power down the vpar after resources verification phase of the migration completed successfully.

-C = use with –m to copy local storage from source to target

For online migration of VM it is necessary to Enable Runnable status and Online Migration status of VM

Lab Activity: Migration of Virtual Servers

Part 1: Configuring the VSP’s for Virtual Server Migration

  • Shutdown the vpar/VM

# vparconsole –p 27                        OR          # hpvmconsole –p 27

# shutdown –h now

  • Verify vswitches on both the VSP

#hpvmnet

Verify vswitch name and port number if assigned.

  • Find shared LUN to be used as backing store on virtual server that will be migrated.
  • Verify the boot devices

# ioscan  -m dsf

Find World wide ID of boot device for your VM guest

# ioscan  – C disk –P wwid             <= on VSP1

#ioscan   -C disk –P wwid                              <= on VSP2

Note: A common WWN indicates that the same lun, whether viewed on first VSP or 2nd VSP, in the ioscan listing abouve that are 2 common WWN, also note there pDSF are different.

  • Determine if DNS is used on VSP by checking /etc/resolv.conf file. Edit /etc/hosts file to add 2 lines for private IP address for virtual machines.

Example:

192.168.20.1   vsp1-hpvm-migr.usv1.net                vsp1-hppvm-migr

192.168.20.2   vsp2-hpvm-migr.usv1.net                vsp2-hppvm-migr

# vi /etc/nsswitch.conf

Hosts: files, dns

# nsquery  hosts  vsp1_hostname-hpvm-migr

# nsquery  hosts  vsp2_hostname-hpvm-migr

  • Identify LAN instances

#ioscan  -fkC lan

Edit  /etc/rc.config.d/netconf    file to add private ip address that are mentioned in /etc/hosts files

Restart network service

# /sbin/init.d/net  start

Verify private network is configured

# ifconfig lan#

  • Disable /etc/issue banner for SSH

# vi /etc/opt/ssh/sshd_config:

#banner  /etc/issue

banner none

Restart SSH service

# /sbin/init.d/secsh stop

# /sbin/init.d/secsh start

  • On VSP1:

# /opt/hpvm/bin/secsetup  -r  VSP2-hpvm-migr

On VSP2

# /opt/hpvm/bin/secsetup  -r VSP1-hpvm-migr

  • Test the ssh trust between the VSP

On VSP1

# hpvmmigrate  -o  -s  -h  VSP2_hostname

On VSP2

# hpvmmigrate –o –s –h VSP1_Hostname

Part 2: Creating the VM Guest and Migrating it Online

  • On VSP1

# hpvmcreate  -P vsg3   -r 2G

# hpvmmodify –P vsg3  -a disk:aviostor::disk:/dev/disk/disk27

#hpvmmodify –P vsg3 –a network:aviolan::vswitch:vswlan0

# hpvmnvram  -lp  vsg3

# hpvmnvram  -P vsg3  -a /dev/rdisk/disk27:1:”\EFI\HPUX\HPUX.EFI”

# hpvmstart  -P vsg3

Now Migrate vsg3  on  VSP2

# hpvmmigrate   -o –P vsg3 –h VSP2_Hostname

Observe the migration phase.

When Migration is completed, verify the vsg3 is running on VSP2

  • On VSP2

# hpvmstatus

# hpvmstatus  -VP vsg3 | grep status

On VSP1

# hpvmstatus  -VP vsg3  | grep status

GUIDmgr and NPIV with vPar/VM v6.1

NPIV:

Node Port ID Virtualization is multiple unique number of WWN registered to the VSP fibre channel physical HBA port, so that virtual server get unique vPort on VSP’s physical HBA.

SAN knows the vPort directly, storage visibility to the virtual servers without VSP visibility.

GUIDmgr (Global Unique Identifier Manager):

It is a client server software that is used to assign vWWN to virtual server virtual fibre channel adapters.

OUID (Organizationally Unique Identifier):

It is having leading 7 hex digits of WWN. 50014c2 for GUIDmgr.

Example: Configuring GUIDmgr and Adding NPIV to Virtual Server

  • Verify GUIDmgr bundle is installed on VSP

# swlist –l bundle GUIDMGR

  • Check FC HBA of VSP supports NPIV or not

# ioscan –fnNC   fc

# /opt/fcms/bin/fcmsutil             /dev/fclp1

  • Initialize GUIDmgr Server

# cd /opt/guid/utils

# ./guid_server_prepare.sh

  • Define Hostname bl86-220 as GUIDmgr server

# /opt/guid/sbin/guidconfig  -h   bl86-220

  • Prepare the client side of the GUIDmgr server to install public key

# /opt/guid/bin/guid_client_prepare   -a

  • Define the WWN managed pool as 50014c2001007110 –  50014c200100711f

# /opt/guid/bin/guidmgmt  -S  wwn  001007110  00100711f

  • Verify the port WWN and Node WWN pools

# /opt/guid/bin/guidmgmt  -L  wwn

  • Add NPIV to Client machine

# vparconsole –p 27 –ic  “CO”

Login as root user

# ioscan  -C   fc   -P  wwid

# ioscan  -C  -fc   -P wwid  >  /tmp/vsgNameStorage

# shutdown  -h   now

vMP> X

# vparconsole   -p  27   -a  hba:aviostor::npiv:/dev/fcd0

#hpvmstatus –VP vpar27