In this guide we will see how to add an iSCSI device into XenServer (version 6.5 and above). In this guide we will use iSCSI device mapped into a FreeNAS box. You can see here how to create iSCSI device using FreeNAS.
1. Install iscsi-initiator-utils:
#
yum install iscsi-initiator-utils -y
Start the iscsi service:
systemctl start iscsi systemctl enable iscsi
2. Get the IQN of you machine (for configuring at the FreeNAS):
#
cat /etc/iscsi/initiatorname.iscsi
3. Discover the target (ISCSI Storage FreeNAS)
#
iscsiadm -m discovery -t st -p Your-Target-IP-Address
4. Log in with the target IQN you discovered in step 3:
#
iscsiadm -m node -T iqn.xxxx-xx.xxx.example -l
5. Create a file system:
Find the ISCSI disk:
# lsblk --scsi#
mkfs.ext4
/dev/sdd
6. Mount your ISCSI storage:
#
mount
/dev/sdd
/mnt
7. You can mount the iSCSI storage automatically when system boots:
#
vi /etc/fstab
Add the line:
/dev/sdd /mnt ext4 _netdev 0 0
Tags: iscsi
Leave a Reply