basics of veritas volume manager 043007
Post on 18-Nov-2014
138 Views
Preview:
TRANSCRIPT
Gary PhillipsSr. Systems Engineer, Symantec
Basics of Veritas Volume Manager and Storage Foundation
2
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
3
Storage Foundation and Veritas Volume Manager
4
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
5
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
6
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
7
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
8
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
9
VxVM data structures and objects
10
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
11
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
12
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
13
Example of a VM disk
Physical DiskVM disk: disk01
c0t4d0
disk01
Public Region
Private Region
Disk under VxVM control
14
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
15
disk02disk01 disk03 disk04
VM Disk VM Disk VM Disk VM Disk
Example of a Disk Group
dg01
16
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
17
Example of a subdisk
disk01-02
disk01-01
disk01
Free Space
blks 0-9999
10000-15999
18
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
19
Example of plexes
plex1
plex2disk01-02
disk01-01Disk
Free Space
blks 0-9999
10000-15999
VM Disk: disk01
20
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
21
Example of a volume
plex1
subdisk2
subdisk1
Volume1
22
disk02
disk02-03
disk01
disk01-03
disk03
disk03-02
disk04disk04-01
VM Disk VM Disk VM Disk VM Disk
VxVM objects summary
Volume
disk04-01disk01-03
plex01 plex02
disk03-02
disk02-03
Disk Group
23
Basic VxVM commands
24
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
25
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
26
VEA Main Window
27
VEA
28
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
29
vxdiskadm
30
Command Line Interface
31
Basic Commands
• vxdiskadm• vxprint• vxassist• vxdg• vxdisk• vxresize• vxedit
• vxvol• vxdisksetup• vxtask• vxdctl• vxlicrep• vxlicinst• vea
32
Key directories
• /dev/vx/*• /etc/vx/licenses/*• /opt/VRTS*• /var/adm/vx/veacmdlog
33
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
34
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
35
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
36
Migration from LVM to VxVM
37
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
38
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
39
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.
40
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
41
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
42
# 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
43
Command line conversion
• Command line invocation– vxautoconvert
• Allows scripting of multiple volume groups • No changes to defaults during conversion• Command usage:
– # vxautoconvert vgtest102
44
Conversion example:volume group display
--- Volume groups ---VG Name /dev/vgtest102VG 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/lvol1LV Status available/syncdLV Size (Mbytes) 73712 Current LE 9214 Allocated PE 9214 Used PV 2 --- Physical volumes ---PV Name /dev/dsk/c119t1d7PV Status available Total PE 4607 Free PE 0 Autoswitch On
PV Name /dev/dsk/c119t2d0PV Status available Total PE 4607 Free PE 0 Autoswitch On
45
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
#
46
Conversion example:converted disk groupDG NAME NCONFIG NLOG MINORS GROUP-IDDM NAME DEVICE TYPE PRIVLEN PUBLEN STATERV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRLRL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNKV NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX UTYPEPL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODESD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODESV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODEDC NAME PARENTVOL LOGVOLSP 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 - genpl lvol1-01 lvol1 ENABLED ACTIVE 75481088 CONCAT - RWsd dgtest102_c_01-01 lvol1-01 dgtest102_c_01 0 37740544 0 c119t1d7 ENAsd dgtest102_c_02-01 lvol1-01 dgtest102_c_02 0 37740544 37740544 c119t2d0 ENA
47
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%
48
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
49
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 –rB.11.23# is_vxvmroot;echo $?0
• On an LVM root:
# uname -rB.11.23# is_vxvmroot;echo $?1
Q & A?
51
Additional slides -LVM vs VxVM Commands
52
HP-UX: LVM vs. VxVM Commands
LVM Description/Action VxVM Description/Action
lvchange Changes the characteristics of logical volumes.
vxedit or vxvol set
Creates, removes, and modifies Volume Manager records.
There is no single equivalent LVM command.
vxresize Resizes a file system and its underlying volume at the same time.
lvlnboot Creates root, primary and secondary swap and dump volumes. It also creates boot areas on the disk.
There is no equivalent command for this release.
lvcreate Creates a logical volume.
vxassist Creates volumes with the make parameter. Example: vxassist make vol_name 100M layout=stripe
lvextend Increases disk space allocated to a logical volume.
vxassist Increases a volume in size with the growto or growby parameter. Example: vxassist growto vol_name 200M, vxassist growby vol_name 100Mvxassist creates and modifies volumes.
lvreduce Decreases disk space allocated to a logical volume.
vxassist Decreases a volume in size with the shrinkto or shrinkby parameters. Example: vxassist shrinkto vol_name 200MMake sure you shrink the file system before shrinking the volume.
vxedit Removes volumes with the -rf rm parameters.Example: vxedit -rf rm vol_name lvremove Removes one or 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 logical volume into two logical volumes.
vxassist snapshot
The snapshot operation takes one of the attached temporary mirrors and creates a new volume with the temporary mirror as its one plex. Example: vxassist snapshot vol_name new_volume
lvmerge Reverses and converts the lvsplit logical volumes to a single logical volume.
The snapback operation returns the snapshot plex to the original volume from which it was snapped. Example: vxassist snapback new_volume
lvsync Synchronizes mirrors that are stale in one or more logical volumes.
vxrecovervxvol start
The vxrecover command performs resynchronize operations for the volumes, or for volumes residing on the named disks (medianame or the VxVM name for the disk). Example: vxrecover vol_name media_name
53
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 volumes in a volume group.
vxdisk list Lists information about VxVM disks. Example: vxdisk list disk_name
pvchange Sets physical volume characteristics to allow/deny allocation of additional physical extents from this disk.
vxdiskvxdisk setvxedit
The vxdisk utility performs basic administrative operations on VxVM disks. Operations include initializing and replacing disks, as well as taking care of some book-keeping necessary for the disk model presented by the Volume Manager.
vxevac Moves volumes off a disk.
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.
pvmove Moves allocated physical extents from source to destination within a volume group.
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 and releases the disk from LVM control.
vxdiskunsetup Removes the VxVM header information and releases the disk from VxVM control.
vgcreate Creates a volume group. vxdiskaddvxdg init Creates a new disk group and/or adds disks to a disk group.
vxdg list Displays the contents of a disk group. vgdisplay Displays information on all volume groups.
vxprint Displays information about all objects or a subset of objects.
vgchange Activates or deactivates one or more volume groups.
vxdg -g diskgroup set activation= mode
Activates a shared disk group.
vxdiskadd Adds a disk to the disk group. vgextend Extends a volume group by adding one or more disks to it.
vxdiskadm Option 1 in the vxdiskadm menu adds disks to the disk group.
54
HP-UX: LVM vs. VxVM Commands
LVM Description/Action VxVM Description/Action
vxdg rmdisk
Removes disks from a disk group.
vxdisk rm Removes the specified disk access record by disk access name.
vgreduce Reduces a volume group by removing one or more disks from it.
vxdiskadm Option 3 in the vxdiskadm menu removes disks.
vxinfo Displays information about volumes.
vxprint Displays complete or partial information from records in VxVM disk group configurations.
vgscan Scans all disks and looks for logical volume groups.
vxdiskadm Option list in the vxdiskadm menu displays disk information.
vgsync Synchronizes mirrors that are stale in one or more logical volumes.
vxrecover Starts resynchronization and recovery of volumes.
vxdg deport Deports a disk group from the system. vgremove Removes the definition of a volume group from the system.
vxdiskadm Option 9 in the vxdiskadm menu removes a disk group.
vxdg deport
Deports a disk group from the system. vgexport Removes a volume group from the system.
vxdiskadm Option 9 in the vxdiskadm menu removes a disk group.
vxdg import
Imports a disk group. vgimport Adds a volume group to the system by scanning physical volumes which have been vgexported.
vxdiskadm Option 8 in the vxdiskadm menu imports a disk group.
No LVM command vxplex Operates on plex objects.
lvchange, lvextend, lvcreate, lvreduce
Performs operations on logical volumes. vxvol Operates on volume objects.
No LVM command vxsd Operates on subdisk objects.
No LVM command vxmend Fixes simple misconfigurations.
55
• 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
top related