StarWind Resource Library

StarWind Virtual SAN Providing HA storage repositories for XenServer Pool

Published: March 15, 2017


Traditionally XenServer Pool requires having some sort of shared storage to guarantee data safety, allow virtual machines migration, enable continuous application availability and eliminate any single point of failure within IT environment. XenServer users have to choose between two options when choosing the shared storage:

• Hyper-Converged solutions that allow sharing same hardware resources for the application (i.e. hypervisor, database) and shares storage, thus decreasing TCO and achieving outstanding performance results.

• Compute and Storage separated solutions that keep compute and storage layers separately from each other, thus making maintenance easier, increasing hardware usage efficiency and allow building the system accurately for solving the task.

This technical paper is intended for experienced XenServer and Windows system administrators and IT professionals who would like to add StarWind® virtual storage to their XenServer Pool and provides users with a step-by step instructions about configuring shared storage in a XenServer Pool Hyper-Converged or Compute and Storage separated environment. It contains detailed description of creating an HA devices and explains the way of setting up XenServer Pool and XenServer nodes. The document particularly focuses on the process of configuring an iSCSI initiator and connecting and mounting created datastores.

A full set of up-to-date technical documentation can always be found here, or by pressing the Help button in the StarWind Management Console.

For any technical inquiries, please visit our online community, Frequently Asked Questions page, or use the support form to contact our technical support department.

Pre-Configuring the Servers

The network diagram below illustrates the configuration of the system to perform the actions listed in the document.

This document assumes that you have at least 2 physical servers with XenServer and XenCenter installed. It also assumes that you have 2 physical servers (for Compute and Storage separated scenario) or 2 virtual machines (Hyper-Converged configuration) with StarWind® Virtual SAN installed and configured having 2 replicated and synchronized virtual storage devices.

Preparing StarWind Nodes

Create HA devices

1. Open Add Device (advanced) Wizard.

2. Select Hard disk device as the type of device to be created. Click Next to continue.

3. Select Virtual disk. Click Next to continue.

4. Specify a virtual disk location and size.

5. Specify virtual disk options: thick provisioned.

6. Define caching policy and specify cache size (in MB). You can also set maximum available cache size by selecting the appropriate checkbox. Optionally, define L2 caching policy and cache size. Click Next to continue.

7. Specify target parameters. Select the Target Name checkbox to enter a custom name of a target.

8. Otherwise, name is generated automatically in accordance with the specified target alias. Click Next to continue.

9. Click Create to add a new device and attach it to the target.

10. Click Finish to close the wizard.

11. Right-click the recently created device and select Replication Manager from the shortcut menu. Then, click Add replica.

12. Select Synchronous two-way replication as a replication mode. Click Next to proceed.

13. Specify a partner hostname, IP address and port number.

14. Click Next.

15. Choose Create new Partner Device and click Next.

16. Click Change network settings…

17. Specify interfaces for synchronization and Heartbeat channels. Click OK. Then click Next.

18. Click Create Replica. Click Finish to close the wizard. The successfully added devices appear in the StarWind Console.

19. Follow the similar procedure for creation of the other virtual disks that will be used as storage repositories.

Configuring XenServer Hosts

Creating a Pool

To create a pool:

1. Launch XenCenter.

2. Click New Pool. The Create New Pool window appears.

3. Specify name and description of the pool and click Add New Server.

4. In the Add New Server window specify the first XenServer host to be added to the pool as well as a user name and password.

5. Click Add.

6. Take the previous steps to add the second XenServer host to the pool.

7. Specify the Master.

8. Click Create Pool.

9. The XenCenter window should look as shown in the screenshot below.

Configuring Network Settings

Note: Switch the XenServer host to Maintenance Mode for network configuration: right-click the XenServer and select Enter Maintenance Mode from the shortcut menu.

To configure dedicated iSCSI networks:

1. Select the first XenServer host. Switch to the Networking tab.

2. Click Configure.

3. In the appearing window click Add IP address to add networks.

4. Configure IP address.

5. Click OK.

6. The window should look as shown in the screenshot below.

7. Exit maintenance mode.

8. Select the second XenServer host. Switch to the Networking tab.

9. Repeat the same steps on all XenServer hosts.

10. The window should look as shown on the screenshot below.

Configuring iSCSI Initiator

Note: switch XenServer host to maintenance mode for iSCSI configuration.

Perform the following actions on each XenServer host in the pool:

