Monday 11 March 2013

Veritas Volume Manager


VM daemons
vxconfigdMaintains system configuration in the kernel & disk (private region). If the daemon is stopped it does not disable any configuration state loaded into the kernel, it only affects the ability to make configuration changes until vxconfigd is restarted.
It can be in three states:
Enable = Normal mode
Disable = Most operations cannot be be used
Booted = Normal startup while using boot disk group
vxrelocdMonitors for failure events and relocates failed subdisks
vxconfigbackupdUsed to backup configuration chnages, the files created can be used with vxmake to restored lost groups.
vxnotifyDisplay veritas volume manager events used with the vxconfigd daemon
vxcached
vxattachd
Kernel Info
Kernel StatesThe kernel can be in three states:
Enabled - both private and public regions are accessible
Disabled - no private or public regions are accessible
Detached - only private regions are accessible

VM utilities
VxVM debugvxconfigd -k -m enable -x <debug option>
-x log                                log to /var/vxvm/vxconfigd.log
-x logfile = <name>              log to filename
-x syslog                            log to syslog
-x timestamp                      date and timestamp every entry
-x tracefile=name                log all possible tracing to file
vxiodThe vxiod utility starts, stops, or reports on VERITAS Volume Manager (VxVM) I/O daemons. An I/O daemon provides a process context for performing I/O in VxVM.Manage extended disk i/o & handles dirty regions, logging
vxiod set <number> = set number of runnning viod daemon
Note: when run on its own it displays # of vxiod daemons that are running.
vxdctl [option]The vxdctl utility manages aspects of the state of the volume configuration daemon vxconfigd and also manages aspects of configuration for bootstrapping the rootdg disk group.
mode = what mode the vxconfigd is running in
enable = enable the vxconfigd daemon (reread the db)
disable = disable the vxconfigd daemon
stop = kill the vxconfigd daemon  (Use 'vxconfigd -k -m enable' to start again)
license [init] = print out license info or reread licenses
support = display version and components
list = display entries in /etc/vx/volboot
init [dmp] = recreate /etc/vx/volboot
Note: when in disabled or stopped mode no VX commands will be able to run
vxinstallInstall volume manger (use /etc/vx/disk to exclude any disks or controllers)
Disk Regions
PrivateThis is were veritas holds the meta data regarding the disk. A copy of the configuration database is copied to each private region within the disk group. Veritas will try and keep 5 copies of the configuration database.
Normally configured as slice 3
Once the private region is created it cannot be changed, thus if it fills up then you have to reinitize the disk with a new private region length, see disks -> initialize disk
PublicThis is the area that will store the users data.
Normally configured as slice 4.
Disk Layouts
Sliced Disk layoutprivate and public region slices are on separate partitions (3 & 4), this type of disk is not suitable for moving between different O/S's but are suitable for boot partitions
Can be converted to CDS
format=sliced
CDS (Cross-platform Data Sharing)private and public regions are one slice (slice 7) , this type is suitable for moving between different O/S's but not suitable for boot partitions.format=cdsdisk
SimplePrivate and public are the same partition but continuous (slice 3)
Can be converted to CDS
format=simple
NoneNo partitioningn/a
VxVM Configuration Database
DB sizevxdg list <group> | grep permlen - the size of the configuration db
DB locationvxdisk list <disk> | grep -i configs - db location
File Locations
vxinstall has not be run/etc/vx/reconfig.d/state.d/install-db
Host ID's/etc/vx/volboot
backup config files (vxconfigbackupd)/etc/vx/cbr/bk

Note: you must have at least run vxconfigbackup once, otherwise the directory does not exist or you have specified another location.
delete or deported disk group config files/etc/vx/dgcfg/deport
All commands logs/var/adm/vx/cmdlog
/var/adm/vx/veacmdlog
Licenses/etc/vx/licenses/lic
Imported disk groups info/var/vxvm/tempdb

