Tuesday, December 05, 2006

vxvm fast commands

To display free space on the disks in Veritas volume Manager:

Method 1

# xvdg free

itl169:${PWD} #vxdg free

GROUP DISK DEVICE TAG OFFSET LENGTH FLAGS

veritasdg veritasdg01 c1t1d0s2 c1t1d0 0 17679776 -

veritasdg veritasdg02 c1t2d0s2 c1t2d0 0 17679776 -

itl169:${PWD} #

Here the disk is 8.6gb,

Length is in 512 bytes , :- 17679776 x 512 = 9052045312b = 8.6gb

Method 2

itl169:${PWD} #vxassist -g veritasdg maxsize layout=concat

Maximum volume size: 35358720 (17265Mb)

itl169:${PWD} #

Thre are two disks , so 2 x 8.6gb = 17.26gb

************************************************************************

To find the maximum a volume can be grown by in Veritas Volume Manager:

# vxassist maxgrow volume-name

Example

vxassist maxgrow vg01

************************************************************************

To move a volume vg01 to any other disk except disk90 in Veritas Volume Manager:

# vxassist move vg01 !disk90

Example

vxassist move vg01 !disk90

To set a preferred plex to read from in Veritas Volume Manager: ( rdpol – read policy )

# vxvol rdpol prefer volume-name plex-name

Example

vxvol rdpol prefer vg01 plex-80

***********************************************************************

To set a round robin read policy on the volume in Veritas Volume Manager:

rdpol Sets the read policy for a volume based on the policy operand.

# vxvol rdpol round volume_name

Example

vxvol rdpol round vg01

To add a log disk for a raid5 or mirror of a volume in Veritas Volume Manager:

# vxassist addlog volume-name

Example

vxassist addlog vg01

To create a mirror on a previously defined volume in Veritas Volume Manager:

Example to use the disks disk80 and disk90 to make a mirror on the volume called vg01:

# vxassist mirror vg01 disk80 disk90

Example to make a 50 mb mirror on volume called vg01 using any two free disks:

If you do not define the

# vxassist mirror vg01 50m layout=mirror

Example

vxassist mirror vg01 disk80 disk90; vxassist mirror vg01 50m layout=mirror

********************************************************************

To create a raid5 volume in Veritas Volume Manager using any available disks:

If you do not specify the disk group it will use the default disk group defined.

# vxassist make vg01 100m layout=raid5

Example

vxassist make vg01 100m layout=raid5

**********************************************************************

To create a volume in Veritas Volume Manager:

If you do not specify the disk group it will use the default disk group defined.

Example to make a volume called vg01 of size 100m using any available disk:

# vxassist make vg01 100m

Example to make a volume called vg01 to be 100m big using the disk disk80:

# vxassist make vg01 100m disk80

Example

vxassist make vg01 100m disk80; vxassist make vg01 100m

**********************************************************************

To create a volume with a mirror in Veritas Volume Manager:

If you do not specify the disk group it will use the default disk group defined.

Example to make a volume vg01 with a 50mb mirror using the two disks disk80 and disk90:

# vxassist make vg01 50m layout=mirror disk80 disk90

Example

vxassist make vg01 50m layout=mirror disk80 disk90

**********************************************************************

To grow the size of a volume in Veritas Volume Manager:

Examples to grow the size of the volume vg01 to 2000 512byte sectors:

itl169:${PWD} #vxprint -ht

v vg01 - ENABLED ACTIVE 204800 ROUND - fsgen

pl vg01-01 vg01 ENABLED ACTIVE 204800 CONCAT - RW

sd veritasdg01-01 vg01-01 veritasdg01 0 204800 0 c1t1d0 ENA

itl169:${PWD} # vxassist growto vg01 2000m

itl169:${PWD} #vxprint -ht

v vg01 - ENABLED ACTIVE 4096000 ROUND - fsgen

pl vg01-01 vg01 ENABLED ACTIVE 4096000 CONCAT - RW

sd veritasdg01-01 vg01-01 veritasdg01 0 4096000 0 c1t1d0 ENA

itl169:${PWD} #

OR

# vxassist growby vg01 200m

#vxprint -ht

v vg01 - ENABLED ACTIVE 4505600 ROUND - fsgen

pl vg01-01 vg01 ENABLED ACTIVE 4505600 CONCAT - RW

sd veritasdg01-01 vg01-01 veritasdg01 0 4505600 0 c1t1d0 ENA

itl169:${PWD} #

vxassist growto vg01 2000;

vxassist growby vg01 2000

************************************************************************

To mirror a volume vg01 on any free disk in Veritas Volume Manager:

# vxassist mirror vg01

Example

vxassist mirror vg01

itl169:${PWD} #vxassist mirror vg01

#vxprint -ht

v vg01 - ENABLED ACTIVE 4505600 ROUND - fsgen

