Brief Abt VxVm

VERITAS VOLUME MANAGER
UFS (Disadvantages)
It doesn’t support LVM (Logical Volume Management)
Online Administration is not possible
Performance is low because it doesn’t support defragmentation
It is not possible to increase the size of the disk if it busy
To overcome this we have Solstice Disk Suite

Solstice Disk Suite (Disadvantages)
Online Administration is not possible
We can increase the file system but we cannot decrease
We cannot detach the sub disk
To over come this we have Veritas Volume Manage

Veritas Volume Manage (Advantages)
Data is stored in contiguous blocks
Online administration is possible
We can implement RAID LEVELS
We can create quotas & ACL’s also
Relay utility also possible (i.e strip to mirror layout)
Online backup/by using snap shot

VXVM Objects

Physical Virtual

Disk Groups
Physical Hard disk Slice VM disks
Sub disks
Plexes
Volume

DISK GROUPS :- A disk group is a collection of vmdisks that share a common information
Rootdg is the default disk group.
We can destroy this rootdg (i.e we can not delete)
To create rootdg or any disk group atleast one physical disk is required
It does not contain the root disk unless the root disk is encapsulated.

VMDISK :- when a physical disk under vxvm control it is called vmdisk
Each vmdisk corresponder to at least one physical disk or partition
A vmdisk typically includes a public region and private region.
In private region the vmdisk configuration stored
VMDISK Regions

Vmdisk has two regions
Private
Public

Private region
A small area configuration information is stored.
Disk header label, configuration records for VXVM objects (such as Subdisks, plexes and volumes)
The default private region sizes 2048blocks = 1024kb
Public regions
An area that covers the remainder of the disk and is used to store subdisks [storage place]

The basic disk types used by VXVM
SLICED : – private, public regions are on different disk partitions
SIMPLE :- Private , public regions are in same partition area
NOPRIV:- there is no private area

SubDisks:- A subdisk is a subsection of a disk’s public region and is  the smallest unit of storage in
vmdisk ( subdisk set of contiguous disk blocks )
VxVM allocates space on subdisks.
On one physical hard disk we can create minimum of 1 and Max. of 4096 subdisks
Subdisk cannot span across multiple hard drives
Subdisk cannot overlap ( it is not allowed)
A subdisk cannot be shared by two plexes
Subdisk is a specific portion in the Vmdisk

DISK1 -01

PLEX :- Plex is a logical objects which is a collection of subdisks
To construct a plex require minimum of one subdisk and maximum of 4096 subdisks
A Plex cannot be shared by two plexes
Plex cannot span across the hard disk
Overlapping of plex’s is not possible
Plex size is the addition of the sizes of the subdisks (i.e Depends upon the sizes of subdisks)

A plex contains one or more subdisks from one or more Vmdisks

DISK 01

Plex

DISK 02
Volumes :- is a collection of Plexes (Volume is a logical objects or virtual objects)
Volume doesn’t have any size of its own (Depends upon the sizes of subdisks)
A volume consists one or more plexes (max 32 plexes)
Volume can not span across multiple diskgroup
Volume can be mounted but a plex and subdisks can not be mounted
All subdisks within a volume must belong to same diskgroup
A volume is a vertical disk device that appears to applications; database like a physical disk device but it does not have the physical limitations of a physical disk device
A volume must have atleast one plex. It contain full copy of data

    
Daemons for VXVM
VxVM is a subsystem between OS and Data management System
VxVM has following daemons

1) Vxconfigd : –
starts before mounting the root file system
VxVM Configuration daemon maintains disk and group configurations and Communications configuration changes to the kernel. And modifies configuration information stored on disks
Two stages 1) Enable mode (if rootdg is good)
2) Disable mode (if no rootdg is bad)
:-
2) Vxiod :- Vxvm IO daemon provides I/O operations without blocking calling process
The Several vxiod daemons are usually started at boot time and continue to run at all
times
3) vx recoved :- Chechks the health of hard disk
4) Vxrelocd :- Monitors the health of volumes. The hot relocation daemon monitors vxvm for
events that effect redundancy and perform hot relocation to restore redundancy
5) Vxnotify : sends massages(notify) to system administrator by catching the vxrelocd
Disk and Subdisk Operations

In Vm there are three types of commands
High Level – vxdiskadm ,vxassist
Mid Level – vxdiskadd
Low Level – vxdisksetup ,vxmake
-i for Initialization
-c for cleaning
High Level commands