Note: to clear the tempdb file:
vxconfigd -k -x cleartempdir - clear the /var/vxvm/tempdb
vxconfigd log file/var/adm/vx/vxconfigd.log
Backup & Restore
Backup/usr/lib/vxvm/bin/vxconfigbackup -l /var/vxvm/backups
-l = location where to store backup
Restore (precommit/commit)vxconfigrestore -p <group>
# either one of the below after the precommit
vxconfigrestore -d <group>
vxconfigrestore -c <group>
Note:
-p = when you want to check that the restore is correct (use vxprint to check)
-d = abort the precommit
-c = commit the precommit
Disks
Initialize disk## increase the private region size default 1024
vxdisksetup -i c2t0d0 privlen= 2048
## change the default of a disk
vxdisksetup -i <device> format=sliced   - initialized a disk as a sliced disk
Note: format can be either sliced, simple, cdsdisk or none (see above - Disk Regions)
Uninitialize diskvxdiskunsetup -C c2t0d0
Disk Informationvxdisk -g <group> list <disk>
vxdisk -s list
Resize a LUNvxdisk -g <group> resize <disk> length=8G
Add a disk slice to volbootvxdctl add disk <device> type=simple
Add a disk slicevxdisk –f <device> type=simple
Add a diskvxdiskadd c1t0d0 or c1 (all disk on controller)
vxdisksetup -i <device>
Remove a disk totally from VMvxdisk rm <device>
Remove a disk from a volumevxdg -g <group> rmdisk <diskname>
Remove a disk slice from VMvxdctl rm disk <device>
Clear any host ID flagsvxdisk clearimport <disk name>
Renaming a diskvxedit -g <disk> rename <old disk name> <new disk name>
Move disk to different disk groupvxdg move <source dg> <target dg> <disk>
Offline a diskvxdisk offline <dev name>
Note: disk must not be in a disk group
Online a diskvxdisk online <dev name>
Note: disk must have a private region otherwise you need to initialise the disk
Hot sparevxedit –g <group> set spare=on <disk>
NoHotUsevxedit –g <group> set nohotuse=on <disk>
Turn off failing flagvxedit -g <group> set failing=off <disk>
Encapsulate a diskvxdisk define c0t0d0s0 type=nopriv
Reattach disk (SAN)vxreattach [-br | -c <device>]
-b = Background process
-r = Recover volumes
-c = Checks to see if reattach is possible
Discover new disksvxdisk scandisks [new | fabric ]
Disk Commentvxedit -g <group> set comment="......." <disk>
Private region problem## Here i am fixing a "online altused" issue but search the web for different issues as there are a number of ways to the same thing, just remember the vxprivutil command
## obtain the disks private region tag 15
prtvtoc /dev/rdsk/c2t0d0s2

## dd the content sto a file
dd if=/dev/rdsk/c2t0d0s3 of=/tmp/c2t0d0s3_privreg
## run the below script
fix_script
## if now errors reported above and in the file, then dd back to disk
dd if=/tmp/c2t0d0s3_privreg.good of=/dev/rdsk/c2t0d0s3
## repeat for any other bad disks

Disk Group
Create a disk groupvxdg init group <disk>=<device>
vxdg init <group> <disk>=<device> cds=off    - initialize a non-cds disk group
Remove a groupvxdg destroy <group>
Add a disk to a groupvxdg –g <group> adddisk <disk>=<device>
Remove a disk from a groupvxdg –g <group> rmdisk <disk>
Replace failed diskvxdg -k -g <group> adddisk <disk>=<device>
-k = forces vxvm to take media name of the failed disk & assign it to the new disk
Import a groupvxdg import <group>
vxdg -n <new-group-name> import <old-group-name>
vxdg -C import <group> 
Import group (clear any flags)vxdg import -C <group>
-C - clears any exist host flags
Deport a groupvxdg deport <group>
vxdg -n <new-group-name> deport <old_group_name>
List no hot use on diskvxdg –g <group> nohotuse <disk>
List spare space on diskvxdg –g <group> spare <disk>
Display free spacevxdg –g <group> free
Backup disk group (vxvm 4.0)vxconfigbackup
Restore disk group (vxvm 4.0)vxconfigrestore [-p|-d|-c]
Diskgroup Versionvxdg list <group> | grep -i version
Upgrade disk versionvxdg upgrade <group>                       - upgrade to current version
vxdg -T 50 upgrade <group>                 - upgrade to version 50
vxdg -T 50 init <group> <disk>=<device>    - creater new group @ version 50
Boot/Default DGvxdg bootdg
vxdg defaultdg

vxdctl defaultdg <group> - set defaultdg