pl vg01-01 vg01 ENABLED ACTIVE 4505600 CONCAT - RW

sd veritasdg01-01 vg01-01 veritasdg01 0 4505600 0 c1t1d0 ENA

pl vg01-02 vg01 ENABLED ACTIVE 4505600 CONCAT - RW

sd veritasdg02-01 vg01-02 veritasdg02 0 4505600 0 c1t2d0 ENA

itl169:${PWD} #

***********************************************************************

To mirror volumes in a disk group in Veritas Volume Manager:

Example to mirror volume vol80 to vol90 in the disk group rootdg:

# vxassist -g rootdg mirror vol80 vol90

Example

vxassist -g rootdg mirror vol80 vol90

To shrink the size of a volume in Veritas Volume Manager:

Examples to shrink the volume vg01 by 2000 512byte sectors:

v vg01 - ENABLED ACTIVE 4505600 ROUND - fsgen

pl vg01-01 vg01 ENABLED ACTIVE 4505600 CONCAT - RW

sd veritasdg01-01 vg01-01 veritasdg01 0 4505600 0 c1t1d0 ENA

pl vg01-02 vg01 ENABLED ACTIVE 4505600 CONCAT - RW

sd veritasdg02-01 vg01-02 veritasdg02 0 4505600 0 c1t2d0 ENA

itl169:${PWD} #vxassist -f shrinkto vg01 50m

dm veritasdg02 c1t2d0s2 auto 2048 17679776 -

v vg01 - ENABLED ACTIVE 102400 ROUND - fsgen

pl vg01-01 vg01 ENABLED ACTIVE 102400 CONCAT - RW

sd veritasdg01-01 vg01-01 veritasdg01 0 102400 0 c1t1d0 ENA

pl vg01-02 vg01 ENABLED ACTIVE 102400 CONCAT - RW

sd veritasdg02-01 vg01-02 veritasdg02 0 1024000 c1t2d0 ENA

itl169:${PWD} #

Example

vxassist shrinkto vg01 2000; vxassist shrinkby vg01 2000

vxconfigd is the main daemon of Veritas Volume Manager which must be running at all times. It is started at system startup.

You can verify it is running with a ps command:

# ps -ef | grep vxconfigd

Example

ps -ef | grep vxconfigd

vxdctl - how to enable, disable or verify the vxconfigd daemon in Veritas Volume Manager

Description

To verify the vxconfigd daemon in Veritas Volume Manager:

# vxdctl mode

itl169:${PWD} #vxdctl mode

mode: enabled

itl169:${PWD} #

To enable the vxconfigd daemon:

# vxdctl enable

To disable the vxconfigd daemon:

# vxdctl disable

Example

vxdctl mode; vxdctl enable; vxdctl disable

vxdg - how to add a disk to a disk group in Veritas Volume Manager

Description

To add the physical disk c0t0d0 in the disk group homedg calling it disk90 in Veritas Volume Manager:

# vxdg -g homedg adddisk disk90=c0t0d0

Example

vxdg -g homedg adddisk disk90=c0t0d0

vxdg - how to remove a disk from a disk group in Veritas Volume Manager

Description

To remove a disk, disk90, from a disk group, homedg, in Veritas Volume Manager:

# vxdg -g homedg rmdisk disk90

Example

vxdg -g homedg rmdisk disk90

vxdisk - how to clear an import in Veritas Volume Manager

Description

To clear an import in Veritas Volume Manager after a crash:

# vxdisk clearimport c?t?d?s?

Example

vxdisk clearimport c0t0d0s0

vxdisk - how to list all disks and give there status in Veritas Volume Manager

Description

To list all disks under volume manager control and give there status in Veritas Volume Manager:

# vxdisk list

Example

vxdisk list

To remove a grayed out or obsolete disk, or remove a disk from a disk group in Veritas Volume Manager:

# vxdisk rm disk##

Example

vxdisk rm disk88

To add or bring a disk under Veritas Volume Manager control:

# vxdiskadd c?t?d?

OR

# vxdisksetup -i c?t?d?

Note: It might help to newfs the s2 slice of the disk and perform a vxdctl enable to get it to add a disk.

Example

vxdiskadd c0t0d0; vxdisksetup -i c0t0d0

vxedit - how to remove a volume in Veritas Volume Manager

Description

To remove a volume and any subdisks and plexes associated in Veritas Volume Manager:

# vxedit -rf rm volume_name

Example

vxedit -rf rm vg01

vxedit - how to rename a disk in a group in Veritas Volume Manager

Description

To rename the disk disk90 to be called disk80 in the group rootdg in Veritas Volume Manager:

# vxedit -g rootdg rename disk90 rootdiak

Example

vxedit -g rootdg rename disk90 rootmirror

vxedit - how to set a disk to be a hot spare in a group in Veritas Volume Manager

