XenServer Configuration

From OSNEXUS Online Documentation Site
Jump to: navigation, search

Creating XenServer Storage Repositories (SRs)

Generally speaking, there are three types of XenServer storage repositories (SRs) you can use with QuantaStor.

  • iSCSI Software SR
  • StorageLink SR
  • NFS SR

The 'iSCSI Software SR' which allows you to assign a single QuantaStor storage volume to XenServer and then XenServer will create multiple virtual disks (VDIs) within that one storage volume/LUN. This route is easy to setup but it has some drawbacks:

**These pros and cons are outdated**

iSCSI Software SR

  • Pros:
    • Easy to setup
  • Cons:
    • The disk is formatted and laid out using LVM so the disk cannot be easily accessed outside of XenServer
    • The custom LVM disk layout makes it so that you cannot easily migrate the VM to a physical machine or other hypervisors like Hyper-V & VMWare.
    • No native XenServer support for hardware snapshots & cloning of VMs
    • Potential for spindle contention problems which reduces performance when the system is under high load.
    • Within QuantaStor manager you only see a single volume so you cannot setup custom snapshot schedules per VM and cannot roll-back a single VM from snapshot.

The second and most preferred route is to create your VMs using a Citrix StorageLink SR. With StorageLink there is a one-to-one mapping of a QuantaStor storage volume to each virtual disk (VDI) seen by each XenServer virtual machine.

Citrix StorageLink SR

  • Pros:
    • Each VM is on a separate LUN(s)/storage volume(s) so you can setup custom snapshot policies
    • Leverage hardware snapshots and cloning to rapidly deploy large numbers of VMs
    • Enables migration of VMs between XenServer and Hyper-V using Citrix StorageLink
    • Enables one to setup custom off-host backup policies and scripts for each individual VM
    • Easier migration of VMs between XenServer resource pools
    • VM Disaster Recovery support via StorageLink (requires QuantaStor Platinum Edition)
  • Cons:
    • Requires a Windows host or VM to run StorageLink on.
    • Some additional licensing costs to run Citrix Essentials depending on your configuration.
      • (A free version exists which supports 1 storage system)

With the next version of Citrix StorageLink we'll be directly integrated so it will be just as easy to get going using the StorageLink SR if not easier as it will do all the array side configuration for you automatically.

XenServer NFS Storage Repository Setup & Configuration

XenServer iSCSI Storage Repository Setup & Configuration

Creating a XenServer Software iSCSI SR

Now that we've discussed the pros/cons, let's get down to creating a new SR. We'll start with the traditional "one big LUN" iSCSI Software SR. The name is perhaps a little misleading, but it's called a 'Software' SR because Citrix is trying to make clear that the iSCSI software initiator is utilized to connect to your storage hardware. Here's a summary of the steps you'll need to take within the QuantaStor Manager web interface before you create the SR.

  • Login to QuantaStor Manager
  • Create a storage volume that is large enough to fit all the VMs you're going to create.
    • Note: If you use a large thin-provisioned volume that will give you the greatest flexibility.
  • Add a host for each node in your XenServer resource pool
    • Note: You'll want to identify each XenServer host by it's IQN. See the troubleshooting section for a picture of XenCenter showing a server's initiator IQN.
  • (optional) Create a host group that combines all the Hosts
  • Assign the storage volume to the host group

Alternatively you can assign the storage to each host individually but you'll save a lot of time by assigning it to a host group and it makes it easier to create more SRs down the road.

After you have the storage volume created and assigned to your XenServer hosts, you can now create the SR.

Citrix XenCenter iSCSI SR

This picture shows the iSCSI Software SR type selected.


Citrix XenCenter iSCSI SR

This screen captures the main page of the wizard. Enter the IP address of the QuantaStor storage system and then press the Discover Targets and Discover LUNs button to find the available devices. Once selected, press OK to complete the mapping.

Optimal XenServer iSCSI timeout settings

Since the virtual machines on the XenServer will be using the iSCSI SR for their boot device, it is important to change the timeout intervals so that the iSCSI layer has several chances to try to re-establish a session and so that commands are not quickly requeued to the SCSI layer. This is especially important in environments with potential for high latency.

Per the README from open-iSCSI, we recommend the following settings in the iscsid.conf file for a XenServer.

  • Turn off iSCSI pings by setting:
    node.conn[0].timeo.noop_out_interval = 0
    node.conn[0].timeo.noop_out_timeout = 0
  • Set the replacement_timer to a very long value:
    node.session.timeo.replacement_timeout = 86400
Installing the XenServer multipath configuration settings