#vxdiskadm

  Volume Manager Support Operations 
  Menu: VolumeManager/Disk 
 
  1    Add or initialize one or more disks 
  2    Encapsulate one or more disks 
  3    Remove a disk 
  4    Remove a disk for replacement 
  5    Replace a failed or removed disk 
  6    Mirror volumes on a disk 
  7    Move volumes from a disk 
  8    Enable access to (import) a disk group 
  9    Remove access to (deport) a disk group 
  10   Enable (online) a disk device 
  11   Disable (offline) a disk device 
  12   Mark a disk as a spare for a disk group 
  13   Turn off the spare flag on a disk 
  list List disk information 
 
  ?    Display help about menu 
  ??   Display help about the menuing system 
  q    Exit from menus 
 
  Select an operation to perform 
Adding or Initialize one or more disk to VXVM

# vxdiskadd c0t1d0
or
# vxdiskadm

1) Select 1 (Add or initialize one or more disks)
2) Enter device name c0t0d0s2
3) Specify the diskgroup name the disk belongs
If the diskgroup that does not already exists vxdiskadm prompts you that you really
wants that group
4) Specify disk group name
5) It will ask for default diskname or customized diskname
6) It will ask this disk act as hot relocation say NO

Encapsulating a disk
To prevent the encapsulation failing
1. Disks have small amount of disk space [at least 1mb]
2. The disk has two partitions
3. Slice 2 represents the whole disk
# vxdiskadm select item 2 from menu

Following prompt enter the device name for encapsulate
it will ask to add the disk for default disk group
it will asking default disk name
it will as continue encapsulation
it will ask for default private regions sufficient or —-
encapsulation requires 2 or 3 reboots
Encapsulating and Mirroring the Root disk
Before encapsulating root disk first use format to obtain printout of root partition table
Choose a disk that is at least as large as the existing root disk
if the selected disk not already under vxvm control, use vxdiskadd or vxdiskadm command to add it to the rootdg group
# vxdiskadm select item no. 6 from menu [mirror volumes on a disk]
otherwise by manually mirror that root device
# /etc/vx/bin/vxrootmir alternatedisk
select EEPROM variable use-nvramrc?=true
this enables the use of vxvm boot disk alias, which identify mirror of the root device from which the system can be booted
# eeprom use-nvramrc?=true
5. ok boot <vx-alteantedisk>

Defining alternate bootdisks
# eeprom nvramrc=devalias vx-alternatedisk

Mirroring other file systems on the root disk
# vxassist mirror home01 alternatedisk

Un Encapsulating Root Disk
You can use the vxunroot utility to remove rootability support from a system
This makes root, swap, home and other file systems on the root disk directly accessible through disk partitions instead of through volume device.
use vxplex command to remove all the plexes of the volumes rottvol,swapvol,usr,var, opt on the disk other than rootdisk
# vxplex -o rm dis rootvol-02 swapvol-02 home-02
/etc/vx/bin/vxunroot

Enabling(Online) a physical disk
If you move one disk from one system to another system, volume manager does not recognize
the disk so do ths

1. vxdiskadm select item 10 from menu [enable a disk device]
2. enter the device name to be ebable

Disable (offline) a disk device

# vxdiskadm select item 11 fom menu
enter the address of the disk you want to disable

( Enter devicename c0t0d0s2
Specify the diskgroup name the disk belongs
If the diskgroup that does not already exists vxdiskadm prompts you that you really wants that group
Specify disk group name
It will ask for default diskname or customized diskname
It will ask this disk act as hot relocation say NO)
Physical Objects Vertual Objects

Logical Volume

Multi Path Disk ARRAY
Some disk arrays provides multiple ports to access their disk devices

Enclosure Based Naming

This naming is used for easily identify the location of the drive. It is avoid copy of the redundant data to same enclosure
ORGANIZE DATA
We can organize data on subdisks to from a plex by using the following methods.
Concatenation
stripping (RAID 0)
Mirroring (RAID 1)
0+1
Stripping with parity (RAID 5)

Volume Layouts
Non layout volumes
Layout volumes
Layout methods

1. concatenation and spanning
Concatenation maps the data in a linear manner on to one or more subdisks in a plex
Data first accessed in the first subdisk from beginning to end
Data accessed in the remaining subdisks

Concatenation using subdisks that reside on more than one vmdisk is knows as spanning

STRIPPING (RAID 0)
STRIPPING MAPS DATA SO THAT THE DATA IS INTERLEAVED AMONG TWO OR MORE PHYSICAL DISKS
Data is allocated alternatively and evenly to the subdisks of a striped plex.
A stripe consists of set of stripe units at the same positions across the all columns

Stripe1 → su1+su2+su3
Stripe2 → su4+su5+su6