Description

To set disk90 in the group homedg to be a hot spare in Veritas Volume Manager:

# vxedit -g homedg set spare=on disk90

Example

vxedit -g homedg set spare=on disk90

vxedit - how to set the comment field in Veritas Volume Manager

Description

To set the comment field of subdisk subdisk01-01 to "comments are here":

# vxedit set comment"comments are here" subdisk01-01

Example

vxedit set comment"comments are here" subdisk01-01

vxedit - how to set the user, group and permissions on a volume in Veritas Volume Manager

To sets the user to ep, the group to epgrp and the mode rw-rw-rw on the volume vg01:

# vxedit set user=ep group=epgrp mode=0666 vg01

Example

vxedit set user=ep group=epgrp mode=0666 vg01

vxinfo - how to get volume information in Veritas Volume Manager

Description

To get volume information in Veritas Volume Manager:

# vxinfo volume-name

Example

itl169:/root #vxinfo vg01

vg01 fsgen Started

itl169:/root #

To set the number of kernel thread in Veritas Volume Manager:

# vxiod set 10

Note: This is the daemon that allows for extended I/O calls without blocking calling processes. As this is a kernel thread you cannot see it with ps command so you have to use the vxiod command to see if it is running.

itl169:/root #vxiod

10 volume I/O daemons running

itl169:/root #

vxmake - how to create a plex from a subdisk in Veritas Volume Manager

Description

To make a plex using a subdisk in Veritas Volume Manager:

# vxmake plex plex-name sd=sub-disk-name

Example

vxmake plex plex-80 sd=subdisk-80

vxmend - how to set a plex offline in Veritas Volume Manager

Description

To set a plex offline in Veritas Volume Manager:

# vxmend off plex-name

Example

vxmend off plex-80

To set a plex to a clean state in Veritas Volume Manager:

# vxmend fix clean plex-name

Example

vxmend fix clean plex-80

vxmirror - how to mirror all the volumes on a disk in Veritas Volume Manager

Description

To mirror all the volumes on the disk rootdisk to disk90 in Veritas Volume Manager:

# vxmirror rootdisk disk90

Example

vxmirror rootdisk disk90

vxmksdpart - how to rebuild the partition table after a root disk failure in Veritas Volume Manager

Description

To rebuild the partition table after recovering from a root disk failure after re-mirroring the disk in Veritas Volume Manager:

# vxmksdpart -g rootdg diskpart 1 0x03 0x01

Example

vxmksdpart -g rootdg diskpart 1 0x03 0x01

vxplex - how to attach a plex to a volume in Veritas Volume Manager

Description

To attach a plex to a volume in Veritas Volume Manager:

# vxplex att volume_name plex-name

Example

vxplex att vg01 plex-80

vxplex - how to attach a plex to a volume in Veritas Volume Manager

Description

To attach a plex to a volume in Veritas Volume Manager:

# vxplex att volume_name plex-name

Example

vxplex att vg01 plex-80

To display all available information in Veritas Volume Manager:

# vxprint -ht

Example

vxprint -ht

To display all the information about your volumes in Veritas Volume Manager:

# vxprint -l volumename

itl169:${PWD} #vxprint vg01

Disk group: veritasdg

TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0

v vg01 fsgen ENABLED 102400 - ACTIVE - -

pl vg01-01 vg01 ENABLED 102400 - ACTIVE - -

sd veritasdg01-01 vg01-01 ENABLED 102400 0 - - -

pl vg01-02 vg01 ENABLED 102400 - ACTIVE - -

sd veritasdg02-01 vg01-02 ENABLED 102400 0 - - -

itl169:${PWD} #

OR

# vxprint -vl

OR

# vxprint -vt

Example

vxprint -l vg01; vxprint -vl; vxprint -vt

vxprint - how to display all the information about subdisks in Veritas Volume Manager

Description

To display all the information about subdisks in Veritas Volume Manager:

# vxprint -l diskname-##

OR

# vxprint -st

Example

vxprint -l disk80; vxprint -st

vxprint - how to display all the information about subdisks in Veritas Volume Manager

Description

To display all the information about subdisks in Veritas Volume Manager:

# vxprint -l diskname-##

OR

# vxprint -st

Example

vxprint -l disk80; vxprint -st

vxrecover - how to recover a volume in Veritas Volume Manager

Description

To recover a volume in Veritas Volume Manager:

# vxrecover -s volume-name

Example

vxrecover -s vg01

vxrecover - how to bring a volume back online in background mode in Veritas Volume Manager

Description

To bring back a volume online in background mode in Veritas Volume Manager:

# vxrecover -b volume

Example

vxrecover -b vg01

vxrecover - how to bring a volume back online in background mode in Veritas Volume Manager

Description

To bring back a volume online in background mode in Veritas Volume Manager:

