You are on page 1of 55

Basics of Veritas Volume Manager and

Storage Foundation

Gary Phillips
Sr. Systems Engineer, Symantec
Topics of discussion

• Storage Foundation and Veritas Volume Manager (VxVM)


• VxVM data structures and objects
• Basic VxVM commands
• Migration from LVM to VxVM
• LVM vs VxVM Commands

2
Storage
Foundation and
Veritas Volume
Manager

3
What is Veritas Storage Foundation?

• Combination of Veritas File System (VxFS) with Veritas


Volume Manager (VxVM)
• Available on multiple operating systems
– AIX, HP-UX, Linux, Solaris, Windows (no VxFS)
• Both products come with HP-UX 11iv1 and 11iv2
– JFS and Base VxVM - standard on OS distribution
– OJFS and VxVM – separate licenses
• JFS and OJFS are very familiar to HP-UX users

4
What is Veritas Volume Manager?

• VxVM provides online disk management for HP-UX


• Provides features not available with LVM
– Java-based administrative GUI and command line interface
– RAID-5
– Support for up to 32 mirrors
– Striped mirrors
– Dynamic Multipathing for I/O load balancing

• Also available on Linux, Solaris, AIX, Windows

5
VxVM overview: Base product

• Base product consists of the following features:


– Java-based admin GUI
– Striping (RAID 0)
– Concatenation
– Path failover support (active/passive)
– Online resizing of volumes
– Task monitor
– Native root disk administration
– Root disk mirroring

6
VxVM overview: Full product

• Full product includes all of the Base product features


plus:
– Load-balancing -- DMP (active/active)
– Mirroring (RAID-1, 1+0, 0+1)
– Supports up to 32 mirrors
– Online data migration
– Online relayout
– 11iv2 features
• Quality of Storage Service (Storage Tiering)
• Portable Data Containers
• Intelligent Storage Provisioning

7
Coexistence of VxVM and LVM disks

• Both VxVM and LVM recognize each other and the physical
disks associated with each
• VxVM detects and displays LVM disks
• VxVM does not allow selection of LVM disks for initialization,
addition or replacement
• Conversion utilities (vxvmconvert, vxcp_lvmroot) are provided
for converting LVM volume groups to VxVM disk groups
• Conversion utilities convert LVM disks to VxVM disk format
without losing data

8
VxVM data
structures and
objects

9
Conceptual comparison (terminology)

VxVM Term LVM Term

VM Disk (dm) / Device Name Physical Volume (PV)

Subdisk (sd) Physical Extent (PE)

Volume (vol) Logical Volume (LV)

Disk Group (dg) Volume Group (VG)

Private Region PVRA/BDRA/VGRA

Free Space Unused Physical Extent

Plex Mirror

Dirty Region Logging (DRL) Mirror Write Cache (MWC)

Dynamic Multipathing PVlinks

10
VM disk

A VM disk is a physical disk that is placed under VxVM


control. It has VxVM data structures on it.
A VM disk has two regions:
– Private Region - where VM internal configuration information
is stored (similar to PVRA/VGRA)
– Public Region - allocated storage

11
VM disk

• Each VM disk has a unique Disk Media Name


– Default name assigned by VxVM is disk##
– Disk is referred to by its Disk Media Name (logical) instead of
its physical address
• Similar to a Physical Volume

12
Example of a VM disk

Disk under VxVM control

VM disk: disk01 Physical Disk

disk01
Private Region
c0t4d0

Public Region

13
Disk group

• A disk group is a named collection of VM disks that share a


common configuration
• A disk group and its components can be moved as a unit
from one host machine to another (deport/import)
• A disk group configuration is a set of records with detailed
information about related VxVM objects, their attributes and
their connections
• Similar to a Volume Group

14
Example of a Disk Group

dg01

disk01 disk02 disk03 disk04

VM Disk VM Disk VM Disk VM Disk


15
Subdisk

