Software iSCSI storage
XenServer supports shared storage repositories (SRs) on iSCSI LUNs. iSCSI is supported using the Open-iSCSI software iSCSI initiator or by using a supported iSCSI Host Bus Adapter (HBA). The steps for using iSCSI HBAs are identical to the steps for Fibre Channel HBAs. Both sets of steps are described in Create a Shared LVM over Fibre Channel / Fibre Channel over Ethernet / iSCSI HBA or SAS SR.
Shared iSCSI support using the software iSCSI initiator is implemented based on the Linux Volume Manager (LVM). This feature provides the same performance benefits provided by LVM VDIs in the local disk case. Shared iSCSI SRs using the software-based host initiator can support VM agility using live migration: VMs can be started on any XenServer® host in a resource pool and migrated between them with no noticeable downtime.
iSCSI SRs use the entire LUN specified at creation time and cannot span more than one LUN. CHAP support is provided for client authentication, during both the data path initialization and the LUN discovery phases.
Note:
The block size of an iSCSI LUN must be 512 bytes. To use storage with 4 KB physical blocks, the storage must also support emulation of 512-byte allocation blocks (the logical block size must be 512 bytes).
XenServer host iSCSI configuration
All iSCSI initiators and targets must have a unique name to ensure that they can be uniquely identified on the network. An initiator has an iSCSI initiator address, and a target has an iSCSI target address. Collectively these names are called iSCSI Qualified Names, or IQNs.
XenServer hosts support a single iSCSI initiator, which is automatically created and configured with a random IQN during host installation. The single initiator can be used to connect to multiple iSCSI targets concurrently.
iSCSI targets commonly provide access control using iSCSI initiator IQN lists. All iSCSI targets/LUNs that your XenServer host accesses must be configured to allow access by the host’s initiator IQN. Similarly, targets/LUNs to be used as shared iSCSI SRs must be configured to allow access by all host IQNs in the resource pool.
Note:
iSCSI targets that do not provide access control typically default to restricting LUN access to a single initiator to ensure data integrity. If an iSCSI LUN is used as a shared SR across multiple hosts in a pool, ensure that multi-initiator access is enabled for the specified LUN.
The XenServer host IQN value can be adjusted using XenCenter®, or using the CLI with the following command when using the iSCSI software initiator:
xe host-param-set uuid=valid_host_id other-config:iscsi_iqn=new_initiator_iqn
<!--NeedCopy-->
Warning:
- Each iSCSI target and initiator must have a unique IQN. If a non-unique IQN identifier is used, data corruption or denial of LUN access can occur.
- Do not change the XenServer host IQN with iSCSI SRs attached. Doing so can result in failures connecting to new targets or existing SRs.
If you are creating an SR for IP-based storage (including iSCSI), you can configure one of the following as the storage network: the NIC that handles the management traffic or a new NIC for the storage traffic. To assign an IP address to a NIC, see Configure a dedicated storage NIC.
Shared LVM storage
The Shared LVM type represents disks as Logical Volumes within a Volume Group created on an iSCSI (FC or SAS) LUN.
Note:
The block size of an iSCSI LUN must be 512 bytes. To use storage with 4 KB physical blocks, the storage must also support emulation of 512-byte allocation blocks (the logical block size must be 512 bytes).
Device-config parameters for LVMoiSCSI SRs:
| Parameter Name | Description | Required? |
|---|---|---|
target |
The IP address or host name of the iSCSI target on the SAN that hosts the SR. This can also be a comma-separated list of values to connect to multiple targets. | Yes |
targetIQN |
The iSCSI Qualified Name (IQN) of the target on the iSCSI SAN that hosts the SR, or * to connect to all IQNs. |
Yes |
SCSIid |
The SCSI bus ID of the destination LUN | Yes |
multihomed |
Enable multi-homing to this target | No (defaults to the same value as host.other_config:multipathing) |
chapuser |
The user name to be used for CHAP authentication | No |
chappassword_secret |
(Recommended) Secret ID for the password to be used for CHAP authentication. Pass a secret instead of a password. | No |
chappassword |
The password to be used for CHAP authentication. We recommend that you use the chappassword_secret parameter instead. |
No |
port |
The network port number on which to query the target | No |
usediscoverynumber |
The specific iSCSI record index to use | No |
incoming_chapuser |
The user name that the iSCSI filter uses to authenticate against the host | No |
incoming_chappassword_secret |
(Recommended) Secret ID for the password that the iSCSI filter uses to authenticate against the host. | No |
incoming_chappassword |
The password that the iSCSI filter uses to authenticate against the host. We recommend that you use the incoming_chappassword_secret parameter instead. |
No |
Create a shared LVM over iSCSI SR by using the Software iSCSI initiator
xe CLI
Note:
When running the
sr-createcommand, we recommend that you use thedevice-config:chappassword_secretargument instead of specifying the password on the command line. For more information, see Secrets.
To create a shared LVMoiSCSI SR on a specific LUN of an iSCSI target, use the following command.
xe sr-create host-uuid=valid_uuid content-type=user \
name-label="Example shared LVM over iSCSI SR" shared=true \
device-config:target=target_ip= device-config:targetIQN=target_iqn= \
device-config:SCSIid=scsci_id \
type=lvmoiscsi
<!--NeedCopy-->
In XenCenter
Note:
Before performing the following steps, ensure the iSCSI Initiator IQN is set appropriately for all hosts in the pool. For more information, see Changing Server Properties.
- Open the New Storage Repository wizard: click New Storage on the toolbar. Alternatively:
- On the Storage tab for the selected pool or server, click New SR.
- On the Storage menu, click New SR.
- In the Resources pane, select a server or pool then right-click and click New SR on the shortcut menu.
- Select Software iSCSI as the physical storage type, then click Next.
- On the Name page, enter the name of the new SR. By default, the wizard generates a description of the SR. This description includes a summary of the configuration options you select as you progress through the wizard. To enter your own description, clear the Auto-generate description check box and type in the Description box. Click Next to continue.
- On the Provisioning page, select the type of provisioning to use. The options available are
- Thin provisioning (GFS2). This type of provisioning is only available on clustered pools. For more information about clustering, see Change pool properties
- Full provisioning (LVM)
Click Next to continue.
-
On the Location page, specify the iSCSI target details:
-
Target Host: The IP address or DNS name of the iSCSI target. This can also be a comma-separated list of values.
-
Use CHAP: If the iSCSI target is configured to used CHAP authentication, select the Use CHAP check box and fill in the details:
- CHAP User: the CHAP authentication user name credential to apply when connecting to the target.
- CHAP Secret: the CHAP authentication password credential to apply when connecting to the target.
-
Target IQN: To specify the iSCSI target IQN, click the Discover IQNs button and then choose an IQN from the Target IQN list.
Important:
The iSCSI target and all servers in the pool must not have the same IQN set. Every iSCSI target and initiator must have a unique IQN. If a non-unique IQN identifier is used, data corruption can occur or access to the target can be denied or both.
-
Target LUN: To specify the LUN on which to create the storage repository, click the Discover LUNs button. Choose a LUN from the Target LUN list.
Each individual iSCSI storage repository must be contained entirely on a single LUN. The SR cannot span more than one LUN. If the LUN already contains an SR, choose either to use the existing SR or to replace the existing SR with a new one. Replacing the existing SR destroys any data present on the disk.
-
- Click Finish to complete the new SR configuration and close the wizard.