# vxrecover -b volume

Example

vxrecover -b vg01

vxprint - how to list all the volumes on a boot disk Veritas Volume Manager

Description

To list all the volumes on a boot disk Veritas Volume Manager:

# vxprint -t -v -e 'aslist.aslist.sd_disk="boot-disk-name"'

Example

vxprint -t -v -e 'aslist.aslist.sd_disk="bootdisk"'

vxprint - how to display all the information about subdisks in Veritas Volume Manager

Description

To display all the information about subdisks in Veritas Volume Manager:

# vxprint -l diskname-##

OR

# vxprint -st

Example

vxprint -l disk80; vxprint -st

vxprint - how to display all the information about plexes in Veritas Volume Manager

Description

To display all the information about plexes in Veritas Volume Manager:

# vxprint -l plex-name

OR

# vxprint -lp

Example

vxprint -l plex-80; vxprint -lp

vxvol - how to stop a volume in a disk group in Veritas Volume Manager

Description

To stop a volume in a disk group in Veritas Volume Manager:

# vxvol -g disk-group volume-name

Example

vxvol -g homedg vg01

vxvol - how to put a volume in maintenance mode in Veritas Volume Manager

Description

To put a volume in maintenance mode in Veritas Volume Manager:

# vxvol maint volume_name

Example

vxvol maint vg01

vxva - Veritas Volume Manager gui

Description

To get the Veritas Volume Manager gui:

# vxva

Example

vxva

vxtrace - how to trace all the I/O on the selected volume in Veritas Volume Manager

Description

To trace all the I/O on the selected volume in Veritas Volume Manager:

# vxtrace volume-name

Example

vxtrace vg01

vxstat - how to report disk statistics in Veritas Volume Manager

Description

To report disk statistics in Veritas Volume Manager:

# vxstat -d

Example

vxstat -d

vxsd - how to move the contents of a subdisk to another in Veritas Volume Manager

Description

To move the contents of subdisk-90 to subdisk-80 in Veritas Volume Manager:

# vxsd mv subdisk-90 subdisk-80

Example

vxsd mv subdisk-90 subdisk-80

vxsd - how to join subdisks in Veritas Volume Manager

Description

To join subdisk-88 and subdisk-77 to create the new bigger subdisk-99:

# vxsd join subdisk-88 subdisk-77 subdisk-99

Example

vxsd join subdisk-88 subdisk-77 subdisk-99

************************************************************************

vxsd - how to add a log disk to a volume in Veritas Volume Manager

Description

To add a log disk to a volume in Veritas Volume Manager:

# vxsd aslog disk-name volume-name

Example

vxsd aslog disk90 vg01

Vx licence

Using vxlicinst to Update Product Licenses

Use the vxlicinst command to add the VCS license key on each system:

# cd /opt/VRTS/bin

# ./vxlicinst -k XXXX-XXXX-XXXX-XXXX-XXXX-XXX

# cd /opt/VRTS/bin

# ./vxlicrep

***********************************************************************

HOT SPARE

When a disk fails that is part of a redundant volume (e.g., RAID 1, RAID 5), the volume is able to continue handling I/O requests, but becomes susceptible to data loss if additional devices fail ( and in the case of RAID5 volumes, the volume will operate in a degraded state, since parity calculations are required to recreate data).

To remedy the potential impacts associated with device failures, Veritas Volume Manager (VxVM) starts the vxrelocd(1m) failure event detection and subdisk relocation daemon at system boot time. This daemon periodically scans the vxnotify(1m) output, and upon detecting a failure, attempts to relocate data to a working device.

When relocating data, Veritas will first attempt to use a device marked as a spare. If Veritas is unable to find a device marked as a spare, Veritas will attempt to relocate data to a device that contains adequate space and doesn’t have the “nohotuse” flag set. To see if a device contains the nohotuse or spare flag, the vxdisk(1m) utility can be invoked with the list option, and the device to list:

$ vxdisk list c1t6d0

Device:    c1t1d0s2
devicetag: c1t1d0
type:      auto
hostid:    pooh
disk:      name=c1t1d0 id=1123602295.10.pooh
group:     name=oradg id=1123603158.13.pooh
info:      format=cdsdisk,privoffset=256,pubslice=2,privslice=2
flags:     online ready private autoconfig spare autoimport imported
pubpaths:  block=/dev/vx/dmp/c1t1d0s2 char=/dev/vx/rdmp/c1t1d0s2
version:   3.1
iosize:    min=512 (bytes) max=2048 (blocks)
public:    slice=2 offset=2304 len=35365968 disk_offset=0
private:   slice=2 offset=256 len=2048 disk_offset=0
update:    time=1123603160 seqno=0.6
ssb:       actual_seqno=0.0
headers:   0 240
configs:   count=1 len=1280
logs:      count=1 len=192
Defined regions:
 config   priv 000048-000239[000192]: copy=01 offset=000000 enabled
 config   priv 000256-001343[001088]: copy=01 offset=000192 enabled
 log      priv 001344-001535[000192]: copy=01 offset=000000 enabled
 lockrgn  priv 001536-001679[000144]: part=00 offset=000000
