Design of a Cluster Logical Volume Manager


Abstract:
Logical Volume Managers provide a higher level view of disk storage on a computer system than the traditional view of disks and partitions. However the functionality of the existing logical volume managers is restricted to a single machine and they cannot be easily incorporated in a cluster environment. This is because logical volume managers today do not support distributed updates and locking on metadata. I propose a design of a Cluster Logical Volume Manager which incorporates a distributed locking mechanism on metadata to enforce a single node exclusive access to cluster metadata. The design can be incorporated in practically all the logical volume managers available today. As a case study, I have proposed a design for the Cluster Logical Volume Manager, which enhances the Linux Logical Volume Manager to function in a cluster. The design incorporates a cluster lock manager in the architecture, which ensures that the metadata operations are handled very carefully ensuring stability of the cluster data.


Logical Volume manager

What is a Logical Volume Manager?

In an open systems environment, logical volume manager (LVM) virtualizes storage by consolidating physical storage into logical volumes, which are available to applications or file systems. LVMs are available on most Unix platforms (including Linux) and on Windows 2000. By assembling virtual storage volumes out of numerous physical devices, you can create storage configurations tuned for specific applications, without the limitations of specific hardware devices. Instead, you can make use of the available storage, without locking into proprietary storage solutions. Logical volume managers improve application availability by building redundancy into the logical volume itself. The possibilities go beyond simple mirroring and RAID. For example, the failure of a device in a redundant storage configuration can degrade performance and expose the data to risk from another failure. The logical volume manager can maintain a pool of spare disks that can be automatically swapped in (hot relocation) when a device fails in a logical volume. It can even move data back automatically when the failed device is replaced or repaired. Unlike a physical device, a logical volume has a nearly limitless capacity: Administrators can add storage as needed without interrupting access to the data. When used with a database's auto-extend capabilities or a file system's automatic extension, a logical volume manager can significantly ease the problem of provisioning storage for growing applications.
LVM supports enterprise level volume management of disk and disk subsystems by grouping arbitrary disks into volume groups. The total capacity of volume groups can be allocated to logical volumes, which are accessed as regular block devices. Further, LVM provides logical separation of storage, the ability to move data from one physical device to another while on-line, and dynamic block device resizing. LVM also enables system administrators to upgrade systems, remove failing disks, reorganize workloads, and adapt to changing system needs, through a minimum amount of time and effort. LVM is a major building block for the Linux OS because it allows Linux to be used in an enterprise server environment. In addition to addressing the needs of the enterprise computing sector, LVM provides ease-of-use for desktop users as well, by simplifying on-disk management of Linux file systems and volumes.

What is Volume Management?



Volume Management creates a layer of abstraction over the storage. Applications use a virtual storage, which is managed using an LVM [7]. Volume management lets you edit the storage configuration without actually changing anything on the hardware side, and vice versa. By hiding the hardware details it completely separates hardware and software storage management, so that it is possible to change the hardware side without the software ever noticing, all during runtime. With an LVM system uptime can be enhanced significantly, because for changes in the storage configuration no application has to be stopped any more.
Logical volume management provides a higher-level view of the disk storage on a computer system than the traditional view of disks and partitions. This gives the system administrator much more flexibility in allocating storage to applications and users. Storage volumes created under the control of the logical volume manager can be resized and moved around almost at will, although this may need some upgrading of file system tools.

Use of a Logical Volume Manager:


Logical volume management is traditionally associated with large installations containing many disks but it is equally suited to small systems with a single disk or maybe two. One of the difficult decisions facing a new user installing Linux for the first time is how to partition the disk drive. The need to estimate just how much space is likely to be needed for system files and user files makes the installation more complex than is necessary and some users simply opt to put all their data into one large partition in an attempt to avoid the issue. Once the user has guessed how much space is needed for /home /usr / (or has let the installation program do it) then is quite common for one of these partitions to fill up even if there is plenty of disk space in one of the other partitions.
With logical volume management, the whole disk would be allocated to a single volume group and logical volumes created to hold the / /usr and /home file systems. If, for example the /home logical volume later filled up but there was still space available on /usr then it would be possible to shrink /usr by a few megabytes and reallocate that space to /home. Another alternative would be to allocate minimal amounts of space for each logical volume and leave some of the disk unallocated. Then, when the partitionsstart to fill up, they can be expanded as necessary.