1. Edit /etc/iscsi/initiatorname.iscsi and set appropriate iqn for XenServer iSCSI initiator.

2. Edit the /etc/iscsi/iscsid.conf file.

Set the following values:
node.startup = automatic
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 262144

3. Restart the software iSCSI service:
service iscsi restart
service iscsid restart

4. Set the iscsi services to start automatically when you start XenServer:
chkconfig iscsi on
chkconfig iscsid on

Applying Multipathing

Note: switch XenServer host to maintenance mode for multipath configuration.

To apply multipathing take the following actions for each XenServer in the pool:

1. Switch to console tab, edit multipath configuration file running “vi /etc/multipath.conf” command.

2. Insert the following block into the “devices” section:

3. Restart the multipath service:
service multipathd restart
service multipathd reload

4. Set the multipathd service to start automatically when you start XenServer:
chkconfig multipathd on

5. Right-click the XenServer and select Properties from the shortcut menu.

6. Click Multipathing in the left pane. Select the Enable multipathing on this server checkbox.

7. Click OK.

8. Turn off the Maintenance Mode: right-click the XenServer and select Exit Maintenance Mode from the shortcut menu.

9. Reboot XenServer host.

Adding Shared Storage using automated script

1. Open following link and copy the
entire script text.

2. Select а XenServer Master Node. Switch to the Console tab in XenCenter.

3. Switch to Home folder:
cd /home

4. Create a new file named

5. Paste previously copied script text there. Save the file and exit editor.

6. Make the script file executable:
chmod 755

7. Run script:

8. Enter comma separated IP addresses of all corresponding StarWind nodes when prompted:,,,

9. Enter your StarWind device name as a part of corresponding IQN name when prompted: sr01

10. Repeat steps 7-9 for all other StarWind devices

11. Check the added SRs:

Adding Shared Storage manually

1. Select а XenServer host. Switch to the Console tab in XenCenter.

2. Run discovery:
iscsiadm -m discovery -t st -p
iscsiadm -m discovery -t st -p
iscsiadm -m discovery -t st -p
iscsiadm -m discovery -t st -p

3. Connect the targets using their IQNs found by discovery:
iscsiadm -m node -T -p -l
iscsiadm -m node -T -p -l
iscsiadm -m node -T -p -l
iscsiadm -m node -T -p -l
iscsiadm -m node -T -p -l
iscsiadm -m node -T -p -l
iscsiadm -m node -T -p -l
iscsiadm -m node -T -p -l

4. Perform the 1-3 steps for all XenServer hosts in the Pool.

5. Check the multipath is working properly

6. On Pool Master run the following commands to add SRs:
xe sr-probe type=lvmoiscsi device config:target=,,, device config:targetIQN=*

xe sr-create type=lvmoiscsi \
shared=true \
name-label=”sw-sr01″ \
device-config:target=,,, \
device-config:targetIQN=* \
StarWind Virtual SAN®
Providing HA storage repositories for XenServer Pool|,3260,iqn.2008-|” \
, \
device-config:port=3260 \

xe sr-probe type=lvmoiscsi deviceconfig:target=,,,

xe sr-create type=lvmoiscsi \
shared=true \
name-label=”sw-sr02″ \
device-config:target=,,, \
device-config:targetIQN=* \
device-config:multiSession=”,3260,iqn.2008-|,3260,iqn.2008-|,3260,iqn.2008-|,3260,iqn.2008-|” \
2.24:3260 \
device-config:port=3260 \

7. Check the added SRs:


After performing all the steps described in this guide, a XenServer Pool with a StarWind Virtual SAN® storage devices as a shared storages will be created. It is a perfect shared storage solution used for keeping XenServer Virtual Machines. Adding StarWind Virtual SAN® storage devices into XenServer Pool offers many additional features and benefits such as:

• synchronous data replication;
• high availability;
• automatic failover;
• snapshots, cloning, migrating and a lot more;

StarWind Virtual SAN® is Officially Certified for Citrix XenServer 6.5. Customers can be confident that StarWind Virtual SANTM has successfully passed a series of tests established by Citrix. Therefore, they can be trusted to work effectively with Citrix XenServer 6.5, providing confidence in joint solution compatibility and a heterogeneous IT infrastructure, combining the power of Citrix XenServer® virtualization and StarWind Virtual SAN® storage virtualization, and improving XenServer experience with storage high availability, reliability and protection.