Adding disk space to XenServer can be handled in many different way. You can use external storage on a NAS or SANS and setup a remote SR for use. You can expand your local storage SR. And you can add a new set of disks as a separate local SR
Creating a new Local SR in XenServer
Before creating a new local SR you must first make sure it is available to the system. If you are using a server, you may be able to create a new RAID on a new set of disks that you just added. In this case we have added an additional 2 disks as RAID1 to an existing server. Our primary raid array is running RAID0 across 3 SSD’s running XenServer and hosting a few VM’s.
Our goal is to create a new SR in RAID1 to store disk images that we need for some local storage.
After your drives have been added to the system, login to the console and issue the command;
dmesg | grep sd
This will show you all the hard drives the system has detected, and will look something like this:
[ 17.336993] sd 0:1:0:1: [sdb] 9767475632 512-byte logical blocks: (5.00 TB/4.55 TiB)
[ 17.336999] sd 0:1:0:1: [sdb] 4096-byte physical blocks
[ 17.337016] sd 0:1:0:0: [sda] 1406387376 512-byte logical blocks: (720 GB/671 GiB)
[ 17.337019] sd 0:1:0:0: [sda] 4096-byte physical blocks
[ 17.337300] sd 0:1:0:1: [sdb] Write Protect is off
[ 17.337304] sd 0:1:0:1: [sdb] Mode Sense: 73 00 00 08
[ 17.337340] sd 0:1:0:0: [sda] Write Protect is off
[ 17.337345] sd 0:1:0:0: [sda] Mode Sense: 73 00 00 08
[ 17.337395] sd 0:1:0:1: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 17.337449] sd 0:1:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 17.339743] sda: sda1 sda2 sda3 sda4 sda5 sda6
[ 17.340461] sd 0:1:0:0: [sda] Attached SCSI disk
[ 17.353576] sd 0:1:0:1: [sdb] Attached SCSI disk
[ 17.734918] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[ 17.737639] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 17.995770] sd 1:0:0:0: [sdc] Attached SCSI removable disk
[ 19.147449] EXT4-fs (sda1): re-mounted. Opts: (null)
[ 19.156392] Installing knfsd (copyright (C) 1996 firstname.lastname@example.org).
[ 19.577604] sd 0:1:0:0: Attached scsi generic sg1 type 0
[ 19.577977] sd 0:1:0:1: Attached scsi generic sg2 type 0
[ 19.578154] sd 1:0:0:0: Attached scsi generic sg4 type 0
[ 19.893585] Adding 1048572k swap on /dev/sda6. Priority:-1 extents:1 across:1048572k SS
[ 19.963836] EXT4-fs (sda5): mounting ext3 file system using the ext4 subsystem
[ 19.966336] EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: (null)
In our above example you will see that we have 2 hard drives, sdb and sdb. The new disk array is sdb. We can verify this because it shows the 5TB array that we just created.
issue the following command to create the storage repository on your newly created array.
xe sr-create name-label=HDD-5TB-RAID1 shared=false device-config:device=/dev/sdb type=lvm content-type=user
You will now see a new SR titled HDD-5TB-RAID1 in your xenserver console. You can create disk images on this SR like any other, create snapshots and attach system images to operate on this disk array.
Adding a new local SR for XenServer is a quick process. If you do not have free drive bays in your server, consider using a remote SR. There is a lot to gain from using a remote SR, and the process is just as painless. Don’t forget to enable any of your new VM’s to properly start on boot. And don’t forget to backup your system.
Ben has been building VoIP solutions for over 10 years, has over 15 years of Linux administration experience and enjoys problem-solving. When he is not coding something in Python, or tinkering with some project, you can often find him wandering through the forests and parks of the Pacific Northwest enjoying waterfalls, trails, and animals.