Multipathing information:
numpaths:   1
c1t1d0s2        state=enabled
        

To mark a device as a hot spare, the vxedit(1m) utility can be used:

$ vxedit set spare=on c1t6d0

$ vxdisk list c1t6d0

Device:    c1t6d0s2
devicetag: c1t6d0
type:      auto
hostid:    winnie
disk:      name=c1t6d0 id=1127240120.14.winnie
group:     name=oradg id=1127240283.19.winnie
info:      format=cdsdisk,privoffset=256,pubslice=2,privslice=2
flags:     online ready private autoconfig spare autoimport imported
pubpaths:  block=/dev/vx/dmp/c1t6d0s2 char=/dev/vx/rdmp/c1t6d0s2
version:   3.1
iosize:    min=512 (bytes) max=2048 (blocks)
public:    slice=2 offset=2304 len=35521408 disk_offset=0
private:   slice=2 offset=256 len=2048 disk_offset=0
update:    time=1127961735 seqno=0.28
ssb:       actual_seqno=0.0
headers:   0 240
configs:   count=1 len=1280
logs:      count=1 len=192
Defined regions:
 config   priv 000048-000239[000192]: copy=01 offset=000000 disabled
 config   priv 000256-001343[001088]: copy=01 offset=000192 disabled
 log      priv 001344-001535[000192]: copy=01 offset=000000 disabled
 lockrgn  priv 001536-001679[000144]: part=00 offset=000000
Multipathing information:
numpaths:   1
c1t6d0s2        state=enabled
        

To request that a device not be used for relocation, the “nohotuse” flag can be set. This will cause vxrelocd(1m) to skip the device when making relocation decisions, which ensures that data doesn’t get relocated to free space on busy disks. To set the “nohotuse”flag, the vxedit(1m) utility can be used:

$ vxedit set nohotuse=on c1t6d0

$ vxdisk list c1t6d0

Device:    c1t6d0s2
devicetag: c1t6d0
type:      auto
hostid:    winnie
disk:      name=c1t6d0 id=1127240120.14.winnie
group:     name=oradg id=1127240283.19.winnie
info:      format=cdsdisk,privoffset=256,pubslice=2,privslice=2
flags:     online ready private autoconfig nohotuse autoimport imported
pubpaths:  block=/dev/vx/dmp/c1t6d0s2 char=/dev/vx/rdmp/c1t6d0s2
version:   3.1
iosize:    min=512 (bytes) max=2048 (blocks)
public:    slice=2 offset=2304 len=35521408 disk_offset=0
private:   slice=2 offset=256 len=2048 disk_offset=0
update:    time=1127961735 seqno=0.28
ssb:       actual_seqno=0.0
headers:   0 240
configs:   count=1 len=1280
logs:      count=1 len=192
Defined regions:
 config   priv 000048-000239[000192]: copy=01 offset=000000 disabled
 config   priv 000256-001343[001088]: copy=01 offset=000192 disabled
 log      priv 001344-001535[000192]: copy=01 offset=000000 disabled
 lockrgn  priv 001536-001679[000144]: part=00 offset=000000
Multipathing information:
numpaths:   1
c1t6d0s2        state=enabled
        

The relocation process can consumes considerable amounts of I/O and CPU resources, so it’s often beneficial to explicitly pick the hot spares by hand. This will ensure that when failures occur, data is not relocated to a chunk of free space that resides on the same spindles as your production data.

itl169:${PWD} #/usr/lib/vxvm/bin/vxreattach

When Veritas loses contact (e.g., if a fiber cable is removed between a server and a storage array) with an active device, Veritas will place the device in the failed state, which will be reported as “failed was: cXtXdX” in the vxdisk(1m) output:

$ vxdisk list

DEVICE       TYPE            DISK         GROUP        STATUS
c0t0d0s2     auto:none       -            -            online invalid
c0t1d0s2     auto:none       -            -            online invalid
c1t1d0s2     auto:cdsdisk    c1t1d0       oradg        online
c1t2d0s2     auto:cdsdisk    -            -            online
c1t3d0s2     auto:cdsdisk    -            -            online
c1t4d0s2     auto:cdsdisk    -            -            online
c1t5d0s2     auto:cdsdisk    -            -            online
c1t6d0s2     auto:cdsdisk    -            -            online
-            -         c1t2d0       oradg        failed was:c1t2d0s2
-            -         c1t3d0       oradg        failed was:c1t3d0s2
-            -         c1t4d0       oradg        failed was:c1t4d0s2
-            -         c1t5d0       oradg        failed was:c1t5d0s2
-            -         c1t6d0       oradg        failed was:c1t6d0s2
        