• A subdisk is the low-level building block of VxVM


• A subdisk is a set of contiguous disk blocks
• Each subdisk represents a specific portion of a VM disk
allocated from its public region
• Default name of a subdisk is disk##-##
• Each subdisk is a user-selectable size
• Similar to a Physical Extent but size is variable

16
Example of a subdisk

disk01
disk01-01
blks 0-9999

10000-15999
disk01-02

Free Space

17
Plex

• A plex is a logical grouping of one or more subdisks


located on one or more VM disks
• A plex can also be called a mirror (although it is one copy
of the data)
• Plexes have a variety of layouts:
– Concatenation
– Striping (RAID-0)
– RAID-5
• Similar to an LVM mirror…but not really

18
Example of plexes

VM Disk: disk01

Disk plex1
disk01-01
blks 0-9999
plex2
disk01-02 10000-15999

Free Space

19
Volume

• Volume is a logical device that appears as a physical disk


device, but does not have the physical limitations of a
physical disk
• Volume consists of one or more plexes, each holding a copy
of the selected data in the volume
• Volume can consist of up to 32 plexes, each of which
contains one or more subdisks
• When a volume has two or more plexes, it is a mirrored
volume
• Similar to a Logical Volume

20
Example of a volume

Volume1

plex1
subdisk1
subdisk2

21
VxVM objects summary

Disk Group

Volume
plex01 plex02
disk04-01
disk01-03
disk03-02
disk02-03

disk01 disk02 disk03 disk04


disk04-01
disk03-02

disk01-03 disk02-03
VM Disk VM Disk VM Disk VM Disk
22
Basic VxVM
commands

23
How to complete VxVM tasks

• There are 3 different ways to perform VxVM tasks


– VERITAS Enterprise Administrator (VEA) - GUI
– vxdiskadm text-based menu (limited functions)
– Command line

24
VEA summary

• Java-based server, client GUI


• Manages all VxVM hosts regardless of platform
• Coexists with SAM and SMH
• VEA recognizes and labels LVM volumes and disks but
does not manage them
• SAM and SMH recognize and label VxVM disks but do not
manage them

25
VEA Main Window

26
VEA

27
vxdiskadm summary

• vxdiskadm is the menu-based interface


• vxdiskadm provides task-related information and
prompts
• vxdiskadm provides default answers for many
questions
• Performs a limited number of VxVM tasks

28
vxdiskadm

29
Command Line Interface

30
Basic Commands

• vxdiskadm • vxvol
• vxprint • vxdisksetup
• vxassist • vxtask
• vxdg • vxdctl
• vxdisk • vxlicrep
• vxresize • vxlicinst
• vxedit • vea

31
Key directories