XenServer utilizes the Linux device-mapper multipath driver (dmmp) to enable support for hardware multi-pathing. The dmmp driver has a configuration file called multipath.conf that contains the multipath mode and failover rules for each vendor. There are some special rules that need to be added to that file for QuantaStor as well. We're working closely with Citrix to get this integrated so that everything is pre-installed with their next product release but until then, the following changes will need to be implemented. You'll need to edit the /etc/multipath-enabled.conf file located on each of your XenServer dom0 nodes. In that file, just find the last device { } section and add this additional one for QuantaStor:

        device {
                vendor                  "OSNEXUS"
                product                 "QUANTASTOR"
                getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
                path_selector           "round-robin 0"
                path_grouping_policy    multibus
                failback                immediate
                rr_weight               uniform
                rr_min_io               100
                path_checker            tur
        }

XenServer StorageLink Storage Repository Setup & Configuration

The following notes on StorageLink support only apply to XenServer version 6.x. Starting with version 2.7 QuantaStor now has an adapter to work with the StorageLink features that have been integrated with XenServer.

Installing the QuantaStor Adapter for Citrix StorageLink

To install the adapter takes just a few simple steps. First, get the files from the QuantaStor box. To do this you can use the command below with the ip address of your QuantaStor system:

	wget -q --no-check-certificate https://<quantastor-ip-address>:8153/StorageLink/qssl-adapter.tgz

You can also get the file by downloading it using the following command. This is recommended if you're using bonding as this version includes a fix for that. (Note: QuantaStor v3.6 will include the updated StorageLink tar file, so the above command will work for that version)

        wget http://packages.osnexus.com/patch/qssl-adapter.tgz

Next, unpack the .tgz file returned by running the command:

	tar zxvf qssl-adapter.tgz

After the file is unpacked, cd into the directory.

	cd QuantastorAdapter/

Now you can run the installer file. This should copy the adapter files to the correct directories, along with patching a few minor changes to the StorageLink files. You can run the installer with the command:

	./install-qs-cslg.sh

NOTE: These steps must be done for all of the Xenserver hosts that are in the pool.

SL Adapter Install

QuantaStor Utility Script

The installer also comes with a file named qstorutil.py. This file can be executed with specific command line arguments to discover volumes, create storage repositories, and introduce preexisting volumes. The file is also copied to “/usr/bin/qstorutil.py” during the installation of the QuantaStor adapter for easier access.

The script has a help page with examples that can be accessed via:
qstorutil.py --help

While the script is the easiest way to create storage repositories or introduce volumes, the adapter will work just fine using the xe commands. We provide the qstorutil.py to make the configuration simpler due to the large number of somewhat complex arguments required by xe.

Creating XenServer Storage Repositories (Srs)

The easiest way to create a XenServer storage repository is to use the QuantaStor utility script. To do this you can run either of the commands below:

	qstorutil.py --create_sr -a <quantastor-ip-address> -u admin -p password --spid <quantastor-storage-pool-uuid> -n <sr-name>
	qstorutil.py --create_sr -a <quantastor-ip-address> -u admin -p password --sp_name <quantastor-storage-pool-name> -n <sr-name>

Both of these commands will create a storage repository. One takes the QuantaStor spid where as the other takes the QuantaStor storage pool name (and uses it to figure out the spid). When you create a storage repository, a small metadata volume is created. The metadata volume name with have the prefix “SL_XenStorage__” and then a guid.

Qstorutil Create SR

Storage Volume Discovery

Storage volume discovery will show you a list of all the volumes on the QuantaStor box specified (via ip address). The list will specify the name of the volume, the QuantaStor id of the volume, the StorageLink id of the volume, the storage system name, and the storage system id. If the volume is in a storage repository on the local XenServer system it will also have three additional fields. These fields are the VDI name, the VDI uuid, and the storage repository uuid.

In addition to listing all of the volumes, the discover command will also print out the storage repositories on the local XenServer system. The fields listed are the storage repository name, and the storage repository uuid.

To call the discovery command you can use the command below:

	qstorutil.py --discover -a <quantastor-ip-address> -u admin -p password

Qstorutil Discover

Introducing a Preexisting Volume to XenServer

To introduce a preexisting volume to XenServer you should first run the storage volume discovery command. To introduce a volume run one of the three commands below:

	qstorutil.py --vdi_introduce -a <quantastor-ip-address> -u admin -p password --vol_uuid <quantastor-volume-uuid> --sr_uuid <storage-repository-uuid> -n <vol-name>
	qstorutil.py --vdi_introduce -a <quantastor-ip-address> -u admin -p password --svid <storagelink-volume-id> --sr_uuid <storage-repository-uuid> -n <vol-name>
	qstorutil.py --vdi_introduce --svid <storagelink-volume-id> --vol_uuid <quantastor-volume-uuid> --sr_uuid <storage-repository-uuid> -n <vol-name>

Each of these commands do the exact same thing, they just require slightly different parameters. Use whichever command works best for you. The reason for running the discover command before introducing a volume is that the volume vol_uuid, svid, and sr_uuid are all provided in the discover.


Qstorutil Introduce