When situations like this arise, the vxreattach utility can be used to reconnect Veritas to lost devices:

$ usr/lib/vxvm/bin/vxreattach

$ vxdisk list

DEVICE       TYPE            DISK         GROUP        STATUS
c0t0d0s2     auto:none       -            -            online invalid
c0t1d0s2     auto:none       -            -            online invalid
c1t1d0s2     auto:cdsdisk    c1t1d0       oradg        online
c1t2d0s2     auto:cdsdisk    c1t2d0       oradg        online
c1t3d0s2     auto:cdsdisk    c1t3d0       oradg        online
c1t4d0s2     auto:cdsdisk    c1t4d0       oradg        online
c1t5d0s2     auto:cdsdisk    c1t5d0       oradg        online
c1t6d0s2     auto:cdsdisk    c1t6d0       oradg        online
        

Prior to running vxreattach(1m), the problem that caused Veritas to lose contact with the devices should be corrected (e.g., the fiber cable should be reconnected to the server), or vxreattach(1m) should be invoked with the “-c” (check if a reattach is possible) option to see if a reattach is possible. vxreattach(1m) is a cool utility, and should go into every storage adminstrators utility belt.

When utilizing Veritas’s DMP utilities, a controller, enclosure or DMP nodename is required when performing most actions.
To list the controllers on a server, the vxdmpadm(1m) utility can be invoked with the “listctlr” option:

$ vxdmpadm listctlr all

CTLR-NAME       ENCLR-TYPE      STATE      ENCLR-NAME
=====================================================
c3              EMC             ENABLED      EMC0
c2              EMC             ENABLED      EMC0
c0              Disk            ENABLED      Disk
        

The vxdmpadm(1m) utility also has a “getctlr” option to display the physical device path associated with a controller:

itl169:${PWD} #vxdmpadm listctlr all

CTLR-NAME ENCLR-TYPE STATE ENCLR-NAME

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

c1 Disk ENABLED Disk

c0 Disk ENABLED Disk

itl169:${PWD} #vxdmpadm getctlr c1

LNAME PNAME

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

c1 /pci@1f,4000/scsi@4

itl169:${PWD} #vxdmpadm getctlr c0

LNAME PNAME

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

c0 /pci@1f,4000/scsi@3

itl169:${PWD} #

VxVM (Veritas Volume Manager) 4.x logs all commands that have been executed to /var/adm/vx/cmdlog:

itl169:${PWD} #tail -6 /var/adm/vx/cmdlog

# 5277, 1269, Wed Jan 25 11:53:34 2006

/usr/sbin/vxdmpadm getctlr c2

# 31764, 1270, Wed Jan 25 11:53:52 2006

/usr/sbin/vxdmpadm getctlr c1

# 1532, 1271, Wed Jan 25 11:53:59 2006

/usr/sbin/vxdmpadm getctlr c0

itl169:${PWD} #

Veritas Volume Manager (VxVM) comes with DMP (Dynamic MultiPathing) support. DMP allows VxVM to load-balance IOs across multiple controllers, offline paths when failures are detected, and dynamically disable paths when performing maintenance on a specific controller or path (e.g., ugprading a SAN switch or hot swapping an HBA). The process of manually disabling a path is easily accomplished by invoking VxVM’s vxdmpadm(1m) utility with the “disable” keyword, and the controller to disable:

$ vxdmpadm disable ctlr=c2

Once the controller is disabled you can monitor the number of IOs per path with vxdmpadm(1m)’s iostat utility:

$ vxdmpadm iostat show dmpnodename=c2t20d1s2 interval=5

                       cpu usage = 636us    per cpu memory = 32768b
                         OPERATIONS             KBYTES            AVG TIME(ms)
PATHNAME              READS     WRITES      READS     WRITES     READS   WRITES
c2t20d1s2              1800          0     230400          0  0.016102 0.000000
c3t21d1s2              1799          0     230272          0  0.016858 0.000000
                       cpu usage = 663us    per cpu memory = 32768b
                         OPERATIONS             KBYTES            AVG TIME(ms)
PATHNAME              READS     WRITES      READS     WRITES     READS   WRITES
c2t20d1s2               337          0      43136          0  0.014257 0.000000
c3t21d1s2              3007          0     384896          0  0.018631 0.000000
                       cpu usage = 657us    per cpu memory = 32768b
                         OPERATIONS             KBYTES            AVG TIME(ms)
PATHNAME              READS     WRITES      READS     WRITES     READS   WRITES
c2t20d1s2                 0          0          0          0  0.000000 0.000000
c3t21d1s2              3357          0     429696          0  0.018183 0.000000
        

