Veritas Volume Manager



VxVM Tutorials: Creating Volume and file system. VxVM allows a system administrator to configure various volume layouts for the volume thus allowing high redundancy and high performance. Let us see how we can create a basic volume and a file system with Veritas Volume Manager. I have added six, 1 GB disks (other than two, 16 GB disks for root. Learn more about the High-Availability Monitoring solution. Veritas Volume Manager KM for PATROL monitors all the Veritas Volume Manager components to ensure availability, maximum performance, and integrity. Veritas Volume Manager (VxVM) is a popular and powerful, enterprise-class storage management tool. When you want to inspect a large setup (or sometimes even a small one!), its output (vxprint) can be unclear, even cryptic. Here is a small (root, swap, /var) configuration.

VxVM Tutorials

VxVM allows a system administrator to configure various volume layouts for the volume thus allowing high redundancy and high performance. Let us see how we can create a basic volume and a file system with Veritas Volume Manager.

I have added six, 1 GB disks (other than two, 16 GB disks for root mirroring) to my vmware virtual machine for future tutorials.
To check all the disks scanned under the Operating System:

OS native Vs Enclosure based naming Scheme

We can have disks naming scheme in 2 ways – OS native and Enclosure based. For my convenience I will be using OS native disk scheming. But you can have it your way. To change the scheme use vxdiskadm command and select option 20. You can use enclosure based naming scheme if you prefer that. You would see the difference in the DEVICE column in the output of “vxdisk -eoalldgs list” as shown above and below in the vxdisk command output.
To check the current naming scheme

To change the naming scheme through command line

I would exclude the root disk (c1t0d0) and a disk supposed to be mirrored (c1t1d0) with it later on.

Now first initialize the disk we want to use for the disk group creation. If you have seen output of vxdisk list, you would see all the disks with STATUS of online invalid. This indicates that the disk is not under VxVM control. To take it under VxVM control we would initialize it.

vxdiks list would now show you the status as online implying that the disk is now under VxVM control.

Initialization Vs Encapsulation

Now before going forward let us see whats the difference between encapsulation and initialization.
Initialization – When a disk is initialized a private and public region is created on the disk (placed under VxVM control) and VM disk header information is written to the private region. All the data already present on the disk is erased.
Encapsulation – Disk is taken under VxVM control when it is initialized but the data is preserved in this method.

Now create the disk group mydg by specifying the disk we just initialized. You can give any name to disk you prefer instead of disk01.

Now create a simple concatenated volume myvol of around 500 MB size in the mydg.

Create a vxfs file system on this volume and also create a directory to mount this volume.

To make the mount to persists after reboot you can add an entry to /etc/vfstab. Also it is a preferred way to check the entry in vfstab by mounting it with just “mount /mount-point” or “mountall” command.

Adding a new disk to the existing disk group

We can also add disks after we create the disk group. Before adding a new disk initialize it.

To check the layout of the volume we just create:

As you can see in the output above, a plex with one subdisk is created which comprises the volume myvol. You can also see the layout as concat in the 6th column.

To heck the disk property of a disk in the mydg :

Remove volume , diks and diskgroups

Before removing the volume umount the mount point /data and remove the entry from vfstab.

After removing the volume you can remove the disks in the diskgroup. But the last disk can not be removed. For that we have to remove the entire disk group mydg. After removing the DG we can use these disks in any other DG.

Understand vxprint !

What Does it Do?

In a nutshell, it takes difficult-to-understand VxVM data and turns it into a very usable spreadsheet. Specifically, it takes vxprint output, and creates CSV spreadsheets, for use in Microsoft Excel, OpenOffice.org, or your favourite spreadsheet application.

Actually, it can also take the output of the cfg2html tool (which basically just includes a vxprint -Ath output).

So - you can use any of the following:

  • vxprint output
  • vxprint -Ath output (aka vxprint -t)
  • cfg2html output
Volume

The CSV file, when downloaded, will have default column widths, which will not suit your needs; for presentation purposes, you will need to resize the column widths. The easiest way to do that is to Edit->Copy from this sample, and then in your CSV file, Edit->Paste Special and select 'Column Widths'.

If you are can't wait to read on, just download the sample, and play about with it. This 30-line spreadsheet condenses the contents of this 218-line vxprint output.

Not only that, but see what happens when you resize the volumes. See that the 'Used' and 'Free' totals are updated automatically; You will never need to work out volume sizes for yourself ever again.
Veritas, this tool, and Excel, will do the job for you.
The only link that you have been missing, is this tool.

One thing to note, is that the 'Capacity' column shows the total available capacity of the diskgroup. Spreadsheets are not sufficiently intelligent to deal with scenarios whereby you have a mixture of RAID layouts, so - for example - if you have 2 x 73Gb disks, mirrored, with 30Gb used: that will be shown as 2x73 = 146Gb Capacity, 30Gb Used, 116Gb Free. In reality, you will be able to add only 43Gb worth of new mirrored volumes, though you could add 86Gb of RAID0 storage. In other configurations, you may be able to add RAID 5 or RAID 1+0 (RAID10) storage, leading to other calculations of the total capacity available.
As a result, the spreadsheets generated by this tool, assume optimal use of the rootdisk.

When Spreadsheet calculations are disabled, it would be possible for the script to calculate the actual usages. If Spreadsheet calculations are enabled (a rather useful feature, I find), this would make no sense, as the spreadsheet software does not know your LUN sizes, etc). This will be considered if someone gets in touch and requests it. Otherwise, I don't need it; we tend to use SAN (Hardware RAID5; VxVM RAID 0) or local disk (Mirrored, in which case I just halve the Capacity cell).

Veritas Volume Manager (VxVM) is a popular and powerful, enterprise-class storage management tool. Whenyou want to inspect a large setup (or sometimes even a small one!), its output (vxprint) can be unclear, even cryptic. Here is a small (root, swap, /var) configuration:

It is difficult (though possible) to tell from the text output of vxprint, how much space is used where, how the storage is laid out, and what is available for new volumes.

So what we have here is a free, online tool which converts the 16 lines gibberish above into 3 lines (or 218 lines to 30 lines in the other example) in a nice, clean spreadsheet, which explains the configuration and sizes of your volumes.

Download the sample, and play about with it, to see what happens when you resize different volumes. You should see that the 'Used' and 'Free' totals are updated automatically.

This is a tool which I use on a regular basis to create CSV (spreadsheet) files automatically. You can open and edit the CSV with Microsoft Excel, OpenOffice.org, or just about any spreadsheet software made.

How To Use It

The machine you want to report on may not have internet access and spreadsheet software, so it is likely that you will need to transfer some files.

There are two files involved: The first, is what you create on the machine:You will probably need to copy this file to your desktop PC, which you use to access the web. Then, just hit the button above, to locate 'Your vxprint File', optionally select a title, and hit the Interpret Veritas File button.

Veritas Disk Management

This generates the second file, the CSV which should automatically open up in Microsoft Excel, OpenOffice.org, or the spreadsheet of your choice.

For formatting, I tend to use this sample, zoomed to 75% (View -> Zoom -> 75%). To copy this formatting, just copy mine, then do 'Edit -> Paste Special', and choose 'Column Widths'.

Veritas Volume Manager Commands

Excel Calculations

Veritas Volume Manager For Windows

You may have noticed that there is an 'Excel Calculations' option; if that is selected, then the CSV will include the necessary formulae to automatically update the 'Used' and 'Free' columns, when you edit the spreadsheet. If you prefer, you can turn this off by deselecting the option.