Tuesday, 3 September 2013

LVM Over ISCSI On XenServer

XenServer has been using LVM as the default local storage management. Moreover there have been many popular SAN solutions which are using LVM based Volume Group. It's then very important to understand the working of LVM. I would restrict myself in the context of Xenserver otherwise that would be a very lengthy paper without any immediate advantage.

LVM :- A very simple concept of LVM is to take a group of physical disks, put it in a logical container to make a Volume Group and then take a chunk out of it in the form of logical volumes. Advantages of this approach being easy management and maintenance of disks.
XenServer Local storage is primarily /dev/sda3 until and unless there has not been alternative partitions done.
This sda3 is the group of physical disks that are being provided in the server itself. The Volume group in this context would be /dev/VGXenStorage_XXX where XXX is the unique identifier. The logical volumes are the VHD's or Virtual Hard Disks/LV or logical Volumes.VHD's are shown in Storage when it is LVM based and LV when it is file based such as nfs etc. However just for the purpose of abstraction, the XenServer identifies every Disk as Virtual Desktop Image (VDI) and not as VHD/LV. This same can be verified as andwhen we scan the list of Virtual Machines, XenServer only identifies the list of VDI's associated with the machines and never the VHD's/LV. We have to manually link the VHD's with the VDI's using the following command :-
xe vm-disk-list vm-uuid
with
xe vdi-list vm-name-label

Very similar is the concept of LVM storage from the shared storage. All the stages of LVM can be verified from the following commands :-
pvscan or pvs - which shows the associated physical disk/s for the Volume Group.
vgscan or vgs - which shows the Volume Group for the associated Logical Volumes.
lvscan or  lvs - which shows the Virtual Hard disks/Logical Volumes for the Virtual Machines.

ISCSI -We all know that ISCSI is used prominently for the connection of storage to the XenServer. It's an IP based protocol for linking Data Storage Systems. Some popular components of this protocol are :-

Initiator :- The IQN is the unique identifier number generated for each of the host through which storage systems recognises the hosts connected through iscsi. In XenServer the IQN is generated at the time of installation itself and can be viewed in the general tab of the host. Also it can be altered anytime( which is not recommended at all)

Target :- The target is the Storage systems to which the XenServer is required to connect through.

LUN :- Logical Unit Number is the Volume Group generated after the iscsi is able to establish between the Storage and the XenServer. Therefore from XenServer view, the volume group from the shared storage is termed  LUN.



The above two are interconnected in XenServer, so that the host could utilize the benefits of the storage management over Internet and connect to a shared storage.