VERITAS Volume Manager: An Overview
VERITAS Volume Manager: An Overview
VERITAS Volume Manager: An Overview
Here's an excerpt from the Sun web page (www.sun.com) regarding VERITAS:
VERITAS Volume Manager software is an advanced, system-level disk and storage
array solution that alleviates downtime during system maintenance by enabling easy,
online disk administration and configuration. The product also helps ensure data
integrity and high availability by offering fast failure recovery and fault tolerant
features. VERITAS Volume Manager software provides easy-to-use, online storage
management for enterprise computing and emerging Storage Area Network (SAN)
environments. Through the support of RAID redundancy techniques, VERITAS
Volume Manager software helps protect against disk and hardware failures, while
providing the flexibility to extend the capabilities of existing hardware. By providing
a logical volume management layer, VERITAS Volume Manager overcomes the
physical restriction imposed by hardware disk devices.
So, there you have it. But let me briefly list some of the things they totally missed.
Hot Relocation: Designate "spares" which will take the place of failed disks
on-the-fly.
Dirty Region Logging (DRL): Volume transaction logs which provide fast
recoveries after system crashes.
As for OS support:
Let me add, when Sun and/or VERITAS says "OS xxx isn't supported", they don't
really mean "Ummm, we haven't really tried it yet", like most other companies in the
world. VERITAS actually installs kernel modules into the system, so if you run
SEVM 2.6 on Solaris 7, you'll be running Solaris 2.6 kernel modules in a Solaris 7
kernel. It doesn't work, I tried it! (and Sun was really pissed when they found out I
tried it )
Now, lets talk about these objects a bit. A disk is nothing new or magical. When we
want to use a disk in VERITAS we need to turn it over to VERITAS control. A disk
turned over to VERITAS control is then given a VERITAS name (like disk01). After
doing this the disk is no longer available to the system for anything outside of use
inside VERITAS. Also, when we turn disks over to VERITAS control we don't turn
over a partition (c0t0d0s0), but the whole disk itself (c0t0d0). Now that we've got a
VM Disk we then create a Sub Disk from the VM Disk. Think of a subdisk as a
VERITAS partition. We could make one big subdisk from the VM Disk and use the
whole disk, or we could create a bunch of smaller subdisks. You can divide VM Disks
into subdisks however you like. From subdisks (one or more) we create what is called
a plex. Plexes are confusing so let's talk about these in some length.
Say the following out loud: "A Plex is a Mirror. A Plex is a Mirror. A Plex is a
Mirror." Maybe you should do that a couple times. You may feel silly, but plexes are a
sort of cornerstone in VERITAS. A Volume is a container, in VERITAS. The volume
is made up of one or more plexes. See the catch? A Plex is a mirror, yes, however you
can make a volume with only one plex. Is a volume made with only one plex
mirrored? No. We'll explain this more later, but for the time being keep it in your
head. So, subdisks are grouped together into a plex. The interesting thing is that in
VERITAS the plexes do all the work, so lets say you wanted to create a Striped
volume. You would actually create a striped plex, and then attach that striped plex to a
volume. The volume doesn't care, it's just a container. See the beauty here? Let's put
all this stuff together and build an imaginary volume in VERITAS.
We're going to build a striped (RAID0) volume from 2 9G disks. We'll say that the
first disk is c1t0d0, and the second is c1t1d0. First, we need to put them in VERITAS
control, so we create VM disks. The VM disks are then named disk01, and disk02.
Next, we'll create subdisks using these two disks. Let's use the whole disks and just
create 2 subdisks, one for each VM disk. We'll call disk01's subdisk "disk01-01", and
disk02's subdisk "disk02-01". Now, it's plex time! We're going to build a striped plex
using our two subdisks, which we'll call "myplex". (Don't worry yet about how we
create the plex, just get the concepts now.) So now we've got a plex, which contains
the subdisks "disk01-01" and "disk02-01". Now, we create a volume named "myvol"
using "myplex". And bingo! We've got a striped 18G volume ready to create a file
system on! Maybe, if we used the short names mentioned earlier (with the list of
objects) and make an outline it'd look something like this:
dm
dm
disk01
disk02
sd
disk01-01 disk01 <-- Subdisk named "disk01-01" made from
"disk01"
sd
disk02-01 disk02 <-- Subdisk named "disk02-01" made from
"disk02"
pl
sd
sd
v
pl
from...
sd
sd
myvol
myplex striped
disk01-01
disk02-01
Look OK? Because if it does, take a look at this, real output from VERITAS, from a
real volume I created on my test machine:
v
pl
sd
sd
-
myvol
fsgen
ENABLED
35356957 -
ACTIVE
myplex
myvol
ENABLED
35357021 -
ACTIVE
disk01-01
myplex
ENABLED
17678493 0
disk02-01
myplex
ENABLED
17678493 0
Does that make any sense? Any at all? I hope it does. And if it does, you're ready for
VERITAS. We're going to explain more, much more, as we roll along, but at least
understand that:
Volumes are made up of plexes.
Good. One more note about plexes before we move on. Here's the groovy thing about
plexes. Because plexes are "mirrors", we can mirror the volume we built earlier
simply by building another plex identical to the first one, using two more subdisks
(which means we need 2 more vmdisks, etc,etc). Once we build the second plex, we
attach it to the volume (myvol) and presto chango! We're mirrored! This is really
kool... mirrors are something magical, they are a part of everything. If you have only
one mirror you may see yourself, but you'll need a second mirror to see yourself
holding the mirror. Hmmm?
I want to briefly discuss layouts. This is a topic will delve into more thoroughly later
when we talk about plex creation, but because the "VERITAS Getting Started Guide"
talks about them, I'll give you the highlights. This stuff may seem pretty basic now,
but the more you work will VERITAS the more you will come to appreciate layouts.
Layout can be thought of as the defining difference between the different types of
RAID. Simple RAID's don't really have a layout, you simple write linearly starting at
the beginning of the first disk until you hit the end, at this point you start writing the
second disk, and so on. Striped RAID's have special type of layout, however. Layouts
use the following terms:
stripe width (stwidth): The Amount of data to write to a disk before moving to
the next. (Generally 32k by default)
In the case of a Striped RAID, each subdisk would have a column number. A RAID0
with 4 disks, would have 4 columns. The first disk would be column 0 (remember:
everything starts with 0), the second would be column 1, the third would be column 2,
and the fourth disk would be column 3. Now, when we build a striped RAID we
specify both stripe width (which VERITAS calls "stwidth"), and the number of
columns (which VERITAS calls "ncolumns") which is the number of subdisks that are
going to have data on them. So, as mentioned earlier, we've got 4 disks, and we know
the column numbers for each subdisk. If we assigned a stripe width of 32k, and we
wrote some data to the volume, we'd write the data 32k at a time, writing each new
32k chunk to the next column, and wrapping around from the 4th column (column 3)
to the 1st column (column 0), untill all the data is written. Refer to the "RAID
Theory" course for more on this. If you've got this down, but feel foggy, just roll with
it, it'll click later as we build plexes.
Now, RAID5 is very similar because it's striped, it's just a different type of stripe.
RAID5 uses a layout called "Left Symmetric Layout", or more commonly as simply
"RAID5 layout". It would take me too much time to explain this, so check the book.
Read through the "RAID Theory" course if you need help, and then go back to the
book. You may have to look twice, but you'll get it.
But... you're saying to yourself, "how do I actually use a volume?" Well, that's easy
enough. You use a volume just like a disk block device. Once VERITAS is installed
and set up, you'll see a new directory in /dev. You'll see /dev/vx/, which is where all of
your volume block devices are. If you created a volume named "myvol", and wanted
to "newfs" it, you could do it like this:
# newfs /dev/vx/rdsk/myvol
Kool huh? Nothing magical. Poke around in the /dev/vx file tree and see where things
are, everything is fairly well named, and self explanatory. If you're new to device
trees, then just know that you can access your volumes from /dev/vx/dsk/ as though it
were a normal disk.
See how simple and logical VERITAS is? This is want makes VERITAS so kool.
There's no voodoo whoodoo. Everything is clearly laid out, and organized. I love
VxVM and I'm hoping that you're starting to as well.
vxrelocd : The Vx Hot Swap Manager, which reacts to disk failures with
spares.
Maybe, by now your asking "Hurry up, just tell me where the VERITAS
configuration file is!". Whelp, there isn't one! Everything we do to VERITAS is watch
by the vxconfigd. The vxconfigd then updates VERITAS's object database, and keeps
watching. As for the other daemons, they are pretty self explanatory. Vxiod makes
sure that data is written to the volume the way it's supposed to be (so if the volume is
striped, vxiod makes sure the data is written to the stripe the way we told it too, etc..).
Vxrelocd just looks for disk failures and if it finds one it puts a spare (if there is one)
in it's place
Dynamic Multi-Pathing: Also know as DMP, this feature allows for arrays
which can be attached to multiple controllers (such as the Sun A5000 family
of arrays) to leverage them for both load balancing and redundancy. So if your
disks are attached to both c1 and c2, and your using a 100Mb/s fiber
connection, with DMP you'll access the disks at 200Mb/s. And if c1 dies, for
any reason, you still have access to the disk through c2, which means zero
downtime for your volume. DMP can really save your butt if there is a failure.
Hot Spares: You can allocate VM Disks as spares, so that if a disk in one of
your plexes dies for some reason the spare will immediately take it's place and
again, zero downtime. You can have as many hot spares as you like, and VM
Disks allocated as spares can are independent of any particular disk group,
plex or volume, so you don't need to have different spares for different
volumes. Spares are managed by the vxrelocd as mentioned earlier.
Dirty Region Logging: Also known as DRL, this feature can be thought of as a
volumes diary. Before writes are made to a DRL'ed volume VERITAS makes
a note of the write in the DRL, marking that region "dirty". After the note is
made in the log, the write occurs. The idea here is that if the system crashes,
when the system comes back online it won't know what writes were in
progress. So, if a DRL log exists for the volume, it checks the log and then
sync's dirty regions from the other mirror(s). In this way, we don't have to
worry about corrupted data. DRL only applies to mirrored volumes, even
though DRL can be added to unmirrored volumes (it just won't do anything
useful).
be mounted and backed up. Once the backup is done you "release" the
snapshot. The kool thing is that while the snapshot exists the volume is still
read and writable to everyone else. Zero downtime backups!
OK, I'm going to leave the list at that for now. Don't get frustrated if your thinking
"Hey, that's kool! But your not telling me anything useful!", because all of that will
come later in the "Advanced VERITAS Theory" course, where I will talk about these
topics and more in detail. For the meantime, just know that they exists and can be
used.