Technical Support Group Bangalore 1 What is Veritas Volume Manager Veritas Volume Manager is an Online Storage Management Tool that provide a logical volume management layer which overcomes the physical restrictions of disk devices by spanning volumes across the spindles. It protects against the Disk and Hardware failure 2 Benefits of Volume Manager Manageability You can manage all storages using an intuitive graphical user interface Provides consistent management across all the platforms ( Solaris, HPUX, Windows NT/2000, IBM) Management of storage is performed on-line in real time , eliminating the need for downtime. 3 Benefits of Volume Manager Availability Integrity of storage is maintained by true mirroring across all writes Through RAID Techniques, Storage remains available in the event of Hardware failures Data Redundancy is maintained by hot-relocation, which protects Against multiple simultaneous disk failures Recovery Time is minimized, through logging and background mirror Synchronization. 4 Benefits of Volume Manager Performance I/O Throughput is maximized by measuring and modifying volumes Layouts while storage remains on-line. Performance bottlenecks can be eliminated using the VxVm analysis tool. 5 Benefits of Volume Manager Scalability VxVM Runs on both 32 But and 64 Bit Operating systems Storage can be deported to large enterprise-class platforms Storage devices can be spanned VxVM is fully integrated with Veritas File System 6 Veritas Volume Manager Fundamentals Describe how physical data storage relates to virtual data storage in Veritas Volume Manager. Install Veritas Volume Manager Perform Volume Management Tasks Using GUI and CLI. Manage Disks and Disk Groups Create and Manage Virtual Volumes 7 Physical Storage Objects VTOC: Stores Information about Disk structure and Organization. Also Called as Disk Label Partition: After VTOC, remainder of the Disks are divided ito units called Partitions 8 How Does Volume Manager Works You Enable Virtual data storage by bringing the disks under volume manager control.It means that volume manager creates virtual objects and establishes a logical connection between those objects and underlying physical objects. Technical Support Group Bangalore 9 What Happens to a Disk under VxVM Control Volume Manager removes all the partition table entry from VTOC Creates two partitions on the physical disk. One is Private region and second is public region. Private region stores information like configuration database,kernel logs, and disk headers.Minimum size is 1024 Sectors and Maximum is 512000 Sectors ( 512k Sectors) Public Region consists of the remainder of the Disk.This represents the available space for VxVM to create volumes and assign data to it. Volume Manager updates the VTOC, with information about the removal of the existing partition and the addition of the new partition during initialization process. 10 Volume Manager-Virtual Objects Disk Groups Volume Manager Disks Sub-Disks Plex Volume 11 Virtual Objects Volume Manager consists of variety of virtual objects .Volume is one of the variety of the virtual Objects. Technical Support Group Bangalore 12 Disk Group Disk group is a collection of VxVM disks. You group disks into disk groups for management purpose. 13 Volume Manager Disks A Volume Manager Disk is created as soon as a physical disk is brought under VxVM control. Each VxVM disk corresponds to one physical Disk. Technical Support Group Bangalore 14 Sub Disks A VxVM Disk can be divided into one or more sub-disks. A sub-disk is a set of contiguous blocks that represents a specific portion of VxVM disk, which is mapped to specific region of the Disk. Technical Support Group Bangalore 15 Plex A Plex is a structured or ordered collection of sub-disks that represents a copy of data. A plex consists of one or more sub-disks located in one or more physical disks. Technical Support Group Bangalore 16 Volumes A Volume is a virtual storage device that is used by applications in a manner similar to physical disk. Volume is composed of one or more plexes. Technical Support Group Bangalore 17 Summary Of Virtual Objects 18 Volume Layouts Volume layout refers to organization of plexes in a volume. 19 Concatenated Volume In a concatenated volume, sub disks are arranged both sequentially and contiguously Concatenation allows a volume to be created from one or more physical disks, if there is not enough free space to accommodate the volume in a single disk 20 Striped Volume In a Striped Volume, data is spread evenly across the sub-disks. Stripes are equally sized fragments that are allocated alternately and evenly to the sub-disk inside a single plex. There must be at least two sub-disks inside a plex, each of which must exist on different physical disk 21 Mirrored Volume Mirrored Volume uses multiple plexes to duplicate the information contained in a volume. At least two plexes are required for a true mirroring.Each of this plexes must exists on different physical disk for redundancy. 22 RAID-5 Volume A RAID-5 Volume uses striping to spread data and parity evenly across physical disks. Each stripe consists of a parity stripe unit and data stripe unit.Parity can be used to re-construct the data if one disk fails 23 Planning First time VxVM Setup 24 Which Disks Under VxVM control The only disks that you should place under VxVM control during installation are the root disk and its mirror. You can add other disks and disk groups after installation If you do not plan to bring the system disk under VxVM control, then place one disk under rootdg. Rootdg is required, so that volume manager daemons can be started in enabled mode. Technical Support Group Bangalore 25 Enclosure based Naming This allows VxVM to access enclosures as a separate physical entities.Enclosure based naming can be useful while implementing DMP(Dynamic Multipathing).When you install VxVM, You are prompted whether to use enclosure based naming 26 Excluding Disks If you want any disks to be excluded from volume manager control, then you can specify in the exclusion files 27 Prevent Multi-pathing With VxVM version 3.1.1 later, DMP Driver must always be present on the system for VxVM to function.However you can prevent VxVM from multipathing some or all devices without removing the DMP layer. 28 Preserve or eliminate disk data When you place a disk under volume manager control, either you can preserve the data (Encapsulation) or eliminate the data (initialization) Encapsulation should contain minimum 2 free partition table entries on the disk to be encapsulated. Technical Support Group Bangalore 29 System Root Disk under VxVM Control 30 Typical Initial VxVM Setup Technical Support Group Bangalore 31 Volume Manager Installation Software Packages VRTSvxvm VRTSlic VRTSvmdev VRTSvmman VRTSvmdoc VRTSvmsa Drivers and Utilities Licensing Utilities Developer Kit Manual Pages Documentation Storage Administration Server and Client 32 The vxinstall Program This program is used to initialize the volume manager after adding the software package. Should be run only once in a System Purpose of this program is to create rootdg disk group Volume Manager requires rootdg disk group and it should contain at least one disk This program is an interactive tool. Example : # vxinstall 33 The vxinstall program Technical Support Group Bangalore 34 Volume Manager User Interface Volume Manager Storage Administrator (VMSA- Gui) Ex: # vmsa & or # vea & Command Line Interface Ex: # vxdg list Volume Manager Support Operations (Menu Driven) Ex: # vxdiskadm 35 VMSA Main Window Technical Support Group Bangalore 36 Command Line Interface Many of the commands can be found in /etc/vx/bin /usr/sbin /usr/lib/vxvm/bin Examples : # vxdisk list # vxdg list # vxprint -ht 37 Vxdiskadm Interface Technical Support Group Bangalore 38 Adding Disks Before You Add Disks. 39 Disk Configuration Stages Prior-VxVM 40 Disk Configuration Steps Stage One An Initialized Disk is placed under Volume Manager’s Free Disk pool. While initializing it will create private and public region. Technical Support Group Bangalore 41 Disk Configuration Steps Stage Two An initialized Disk is placed under Disk Group.Disk Media Name is assigned to it. Technical Support Group Bangalore 42 Disk Configuration Steps Stage Three Creating Volumes . Assigning disk space to volumes. Technical Support Group Bangalore 43 Adding Disk : CLI The vxdisksetup Command: # vxdisksetup –i c1t0d0 # vxdg –g oradg adddisk c1t0d0=disk01 [ Initialize Disk ] The above command add the disk c1t0d0 to diskgroup “oradg” with disk name as disk01. When you add a disk to diskgroup, it is stamped with the system host id. Note: Diskgroup should exist. 44 Viewing Disk Information Technical Support Group Bangalore 45 Viewing Disk Information Information on individual disk. # vxdisk list <diskname> 46 Removing a Disk. Before removing a disk, make sure there is no data on the disk. Else you evacuate the data on the disk onto another disk. Evacuating a Disk moves the content of the disk onto other disk. The disk to which data is evacuated should belong to the same disk group. Example: # vxevac –g oradg disk01 disk02. The above command evacuates data from disk01 to disk02 under diskgroup oradg 47 Removing a Disk # vxdg –g oradg rmdisk disk01 The above command removes the disk “disk01” from diskgroup “oradg” and places the disk in free disk pool. Once the disk is placed in free pool, it can be completely taken out of volume manager control using the following command # vxdiskunsetup –C c1t0d0 -C option forces the de-configuration 48 Managing Disk Groups Why Disk Groups ? Disk Groups enables grouping of disks into logical collections for a particular set of users or applications. It can be easily moved from one host machine to another. Enables high availability. This can be shared by two or more hosts, but only one can access at a time. If one host crashes, other host takes over. You can never have an empty disk group. Disk group cannot share resources. ( One disk belonging to Multiple disk group. 49 Managing Disk group Disk Media Name: Unique name assigned to a disk, when it is added to the disk group. Disk Access record: Mapping of physical disk location to Disk media name. This record can be re-created by running # vxdctl enable Technical Support Group Bangalore 50 Managing Disk Group Example of Re-configuration Run # vxdctl enable Technical Support Group Bangalore 51 Managing Disk group rootdg The rootdg is a special disk group which is created during vxinstall process. VxVM requires rootdg with atleast one disk, to start volume manager. If you want your boot disk to be bootable under volume manager, then boot disk must be in rootdg Rootdg follows different disk naming conventions than other disk groups ( rootdg disk names: disk01, disk02, ….) Rootdg can not be destroyed or deleted. Technical Support Group Bangalore 52 Managing Disk group Disk group and High Availability 53 Creating Disk Group (CLI) To create a disk group from command line use the following command # vxdg init newdg newdg01=c1t1d0s2 To verify whether disk group is created 54 Setting up Spare Disk Setting a spare disk inside a Disk group enables the hot-relocation feature of VxVM. If an I/O failure occurs, hot-relocation automatically relocates the redundant subdisks to the spare disk and restores the affected volume manager data and objects. Example: # vxedit –g oradg set spare=on oradg01 The above example sets disk “ oradg01” as a spare to the disk group “oradg” Note: This is applicable only for RAID-1 and RAID-5 Volumes 55 Making Disk group Un-available Deporting a Disk Group makes the disk group and its volume unavailable. This means that disk group and its objects can not be accessed. To resume management it needs to be imported. When you deport the disk group you also have the option to rename to the disk group. You also have the option to specify the new host, to which disk group will be imported next time. Before deporting you need to unmount all the file systems lying under disk group Example: # umount /data # umount /data1 # vxdg deport datadg 56 Making Disk Groups Available Importing a disk group re-enables the access to a deported disk group. To move a disk group from one system to another system, it needs to deported on first system and then imported on to other system You can rename the disk group while importing. Importing a disk group # vxdg import datadg Importing and rename # vxdg –n newdg import datadg Import and temporarily rename # vxdg –t –n newdg import datadg 57 Disk group Host-Lock When a disk group is created, system writes a lock on to the disk group header. This lock is nothing but the value in hostname field of the disk group header. The lock ensure that, dual-ported disks are not used by both the systems at the same time. If a system crashes, the lock remains on the disk group and it prevents the other machine from being imported.If you are sure that the disk group is not in use by other system, then the host lock can be cleared while importing the disk group. Example: # vxdg –Cf import datadg The above command clear the host lock and forces the import. 58 Moving Disk Group 59 Destroying Disk Group Destroying a disk group permanently removed the disk group from volume manager, and places all the disks in free disk pool. Volume and configuration information are removed. Example: # vxdg destroy olddg 60 Viewing DiskGroup Information Vxdisk and vxdg commands Example: Technical Support Group Bangalore 61 Viewing DiskGroup Information Example: 62 Viewing DiskGroup Information Viewing Free Space 63 Working With Volumes What is Volume & Volume layout ? Volume is made up of portions of one or more physical disks. Volume can provide greater flexibility, availability, and performance than a single physical disk. Volume layout is based on the way plexes are organized to remap the volume address space through which I/O is redirected at run time. Each volume layout has their own advantages and dis-advantages 64 VxVM Supported RAID Levels RAID 0 - Simple Concatenation or striping RAID 1 - Mirroring RAID 5 - Striping with distributed parity. RAID 0+1 - Adding Mirror to a concatenated / striped layout RAID 1+0 - Mirroring occurs below the concatenation / striping 65 Concatenated Layouts 66 Striped Layout 67 Mirrored Layout 68 RAID-5 Layout 69 RAID 0+1 ( Mirror-Stripe) 70 RAID 0+1 ( Mirror-Concat) 71 Creating Volumes (CLI) The “vxassist” Utility Syntax: vxassist –g <diskgroup> make <volname> length [attributes] # # # # # vxassist vxassist vxassist vxassist vxassist –g –g –g –g –g datadg datadg datadg datadg datadg make make make make make vol1 vol1 vol1 vol1 vol1 50m 50m datadg01 500m layout=stripe 500m layout=stripe stripeunit=64k 200m layout=mirror disk01 disk02 72 Estimating Volume Size Before Creating a volume in a diskgroup, its necessary to estimate the volume size that is going to get created. Example : # vxassist –g datadg maxsize layout=raid5 The above command estimates the maximum size of an raid5 volume that can be created. # vxassist –g datadg maxgrow datavol The above command estimates how much the volume (datavol) can be growed. 73 Viewing Volume Information Use # vxprint , for volume information Example: # vxprint –rht # vxprint –g oradg –ht Options: -r ---Display layered volume information -h ---List hierarchies below selected records -t ---Print single line output records 74 Vxprint Example 75 Removing a Volume (CLI) Syntax : vxassist –g <diskgroup> remove volume <volname> Example One. # vxassist –g oradg remove volume oravol1 Example Two. # vxedit –rf rm oravol The above command will complete remove all the underlying plexes and subdisks of the volume “oravol” 76 Adding a Mirror Volume Syntax : vxassist –g <diskgroup> mirror <volume name> Example: # vxassist –g oradg mirror oracle The above command mirrors the oracle volume # vxassist –g oradg mirror oracle oradg01 The above command mirrors oracle volume on to the disk oradg01 # vxmirror –g oradg –a The above command mirrors all the unmirrored volumes in oradg 77 Removing a Mirror For example for the volume “datavol”, to remove the plex that contains the sub disk from datadg01 disk, execute # vxassist –g datadg remove mirror datavol !datadg01 For example, to remove the plex that uses any disk except datadg01 # vxassist –g datadg remove mirror datavol datadg01 Other methods: # vxedit –g datadg –rf rm datavol-02 Where datavol-02 is the plex name. 78 Logging In VxVM Two Types of logging are supported in VxVM: Dirty Region Logging for mirrored volumes RAID-5 logging for RAID-5 volumes DRL: This is used with mirrored volumes. This keeps track of the regions that have changed due to I/O writes to the volumes.Prior to every write a bit-map is written to a log to record the area of the disk that is being changed. In case of a system failure, DRL uses this information to recover only the portions of the region that has changed. RAID-5: When you create a RAID-5 volume, a RAID-5 log is created by default. This is used for speedy resync of the volume, in case of a system failure 79 Adding a log (CLI) You can add a log volume to only mirrored and RAID-5 Volumes Example: To add a log to mirrored volume # vxassist –g datadg addlog datavol logtype=drl Example: To add a log to RAID-5 volume # vxassist –g oradg addlog oracle Note: VxVM automatically recognizes the RAID-5 Layout and add the log 80