As an example: 
Consider a PC with an 8.4 Gigabyte disk on it and Linux installed on it. The computer uses the following partitioning system: 
/boot      /dev/hda1 10 Megabytes
swap      /dev/hda2     256 Megabytes
/             /dev/hda3     2 Gigabytes
/home    /dev/hda4     6 Gigabytes

Now at a later stage, if the configuration is to be changed such that more space is available for the root /.
The possible ways of achieving this are as follows:
Reformat the disk, change the partitioning scheme and reinstall.
Buy a new disk and figure out some new partitioning scheme that will require the minimum of data movement.
Set up a symlink farm from / to /home and install the new software on /home
With LVM this becomes much easier:
Consider a similar PC, which uses LVM to divide up the disk in a similar manner: 
/boot       /dev/vg00/boot    10 Megabytes
swap       /dev/vg00/swap   256 Megabytes
/              /dev/vg00/root     2 Gigabytes
/home     /dev/vg00/home   6 Gigabytes

If there is a similar problem one can reduce the size of /home by a gigabyte and add that space to the root partition. Also, if  the /home partition is used up as well and a new 20 Gigabyte disk is added to both the systems.
In the first case, one has to format the whole disk as one partition (/dev/hdb1) and moves the existing /home data onto it and uses the new disk as /home. However now there is  6 gigabytes unused and one has to use symlinks to make that disk appear as an extension of /home, say /home/joe/old-mp3s. On the second machine, one can simply add the new disk to the existing volume group and extend the /home logical volume to include the new disk. Or, in fact, one could move the data from /home on the old disk to the new disk and then extend the existing root volume to cover the entire old disk

Operation of the LVM:
The LVM consists of:
• High-level commands
• Intermediate-level commands
• Logical volume manager subroutine interface library
• Logical volume device driver
• Disk device driver
• Adapter device driver

Figure 1.1 shows path from a high-level command (mklv) to an intermediate
command (lcreatelv) to a library function (lvm_createlv) to the logical volume
device driver to the disk device driver to the SCSI device driver and to the
physical volume. Other applications, for example, the journaled file system,
also talk directly to the LVDD[18].

Fig. 1.1 Flow from High Level commands to Physical Volume

1.4.1  High Level Commands:
These are used by System Management Interface Tool (SMIT), experienced users and have a high-level of error checking [18]. Most of the LVM commands reside in /usr/sbin (except /etc/cfgvg), and they are a combination of shell scripts and C binaries:
Please refer Appendix  C for the high level commands.

1.4.2  Intermediate Level Commands:
These are used by high-level commands and provide usage statements as well as some level of error checking. The intermediate commands found in /usr/sbin are designed to be called by the high-level commands and are all C binaries:

1.4.3  The Logical Volume Manager subroutine interface library:
These contain routines that are used by the system management commands to perform system management tasks for the logical and physical volumes of a system. As these commands give usage statements when queried from the command line, it gives users the incorrect impression that these commands are for general use in LVM. This is not true. These commands have been “tuned” for use by the high-level shell scripts. As they are designed, only high-level shell scripts will be calling these intermediate commands. Certain error checking is not performed by the intermediate commands. The high-level  commands are responsible for screening potentially dangerous errors or conditions out. The removal of the unintended usage statements has been considered, but users have asked LVM to leave them, even if they are not documented.

next related post :Logical volume device driver:

Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

0 comments:

Post a Comment

Thanks for your Valuable comment