Volume
Adding mirror to root/etc/vx/bin/vxrootmir <alternate> create rootvol, swap vol,
Create a simple volumevxassist make <volume> <size> <disk>
vxassist -g <group> make <vol> <size> !ctrl:c2     - don't use controller 2
vxassist make <volume> <size> <disk> layout=[stripe-mirror|concat-mirror|mirror-concat|mirror-stripe]
stripe-mirror = layered volume
concat-mirror = layered volume
mirror-concat = non-layered volume
mirror-stripe = non-layered volume
Mirror a simple volumevxassist mirror <volume> >disk>
vxassist -g <group> remove mirror <vol> !disk01    - remove the disk01 mirror
Create a stripped volumevxassist make <volume> <size> layout=stripe
vxassist -g <group> -o ordered make <vol> <size> layout=stripe ncol=3 <disk1> <disk2> <disk3>
Create mirrored volume with logvxassist make <volume> <size> layout=mirror, log nmirror=# nlog=#
Create a raid volumevxassist make <volume> <size> layout=raid5
Create a raw volumevxassist -U <usage_type> make <volume> <size> alloc='<disk>'
types:
fsgen - filesystems
gen - raw volumes
raid - supports raid5
root - suuports root filesystems for booting
swap - performs no recovery on startup
relayout - used temporary for disk relayout operations
Remove a volumevxedit –rf rm <volume>
vxassist -g <group> remove volume <vol>
Note: you must disable the volume first
Initializing a volumevxvol init state <volume> [plex]state=clean,enable,active
Online Relayoutvxassist -g <group> relayout <vol> layout=stripe ncol=2
vxassist -g <group> relayout <vol> layout=stripe ncol=+1
vxassist -g <group> relayout <vol> layout=stripe ncol=-1
vxassist -g <group> relayout <vol> layout=stripe stripe=32k ncol=5
vxassist -g <group> relayout <vol> layout=raid5 stripeunit=32k ncol3
vxassist -g <group> convert <vol> layout=stripe-mirror
# Display the relayout operation
vxrelayout -g <group> [status|reverse|start] <vol>
vxtask list
Remove a volume off a particular disk## either make sure there is a another disk in the group, you can even specify it
vxassist -g <group> move <vol> \!<disk> [<disk>]
Rename a volumevxedit -g <group> <old_vol_name> <new_vol_name>
Starting a volumevxvol start <volume>
Start a disabled volumevxrecover –sb <volume>
-s = start volume after recovery
-b = background the recovery task
Disable a volumevxvol -g <group> stop <volume>
Evacuate a volumevxevac -g <group> <from-disk> <to-disk>
Maintenance modevxvol maint <volume>
Not cleanvxmend mirror clean <plex>
No kernel statevxplex att <vol_name> <plex>
Extending a volume sizevxresize <volume> <new length>
vxresize -g <group> <volume> +100m       - increase the volume by 100Mb
Shrinking a volume sizevxresize <volume> <new length>
vxresize -g <group> <volume> -100m       - decrease the volume by 100Mb
add a DRL log to a volumevxassist addlog <volume>
remove a DRL log from a volumevxassist remove log <volume>
Extending log sizevxvol set loglen = 2m <volume/log>
Detering volume sizevxassit -g <group> maxsize layout=mirror - the maximum size you can create a mirror
vxassist -g <group> maxgrow <volume>     - the maximum size the volume can grow too
Recover a volumeVxmend fix clean <plex>
Change volumes permissionsvxedit -g <group> set owner=<user> group=<group> mode=<perms> <vol>

# to display the permissions
ls -l /dev/vx/rdsk/<group>

Plexs
Creating a plexvxmake plex <plex> sd =<sub disk name>
Remove a plexvxplex –o rm dis <plex>
vxplex -g <group> dis <plex>
vxedit -g <group> -rf rm <plex>
Moving a plexvxplex mv <original plex> <new plex>
Copying a plexvxplex cp <volume> <new plex>
Attaching a plexvxplex att <volume> <plex>
Detaching a plexvxplex det <plex>
Offlining a plexvxmend off vol01-02