Once maintenance is performed, the controller can be brought back online with vxdmpadm(1m)’s “enable” option, and the controller to enable:

$ vxdmpadm enable ctlr=c2

Once the controller is back up and operational, VxVM will start sending IOs through the controller:

                       cpu usage = 904us    per cpu memory = 32768b
                         OPERATIONS             KBYTES            AVG TIME(ms)
PATHNAME              READS     WRITES      READS     WRITES     READS   WRITES
c2t20d1s2                 0          0          0          0  0.000000 0.000000
c3t21d1s2              4064          0     520192          0  0.014160 0.000000
                       cpu usage = 719us    per cpu memory = 32768b
                         OPERATIONS             KBYTES            AVG TIME(ms)
PATHNAME              READS     WRITES      READS     WRITES     READS   WRITES
c2t20d1s2              1454          0     186112          0  0.013288 0.000000
c3t21d1s2              2720          1     348160          8  0.013732 0.250000
                       cpu usage = 697us    per cpu memory = 32768b
                         OPERATIONS             KBYTES            AVG TIME(ms)
PATHNAME              READS     WRITES      READS     WRITES     READS   WRITES
c2t20d1s2              2110          0     270080          0  0.013485 0.000000
c3t21d1s2              2112          0     270336          0  0.013361 0.000000
        

vxtask list pause resume

When mirrors and RAID5 devices are created with Veritas Volume Manager, the volume contents need to be synchronized to an initial consistent state (e.g., parity and mirrors need to be synchronized). Veritas assigns a unique task id to each operation, and allows tasks to be monitored and displayed with the vxtask(1m) utility:

$ vxtask list

TASKID  PTID TYPE/STATE    PCT   PROGRESS
   172           ATCOPY/R 05.57% 0/209698816/11689984 PLXATT oravol04 oravol04-02 oradg
        

Since synchronization can be extremely I/O intensive, you might want to pause a synchronization task until a later time. This is easily accomplished by passing the task id to vxtask(1m)’s pause option:

$ vxtask pause 172

$ vxtask list

TASKID  PTID TYPE/STATE    PCT   PROGRESS
   172           ATCOPY/P 05.76% 0/209698816/12077056 PLXATT oravol04 oravol04-02 oradg
        

Once you are ready to resume the task, you can use vxtask(1m)’s resume option:

$ vxtask resume 172

$ vxtask list

TASKID  PTID TYPE/STATE    PCT   PROGRESS
172       ATCOPY/R 06.02% 0/209698816/12613632 PLXATT oravol04 oravol04-02 oradg
 
For Example - 
itl169:${PWD} #vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
162          162           ATCOPY/R 08.73% 0/4505600/393216 PLXATT vg01 vg01-02
itl169:${PWD} #vxtask pause 162
itl169:${PWD} #vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   162           ATCOPY/P 26.64% 0/4505600/1200128 PLXATT vg01 vg01-02 veritasdg
itl169:${PWD} #vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   162           ATCOPY/P 26.64% 0/4505600/1200128 PLXATT vg01 vg01-02 veritasdg
itl169:${PWD} #vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   162           ATCOPY/P 26.64% 0/4505600/1200128 PLXATT vg01 vg01-02 veritasdg
itl169:${PWD} #vxtask list
itl169:${PWD} #vxtask resume 162
itl169:${PWD} #vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   162           ATCOPY/R 27.73% 0/4505600/1249280 PLXATT vg01 vg01-02 veritasdg
itl169:${PWD} #vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   162           ATCOPY/R 28.14% 0/4505600/1267712 PLXATT vg01 vg01-02 veritasdg
        

Veritas Volume Manager comes with a wide variety of command line utilities, which can be used to create, delete and maintain Veritas objects. When operations are performed with the CLI and no disk group is passed to the “-g” (disk group to use) option, the command will default to using the value assigned to defaultdg. This value of defaultdg is stored in the /etc/vx/volboot file:

$ grep defaultdg /etc/vx/volboot
defaultdg oradg

If you would like to change the default disk group, you can use vxdctl(1m)’s “defaultdg” option:

$ vxdctl defaultdg oof

To verify that the value was changed, you can run vxdg(1m) with the “defaultdg” option:

$ vxdg defaultdg
oof

This can save a lot of typing when creating new Veritas objects!

Changing the default disk group

itl169:${PWD} #vxassist make vg01 100m

VxVM vxassist ERROR V-5-1-607 Diskgroup rootdg not found

itl169:${PWD} #vxassist -g veritasdg make vg01 100m

itl169:${PWD} #grep defaultdg /etc/vx/volboot

defaultdg rootdg

itl169:${PWD} #vxdctl defaultdg veritasdg

itl169:${PWD} #grep defaultdg /etc/vx/volboot

defaultdg veritasdg

itl169:${PWD} #