• /dev/vx/*
• /etc/vx/licenses/*
• /opt/VRTS*
• /var/adm/vx/veacmdlog

32
Command line:
Creating a VM disk
• Creates private and public data regions
• vxdiskadd initializes a disk for use by VxVM

• Example:
vxdiskadd c1t2d0
• Compare to LVM:
pvcreate /dev/rdsk/c1t2d0

33
Command line:
Creating a disk group

• At least one VxVM disk required


• Disks must come out of the free disk pool or be uninitialized

• Example:
vxdg init mydg mydg01=c1t2d0
• Compare to LVM:
mkdir /dev/myvg
mknod /dev/myvg/group c 64 0x090000
vgcreate myvg /dev/dsk/c1t2d0

34
Command line:
Creating a volume

• Volumes are made from at least one subdisk and one plex
• vxassist command is the simplest method
• Automatically creates subdisk(s) and plex(es) as needed

• Example:
vxassist –b -g mydg make vol1 10g
• Compare to LVM:
lvcreate –n lvol1 –L 10000 myvg

35
Migration from
LVM to VxVM

36
Migration from LVM to VxVM

2 different scenarios of migration/conversion


• LVM root disk to VxVM-controlled root disk
• LVM volume groups to VxVM disk groups

• VxVM commands:
– vxcp_lvmroot – root disk conversion
– vxvmconvert – data volume group conversion

37
LVM root disk conversion
requirements
• Converting the root volume group (vg00)
– Need an unused LUN/physical disk
• Cannot be under control of either LVM or VxVM
– Copies all root logical volumes to new LUN (no encapsulation)
– Replace LVM data structures with VxVM data structures
– Original volume group (vg00) still exists under LVM
• Post-conversion activities
– Both boot/root volume/disk groups can co-exist for testing
– LVM-based LUN can be removed at any time
• vxdestroy_lvmroot
– When removed, mirror VxVM LUN back to the original LVM LUN for
mirrored root
• vxrootmir

38
Converting vg00 example

• # /etc/vx/bin/vxcp_lvmroot –v –b c0t4d0
– Creates a VxVM-rootable disk on c0t4d0. LVM root disk still
exists. The –b sets c0t4d0 as the primary boot device. This could
also be done with the setboot command.
• # /etc/vx/bin/vxdestroy_lvmroot –v c1t1d0
– Removes original LVM root disk and volume group (vg00).
• # /etc/vx/bin/vxrootmir -v -b c1t1d0
– Creates a mirror of the boot disk on c1t1d0. The –b sets c1t1d0
as the alternate boot device.

39
Data volume group conversion

• What is actually converted?


– LVM data structures
• VGRA, PVRA
• Physical volumes
• Volume groups
• Logical volumes
• Physical extents

• User data is neither changed or moved

40
Converting LVM volume group
process

• Identify LVM volume groups for conversion


• Analyze each volume group before performing the
conversion to determine if it is possible
• Backup LVM configuration and user data
• Stop application access to volumes in the LVM volume
group
• Run vxvmconvert to convert LVM volume group to VxVM
disk group without losing data

41
# vxvmconvert menu

Volume Manager Support Operations


Menu: VolumeManager/LVM_Conversion

1 Analyze LVM Volume Groups for Conversion


2 Convert LVM Volume Groups to VxVM
3 Roll back from VxVM to LVM
list List disk information
listvg List LVM Volume Group information

? Display help about menu


?? Display help about the menuing system
q Exit from menus

42
Command line conversion

• Command line invocation


– vxautoconvert
• Allows scripting of multiple volume groups
• No changes to defaults during conversion
• Command usage:
– # vxautoconvert vgtest102

43
Conversion example:
volume group display
--- Volume groups ---
VG Name /dev/vgtest102
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4607
VGDA 4
PE Size (Mbytes) 8
Total PE 9214
Alloc PE 9214
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
--- Logical volumes ---
LV Name /dev/vgtest102/lvol1
LV Status available/syncd
LV Size (Mbytes) 73712
Current LE 9214
Allocated PE 9214
Used PV 2
--- Physical volumes ---
PV Name /dev/dsk/c119t1d7
PV Status available
Total PE 4607
Free PE 0
Autoswitch On

PV Name /dev/dsk/c119t2d0
PV Status available
Total PE 4607
Free PE 0
Autoswitch On

44
Conversion example:
vxautoconvert

# vxautoconvert vgtest102
Convert LVM Volume Group vgtest102

Conversion Analysis of Volume Group vgtest102 was successful.


The Volume Manager is now reconfiguring (partition phase)...
Volume Manager: Initializing c119t2d0 as a converted LVM disk.
Volume Manager: Initializing c119t1d7 as a converted LVM disk.

Conversion completed successfully for LVM Volume Group(s) vgtest102


#

45
Conversion example:
converted disk group
DG NAME NCONFIG NLOG MINORS GROUP-ID
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO

dg dgtest102 default default 668000 1145482997.52239.fog01

dm dgtest102_c_01 c119t1d7 simple 896 37740544 -


dm dgtest102_c_02 c119t2d0 simple 896 37740544 -

v lvol1 - ENABLED ACTIVE 75481088 ROUND - gen


pl lvol1-01 lvol1 ENABLED ACTIVE 75481088 CONCAT - RW
sd dgtest102_c_01-01 lvol1-01 dgtest102_c_01 0 37740544 0 c119t1d7 ENA
sd dgtest102_c_02-01 lvol1-01 dgtest102_c_02 0 37740544 37740544 c119t2d0 ENA

46
Parallel conversions

• Ability to invoke vxautoconvert with multiple volume group


names, e.g.
– vxautoconvert vg01 vgora1 vgora2
• Performance enhancement
– Faster total conversion time
– Performance gains from 40-60% faster than converting the volume
groups serially (your mileage may vary)
• 2 VGs serial 77.41 secs vs. parallel 45.92 secs – 40.68%
• 4 VGs serial 197.99 secs vs. parallel 98.37 secs – 50.32%
• 6 VGs serial 294.34 secs vs. parallel 117.01 secs – 60.25%

47
vxvmconvert tips

• Do analysis as a separate step before conversion


– Volume group analysis can be done while file systems are online
– Only analyzes without changing data
– Provides valuable information without taking downtime
• Do conversions with file systems unmounted
– Recommendation in manual: file systems should be unmounted before
conversion, but not required
– Benchmark tests indicate conversions take significantly longer if file
systems are mounted

48
Is the system is booted on VxVM or
LVM?
• If you want to know is if the system is booted on VxVM or LVM.

• On a VxVM root:

# uname –r
B.11.23
# is_vxvmroot;echo $?
0

• On an LVM root:

# uname -r
B.11.23
# is_vxvmroot;echo $?
1

49
Q & A?
Additional slides -
LVM vs VxVM
Commands

51
HP-UX: LVM vs. VxVM Commands
LVM Description/Action VxVM Description/Action
lvchange Changes the vxedit or vxvol Creates, removes, and modifies Volume Manager records.
characteristics of set
logical volumes.

There is no single vxresize Resizes a file system and its underlying volume at the same time.
equivalent LVM
command.

lvlnboot Creates root, primary There is no equivalent command for this release.
and secondary swap
and dump volumes. It
also creates boot
areas on the disk.

lvcreate Creates a logical vxassist Creates volumes with the make parameter. Example: vxassist make vol_name 100M
volume. layout=stripe

lvextend Increases disk space vxassist Increases a volume in size with the growto or growby parameter. Example: vxassist
allocated to a logical growto vol_name 200M, vxassist growby vol_name 100Mvxassist creates and
volume. modifies volumes.

lvreduce Decreases disk vxassist Decreases a volume in size with the shrinkto or shrinkby parameters. Example: vxassist
space allocated to a shrinkto vol_name 200MMake sure you shrink the file system before shrinking the
logical volume. volume.

lvremove Removes one or vxedit Removes volumes with the -rf rm parameters.Example: vxedit -rf rm vol_name
more logical volumes
from a volume group. vxassist Removes a volume with the remove volume parameters.Example: vxassist remove
volume vol_name

lvsplit Splits a mirrored vxassist The snapshot operation takes one of the attached temporary mirrors and creates a new
logical volume into snapshot volume with the temporary mirror as its one plex. Example: vxassist snapshot vol_name
two logical volumes. new_volume

lvmerge Reverses and The snapback operation returns the snapshot plex to the original volume from which it
converts the lvsplit was snapped. Example: vxassist snapback new_volume
logical volumes to a
single logical volume.

lvsync Synchronizes mirrors vxrecovervxvol The vxrecover command performs resynchronize operations for the volumes, or for
that are stale in one start volumes residing on the named disks (medianame or the VxVM name for the disk).
or more logical Example: vxrecover vol_name media_name
volumes.

52
HP-UX: LVM vs. VxVM Commands

LVM Description/Action VxVM Description/Action


pvcreate Makes a disk an LVM disk. vxdisksetup Brings a disk under VxVM control. Example: vxdisksetup
c0t3d0Option 1 in the vxdiskadm menu adds or initializes one or
more disks.

pvdisplay Displays information about physical vxdisk list Lists information about VxVM disks. Example: vxdisk list disk_name
volumes in a volume group.

pvchange Sets physical volume characteristics to vxdiskvxdisk The vxdisk utility performs basic administrative operations on VxVM
allow/deny allocation of additional setvxedit disks. Operations include initializing and replacing disks, as well as
physical extents from this disk. taking care of some book-keeping necessary for the disk model
presented by the Volume Manager.

pvmove Moves allocated physical extents from vxevac Moves volumes off a disk.
source to destination within a volume
group. vxsd mv Performs volume operations on a subdisk. Moves the contents of old
subdisk onto the new subdisks and replaces old sub disk with the
new subdisks for any associations.

vxdiskadm The vxdiskadm script presents a menu of possible operations to the


user. Option 7 in the vxdiskadm menu moves volumes.

pvremove Removes the LVM header information vxdiskunsetup Removes the VxVM header information and releases the disk from
and releases the disk from LVM control. VxVM control.

vgcreate Creates a volume group. vxdiskaddvxdg init Creates a new disk group and/or adds disks to a disk group.

vgdisplay Displays information on all volume vxdg list Displays the contents of a disk group.
groups.
vxprint Displays information about all objects or a subset of objects.

vgchange Activates or deactivates one or more vxdg -g diskgroup Activates a shared disk group.
volume groups. set activation=
mode

vgextend Extends a volume group by adding one vxdiskadd Adds a disk to the disk group.
or more disks to it.
vxdiskadm Option 1 in the vxdiskadm menu adds disks to the disk group.

53
HP-UX: LVM vs. VxVM Commands
LVM Description/Action VxVM Description/Action
vgreduce Reduces a volume group by removing one or more vxdg Removes disks from a disk group.
disks from it. rmdisk

vxdisk rm Removes the specified disk access record by disk


access name.

vxdiskadm Option 3 in the vxdiskadm menu removes disks.

vgscan Scans all disks and looks for logical volume groups. vxinfo Displays information about volumes.

vxprint Displays complete or partial information from


records in VxVM disk group configurations.

vxdiskadm Option list in the vxdiskadm menu displays disk


information.

vgsync Synchronizes mirrors that are stale in one or more vxrecover Starts resynchronization and recovery of volumes.
logical volumes.

vgremove Removes the definition of a volume group from the vxdg deport Deports a disk group from the system.
system.
vxdiskadm Option 9 in the vxdiskadm menu removes a disk
group.

vgexport Removes a volume group from the system. vxdg Deports a disk group from the system.
deport

vxdiskadm Option 9 in the vxdiskadm menu removes a disk


group.

vgimport Adds a volume group to the system by scanning vxdg Imports a disk group.
physical volumes which have been vgexported. import

vxdiskadm Option 8 in the vxdiskadm menu imports a disk


group.

No LVM command vxplex Operates on plex objects.

lvchange, lvextend, Performs operations on logical volumes. vxvol Operates on volume objects.
lvcreate, lvreduce

No LVM command vxsd Operates on subdisk objects.

No LVM command vxmend Fixes simple misconfigurations.

54
• Site for Storage Foundation Basic 5.0
– http://www.symantec.com/enterprise/support/downloads.jsp?pid=53132

• VERITAS Volume Manager 4.1 Migration Guide for HP-UX


– http://support.veritas.com/docs/276969

• VERITAS Volume Manager 4.1 Troubleshooting Guide for HP-UX


– http://support.veritas.com/docs/276968
• VERITAS Volume Manager 4.1 Administrator's Guide for HP-UX
– http://entsupport.symantec.com/docs/a276966

55

You might also like