Sub-disks
Creating sub-diskvxmake sd <sub-disk> <disk>, offset, len
Removing sub-diskvxedit rm <sub-disk>
Moving sub-diskvxsd mv <old sub-disk> <new sub-disk>
Associating with a plexvxmake plex <plex> sd=<sub-disk>, …
i.e vxmake plex home-1 sd= disk02-01, disk02-00, disk02-02
Dissociatingvxsd dis <sub-disk>
Splittingvxsd –s<size> split sd<new sub><newsub2>
Joiningvxsd join <sub-disk1><subdisk2><new subdisk>
relocating a sub disk## either make sure there is a another disk in the group, you can even specify it
vxassist -g <group> move <vol> \!<disk> [<disk>]
relocating a whole disk sub disksvxprint -g rootdg -se 'sd_orig_dmname="disk02"'
vxunreloc -g rootdg disk02

Volume Manager Information 

Disks
Display all the physical disksvxdisk list
vxdisk -o alldgs list
Display detailed disk infovxdisk list <disk>
Check for disk failuresvxstat –g <group>–ff –d
Disk Group
Display group propertiesvxdg list
Display detailed group infovxdg list <group>
vxinfo -p -g <group>
Volume
Display volume infovxprint –Aht <vol>
Display volume propertiesvxprint –vl
Display unstartable volumevxinfo -g <group> <vol>
Check for volume failuresvxstat –g <group>–ff -v
Plex
Display plex propertiesvxprint –vp
Check for plex failuresvxstat –g <group>–ff -p
Sub-Disks
Display sub-disk propertiesvxprint –st
Veritas Tasks
Display tasksvxtask list
vxtask monitor   - continuously monitor
States:
r = running
p = pause
a = aborting
Statistics and Tracing
Iostatsvxstat -g <group> -r –d <disks>       - reset all stats on disk
vxstat -g <group> -d                  - display stats
vxstat -g <group> -i 1 -d <vol>       - display stats every 1 sec intervals for volume
vxstat -g <group> -i 10 -c 5 -d       - display 5 sets @ 10 secs intervals
Tracingvxtrace -d <filename> -o dev,disk <vol>
vxtrace -f <filename> -o dev,disk <vol> | more
Licensing
Addvxlicinst               - versions greater than 3.5
vxlicense -c            - versions below 3.5
Viewvxlicrep                - versions greater than 3.5
vxlicense -p            - versions below 3.5
Paths/etc/vx/licenses/lic    - versions greater than 3.5
/etc/vx/elm             - versions below 3.5
Reload new licensevxdctl license init
VEA
Start/Stop/etc/init.d/isisd [start|stop|restart]
Statusvxsvcctrl status
vxsvc [-m|-k|-v]
-m = status
-k = kill
-v = version
Daemons/opt/VRTSob/bin/vxsvc
/opt/VRTSob/bin/vxsvcctrl
Start VEA GUI/opt/VRTSob/bin/vea
You must have X-windows running
Logging
Logging help in recovery and can speed it up dramatically, the main form of logging in veritas is the DRL (dirty region log) which performs the following
  • log keeps track of changed regions
  • if system fails only the changed regions of the volume are recovered
Addvxassist -g <group> addlog <vol> logtype=drl
vxassist -g <group> addlog <vol>                       - used for raid logs (no type)
Removevxassist -g <group> remove log <vol> [nlog=n] <vol>
Volume Read Policy
Policies can be used if you have slower disks within a volume and you wish to use the faster disks.
Round Robinvxvol -g <group> rdpol round <vol>
Preffered Plexvxvol -g <group> rdpol prefer <vol> <plex>
Selected Plexvxvol -g <group> rdpol select <vol>
Storage Expert (vxse)
Veritas have created some scripots that can check the integrity of the vxvm setup i.e mirrored volumes, spares, etc. The scripts are based on rules and there are a number of differents rules veritas has set, look in the rules directory to see all of them.
Display Descriptionvxse_raid5log1 info
Check rulesvxse_raid5log1 -g <group> check
List spare rulesvxse_spares list
Run spare runvxse_spares run
Note: you need to run "/etc/init.d/isisd start" to start the necessary daemons first
VXSE Paths
Rules/opt/VRTS/vxse/vxvm
Default Parameters/etc/default/vxse
VxDMP
see VxDMP for more information
Veritas links
Recovery featureshttp://prefetch.net/articles/veritasrecoveryfeatures.html



Courtesy by http://www.datadisk.co.uk

No comments:

Post a Comment