Veritas uses disk group configuration records to store subdisk, plex, volume, and device configuration data. The configuration records get written to the private region of specific devices in each disk group, and are described in the vxinfo(1m) manual page:

A disk group configuration is a small database
that contains all volume, plex, subdisk, and disk
media records. These configurations are repli-
cated onto some or all disks in the disk group,
usually with one copy on each disk. Because these
databases are stored within disk groups, record
associations cannot span disk groups. Thus, a
subdisk defined on a disk in one disk group cannot
be associated with a volume in another disk group.

If multiple devices are present in a disk group, Veritas will replicate the configuration records to multiple devices for redundancy. You can see which devices contain disk configuration records by invoking vxdg(1m) with the “list” option:

$ vxdg list oof

Group:     oof
dgid:      1120604922.22.tigger
import-id: 1024.10
flags:     cds
version:   120
alignment: 8192 (bytes)
ssb:            on
detach-policy: global
dg-fail-policy: dgdisable
copies:    nconfig=2 nlog=default
config:    seqno=0.17098 permlen=1280 free=1223 templen=27 loglen=192
config disk c1t1d0s2 copy 1 len=1280 state=clean online
config disk c1t2d0s2 copy 1 len=1280 state=clean online
config disk c1t3d0s2 copy 1 len=1280 disabled
config disk c1t4d0s2 copy 1 len=1280 disabled
config disk c1t5d0s2 copy 1 len=1280 disabled
config disk c1t6d0s2 copy 1 len=1280 disabled
log disk c1t1d0s2 copy 1 len=192
log disk c1t2d0s2 copy 1 len=192
log disk c1t3d0s2 copy 1 len=192
log disk c1t4d0s2 copy 1 len=192
log disk c1t5d0s2 copy 1 len=192
        

This example shows that targets 1 and 2 contain configuration records. If you are a paranoid person, you will probably want to replicate the configuration records to several devices in the disk group. This can be accomplished with the vxedit(1m) utility:

$ vxedit -g oof set nconfig=6 oof

$ vxdg list oof | grep ^config

config:    seqno=0.17137 permlen=1280 free=1265 templen=27 loglen=192
config disk c1t1d0s2 copy 1 len=1280 state=clean online
config disk c1t2d0s2 copy 1 len=1280 state=clean online
config disk c1t3d0s2 copy 1 len=1280 state=clean online
config disk c1t4d0s2 copy 1 len=1280 state=clean online
config disk c1t5d0s2 copy 1 len=1280 state=clean online
config disk c1t6d0s2 copy 1 len=1280 state=clean online
        

Since the configuration records need to be updated periodically, it is poor practice to replicate configuration records to all devices in large disk groups. Veritas will use the correct number of configuration records by default, so creating additional configuration records is seldom required. For further details on configuration records, take a look at the Veritas Volume Manager administrators guide and vxintro(1m) manual page.

In addition to providing volume management capabilities, the Veritas volume manager can manage multiple paths to a disk device. This allows I/O to be load-balanced across multiple paths, and ensures that I/O is transparently routed around failed paths. To print path information for a specific disk, you can use the “vxdisk” or “vxdmpadm” utilities:

$ vxdisk list c2t21d36

[ ... ]
        
Multipathing information:
numpaths:   4
c2t21d36s2      state=enabled
c2t23d36s2      state=enabled
c3t20d36s2      state=disabled
c3t22d36s2      state=disabled
        

$ vxdmpadm getdmpnode nodename=c2t21d36s2

NAME                 STATE     ENCLR-TYPE   PATHS  ENBL  DSBL  ENCLR-NAME
=========================================================================
c2t21d36s2           ENABLED   EMC          4      2     2     EMC0
        

$ vxdmpadm getsubpaths dmpnodename=c2t21d36

NAME         STATE         PATH-TYPE  CTLR-NAME  ENCLR-TYPE   ENCLR-NAME
====================================================================
c2t21d36s2   ENABLED        -        c2         EMC          EMC0
c2t23d36s2   ENABLED        -        c2         EMC          EMC0
c3t20d36s2   DISABLED       -        c3         EMC          EMC0
c3t22d36s2   DISABLED       -        c3         EMC          EMC0
        

The vxdisk(1m) and vxdmpadm(1m) output shows the number of paths to a disk device, and the current state of each path (e.g., enabled or disabled).

Changing the default disk group

itl169:${PWD} #vxassist make vg01 100m

VxVM vxassist ERROR V-5-1-607 Diskgroup rootdg not found

itl169:${PWD} #vxassist -g veritasdg make vg01 100m

itl169:${PWD} #grep defaultdg /etc/vx/volboot

defaultdg rootdg

itl169:${PWD} #vxdctl defaultdg veritasdg

itl169:${PWD} #grep defaultdg /etc/vx/volboot

defaultdg veritasdg

itl169:${PWD} #

No comments: