Adding a LUN using LVM over HBA in Xen Server and Cloudstack as Primary Storage


This tech blog helps you to configure primary storage in Cloudstack and Xen Cloud Platforms (XCP). I had a Dell Power Edge server which was connected to IBM 3500 Storage Box via a Cisco Fabric Switch 9124. I guess almost every organization has this kind of small Storage Area Network with servers and storage boxes connected. Okay, let us move on to the configuration settings.

Before we Proceed:

Server's HBA port is connected to a Fabric switch via fibre channel. A Storage box also connected to the same switch. Make sure that your logical volume created in Storage box is visible to our server. I believe that you have a little idea on Storage and Cloud architectures.

Configuration Settings:

1) To check the HBA port detection in xen host:

#lspci

Sample Output:
02:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
02:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)

2) To check whether driver is installed or not in Xen:

#lsmod | grep qla2xxx

Sample Output:
qla2xxx               321630  4
scsi_transport_fc      40893  1 qla2xxx
scsi_mod              141570  9 sr_mod,sg,qla2xxx,scsi_transport_fc,libata,mptsas,mptscsih,scsi_transport_sas,sd_mod

3)  To find the Logical drive id (HBA-id) in xen:

#scsi_id -g -u -s /block/sdd (sd(drive letter)-according to lun mapping)

Sample output:
360080e50002363a200000bad50911a64

4) Create Storage Repository  in server:

#xe sr-create host-uuid=45c72206-de58-43de-9654-13efa7f3aa67 name-label=Cloud_Lun2 content-type=user shared=true device-config:SCSIid=360080e50002363a200000bad50911a64 type=lvmohba

Sample Output:
b7a5c01f-d001-ae74-cf1b-6d042f44d01d

5) #xe pbd-list sr-uuid=<sr-uuid> (Ex : f0fae26a-177c-b444-ff7c-7cfcfeb71bcf)

6) #xe pbd-plug uuid=<pbd-uuid>

7) Create Primary Storage and map the created SR in Cloudstack:



SR Name-Label should be same as we created.

8) Create a logical volume in Cloudstack:



9)  Attach it to a Virtual Machine:



10) Summary of created Primary Storage:


11) Refer  Mysql database which is in Cloudstack for more info or Modification on configuration:


12) Refer Management server log or Xen server logs for any issues:

Path : /var/log/cloud/management/management-server.log ( in Cloudstack Mgmt Server )               


Share this:

Hey there! I'm Senthil Kumar Murugesan, An Infrastructure engineer with a focus on Cisco Unified Communications and Hacking. Also I’m happy to mention that I’m a Linux junkie, a Cisco proponent, a Tools fanatic and Script lover. This is a blog, a rambling of thoughts, and a result of technical experiments

2 comments

Google Analytics Alternative