Physical disk Vmdisk Plex
Su1
Su4
Su2
Su5

Su3
Su6
Mirroring
Mirroring uses multiple mirrors(plexes) to duplicate the information contained in a volume.
A volume must contain two plexes to maintain redundancy.

Striping+Mirroring
A mirrored stripe layout offers the dual benefit of striping to spread data across multiple disks,
While mirroring provides redundancy of data.
According to above figure if one subdisk fail the entire plex is fail then the plex is sinking from its mirror plex. It will taken much time.

Plex
Plex
STRIPPED MIRROR ( RAID 1+0)
It has also same benefits as 0+1 but one advantage is it reduces recovery time while disk failure.
PLEX
Mirror
RAID 5 : [striping with parity]

RAID5 provides data redundancy by using parity. Parity is a calculated value used to reconstruct data after failure.
Parity is calculated by using “‘e’xor” [procedure on the data.
Stripe1

stripe2

Volume Resynchronization
The mirrored data is exactly not as original data. Because it happens when system suddenly crashes the data is stored in one plex and it not sync to mirror plex. So we must resynchronize the volumes that synced to disk
Dirty Flags
When volume is first written and mark it has dirty
When a volume is closed by all process or stoped cleaning by the administrator, all writer have been completed, vxvm removes the dirty flag
Volume snap shots
Vxassist snap shot command creates a mirror to be used for the snapshot and attaches to the volume as a snap shot mirror.
When the attachment is completed vxassit snapshot command is used to create a new snapshot volume by taking to use as data plexes
The snapshot volume contains the copy of the original volume
Vxassist snapshot can be used to return snapshot plexes to the original volume from which they were snapped. And resynchronize the data in mirrors from original volumes
Hot relocation
It is a feature that allows a system to react automatically I/O failures.
Administrating Disks
Diskname =Vmdisk name
Devicename = c0t0d0s2
To display the native OS devices names of a vmdisk use following command
# vxdisk list disk01

Disk Array
Adding a support for new disk array

# pkgadd –d /CDROM/PKGDIR VRTSA (DISKARRAY PACKAGE)
After this use the following command
# vxdctl enable

# pkgrm vrtsa Removing a support for a disk array

# vxddladm listsupport Listing details of supported disk array
# vxddladm excludearray libname=libvxenc.so Excluding the support for disk array

# vxddladm excludearray VID=ACME PID=x Excluding the support for disk array from a particular vendor

# vxddladm includearray libname=libvxenc.so Re-including the support for diskarray
# vxddladm listexclude Listing excluded disk arrays
LISTING SUPORTED DISKS IN THE JBOD CATEGARY
# vxddladm listjbod
If you want to exclude any controllers or disks from volume manager control

Create /etc/vx/disk.exclude
/etc/vx/cntrls.exclude
/etc/vx/enclr.exclude

CHANGING THE DHISKNAMING SCHEME

# vxdiskadm select item no 20 from menu
Suppose at present volume manager has enclosure based naming
If you want to see the controller based naming type following command
# vxdisk -e list ENCO_21
# vxdmpadm getsubpaths dmpnodenames=ENCO_21
Rename disk

# vxedit rename olddiskname newdiskname

Reserving disks

# vxedit set reserve=on diskname
Displaying disk information
# vxdisk list

Creating and administrating Disk groups

Create a volume in diskgroup use vxassist
# vxassist -g rootdg make suresh 50m
block special device for this volume is /dev/vx/dsk/rootdg/suresh
Create a volume on particular vmdisk
# vxassist make suresh 50m disk01
To display more detailed information about particular disk group
# vxdg list rootdg
To verfy the diskgroup id and name associated with a specific disk
# vxdisk -s list c0t12d0
Displaying free space in disk group
# vxdg free
GROUP DISK DEVICE TAG OFFSET LENGTH FLAGS
rootdg disk01 c0t10d0 c0t10d0 0 4444258 –
To display free space for a disk group
# vxdg –g rootdg free
Creation of new disk group
# vxdg init dg1 disk1=c0t1d0
or
# vxdiskadm c1t1d0s2
adding a disk to a disk group
# vxdiskadm c1t2d0s2
removing a disk from diskgroup
# vxdg rmdisk disk02
#vxdg –k rmdisk disk02 removing of a disk from diskgroup even it has subdisks

Deporting a disk group

Deporting:- suppose if you want to move disks in the particular disk group to another disk group you must deport it

Stop the all volumes that are configured in the diskgroup
unmount the file system
vxvol –g dg1 stopall
select vxdiskadm menu item 9[remove access to diskgroup]
following prompt give the disk group to be deported
“with out vxdiskadm we can deport disk group with command line”
# vxdg deprot dg1

Importing a disk group

This means importing a diskgroup enables access by the system to a disk group
Use thefollowing command to ensure that the disks in the deported disk group are online
# vxdisk -s list
# vxdiskadm select item 8 from menu [enable access to disk group]
Enter the diskgroup name
Without vxdiskadm we can also import disk group with
# vxdg import diskgroup

Renaming a disk group

Vxdg -tc –h newdg import dg1
Vxdg –h hostname deport dg1

Moving disks between disk groups
# vxdg rmdisk disk04
# vxdg -g rootdg adddisk disk04=c0t3d0

Moving diskgroups between systems
Disk groups move between the system i.e we don’t respecify the configuration
On the first system stop all volumes,deport the diskgroup
# vxdg deport dg1
move the all disk to 2nd system this will require reboot or vxdctl enable this restart the vxconfigd
import the diskgroup to second system
#vxdg import dg1
4. After the disk group is importd start all volumes in the disk group with
# vxrecover -g dg1 -sb
Note: Before moving disks you can clear the locks stored in the disks
# vxdisk clearimport c0t1d0

Clear the locks during import
# vxdg –c import dg1
If some of the disks in the disk group failed force the disk group to be imported
# vxdg -f import dg1
# vxdg -f import dg1

Disable disk group
# vxdg deport dg1

Destroying a disk group
# vxdg destroy dg1

Creating and administrating subdisks

Creating subdisks
# vxmake sd disk02-01 disk02,0,8000 [offset i. e 0,8000]

Display subdisk information
# vxprint -st

Display complete listing of subdisk
#Vxprint -l disk01-02

Moving subdisks
# vxsd mv disk03-01 disk22-01

Splitting subdisks
# vxsd –s 1000m split subdisk newsd1 newsd2

Joining subdisks
# vxsd join subdisk1 sundisk2 newsubdiskname

Associating subdisks city plexes

Creating plex and associating subdisks with plex
# vxmake plex home-1 sd=disk01-01,disk01-02,disk01-03
Associating subdisk with existing plex
# vxsd assoc home-1 disk01-01 disk01-02 disk01-03
Associating log subdisks
# vxsd aslog plex subdisk
#vxsd aslog home1 disk01-02

Disassociating subdisks from plexes
# vxsd dis subdisk
# vxsd dis disk01-01
You can also remove the dissassiacted subdisk from vxvm control
# vxsd -o rm dis subdisk
Removing subdisk
# vxedit rm subdisk
Creating and administrating plexes

Creating a plex
# vxmake plex vol01-02 sd=disk02-01,disk02-02
Created striped plex
# vxmake plex pl01 layout=stripe stwidth=32 ncolumn=2 sd=disk01-01,disk01-02

Display plex info
# vxprint –lp → To display information about all plexes in the system
# vxprint –l plex1 → To display detailed information about specific plex
# vxprint -pt → To list the free plexes
# vxplex att vol01 vol01-02 → Attaching plex to volume(existing volume)

# vxmake – U fsgen vol home plex=home1,home2.home3 → Associating plexes with new volume

Taking plexes offline
# vxmend off plex
# vxmend off vol01-02 vol02-01

Detaching plexes
# vxplex det plex
# vxplex det vol01-01

Reattaching plexes
# vxplex att vol01 vol01-01

Enable plex
# vxmend on vol01-02

Moving plexes
# vxplex mv originalplex new plex (……….. originalvolume to newvolume)

Copying plexes
# vxplex cp volume newplex (copy from volume to ples)

Disassociating and removing plexes
# vxplex -o rm dis plex
# vxplex -o rm dis vol01-02

Alternatively you can first disassociate plex and the remove it
# vxplex dis plex
#vxedit -r rm plex

Discovering max size of volume

To find out how large a volume you can create within a diskgroup
# vxassist –g dg1 maxsize layout = raid 5 nlog=2

Creating a volume on any disk
# vxassist -b make suresh 10gb [ -b for immediate use of volume]

Creating a volume on specific disks
# vxassit –b make suresh 5g disk03 disk04

If you want exclude a particular disk while creating volume
# vxassist –b make suresh 10g ! disk05

Exclude all disks on controller C2
# vxassist -b make suresh 10g !ctlr:C2

Include Controller C1 and exclude target t5
# vxassist –b make suresh 5g ctlr:C1 ! target:c1t5

If you want to create volume on specific disk group and disks
# vxassist –b – g dg1 make suresh 20g disk1 disk2

Calculating the maximum volumeother than disks disk07,disk05
# Vxassist –b –g dg1 maxsize layout = raid5 nolg=2 ! disk07 ! disk05

Specify ordered allocation of storage to volumes’
# vxassist –b –o ordered make suresh 10g layout = mirrior-stripe ncol = 3 disk1 disk2 disk3 disk 4

We can create volumes specifying storage capacity of disks
# vxassist -b -o ordered make suresh 10g layout mirror-stripe ncol =2 col_switch = 3g,2g disk01, disk02, disk 03, disk 04, disk 05, disk 06, disk 07, disk 08

It takes 3g from first disk disk01
2g from disk02
3g from disk03
2g from disk04
Volumes are created specifying controllers
# vxassist -b –o ordered make suresh 80g layout = mirror-stripe ncol = 3 ctlr:C1 ctlr:C2 ctlr:C3 ctlr:C4 ctlr:C5 ctlr:C6
Creating mirrored volume
# vxassist –b make suresh 5g layout = mirror

If you want to create 3 mirrors
# vxassist -b make suresh 5g layout = mirror nmirror=3

Mirroring access targets and controllers or enclosures
# vxassist -b make suresh 10g logout=mirror mirror=2 mirror = ctlr ctlr:c2 ctlr:c3

Creating RAID 5 volume
# vxassist -b make suresh 10g layout = raid5 nlog = 2
-b init=active
# vxassist –b make suresh 10g layout = raid 5 ncol = 3 nlog = 2 logdisk = disk7 disk 08 disk 4 disk5 disk6
Instalize start volume
# vxvol start volume

Enable a volume without initializing
# vxvol init enable volume

If you want to zero out the data of an entire volume use this command
# vxvol init zero volume

For volumes related to roodg setsup character and block device files used to access volumes
/dev/dx/rdsk/volume character space
/dev/vx/dsk/volume Block special file
For volumes other then rootdg setsup character and block device files used to access volumes
/dev/vx/rdsk/dg1/volume character special
/dev/vx/dsk/dg1/volume Block special file

Administering Volumes

To display the volume, plex, and subdisk information for all volumes in the system
# vxprint -ht

To display volume related information about specific volume
# vxprint – t suresh

To list all tasks currently running on the system
# vxtask list

Stopping Volume
# vxvol stop jagadesh

To stop all enabled Volumes
# vxvol stopall

To stop all volumes in a specified disk group
# vxvol -g <gruopname> stopall
Example
# Vxvol –g dg1 stopall

Putting a volume in maintaince mode
# vxvol maint Volume

Starting a volume
# vxvol start volume
# vxvol –g dg1 startall ( start all volumes belongs to dg1 group)
# vxvol startall

To start all disable volumes
# vxrecover -s
Adding a mirror to volume
# Vxassist -b mirror volume
Removing a mirror
# vxassist remove mirror volume

Resizing a Volume
#vxresize –b –F vxfs –t resizevolume oldvolume 10g disk10 disk11

Resizing Volumes Using Vxassist
Growto Increase size upto Specified Size or length
Growby Increase Specified Size or amount
Shrinkto Decrease Size up to Specifeid size
Shrinkby Decrease sspecifed size

# vxassist growto or growby or shrinkto ot shrinkby volumename <increase or decrease size up to>
Example
1) #vxassist growto jagadesh 2000 upto 2000 Sectors
2) # vxassist growby jagadesh 100 add 100 sectors
3) # vxassist shrinkto jagadesh 1300 Decrease upto 1300 sectors
4) # vxassist shrinkby jagadesh 100 deduct 100 sectros
Removing a Volume
Volume is mounted as file system unmount
if the volume is in /etc/vfstab remove that entries
stop the volume
# vxvol stop volume
# vxassist remove volume jagadesh
Or
# vxedit –r –f rm jagadesh
-r for recursive removal
-f for forcefully removal

Moving Volumes from a VMDISK
from vxdiskadm menu select 7 (Move Volumes from disk)
enter the diskname of the disk whose volumes you wish to move
if you specify any destination disk volumes are going to that. Otherwise they will make to free space in that particular group
Fast RESYNC :- Fast Resync performs quick and efficient resynchronization of state mirrors
It is also increase the efficiency of the VxVM snapshot mechanism

To check wether the Fast Resync is enabled on a Volume or Not?
# vxprint –g <diskgroup> –F% fastresync <Volume name>
Example
# vxprint –g dg1 –F% fastresync Jagadesh

To Enable the fast resync in the Volume
# vxvol –g <Diskgroup> set fastresync=on <Volumename>
Example
# vxvol –g dg1 set fastresync=on jagadesh