Article ID: 8188, created on Mar 14, 2010, last review on Aug 12, 2014

  • Applies to:
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor 4.0
  • Virtuozzo hypervisor 4.0 for Mac Bare Metal

Resolution

This article describes how to install and manage Open-iSCSI on Parallels Virtuozzo Containers for Linux (PVCfL), Parallels Server Bare Metal (PSBM), Parallels Server for Mac Bare Metal Edition (PSfM BME). Please be aware that because this is a third-party solution, it could have some impact on the production servers.

Installation of required package on host:

  1. Copy the CentOS-Base.repo file to the /etc/yum.repos.d/ directory of the host.
  2. Run the following command to install the iscsi-initiator-utils package:
# yum install iscsi-initiator-utils

iSCSI configuration:

There are several steps needed to set up a system to use iSCSI storage. You must initiate iSCSI startup using the init script or manual startup, and edit and configure iSCSI via the /etc/iscsi/iscsid.conf file. The main setup steps are as follows:
  1. Discover targets.
  2. Automate target logins for future system reboots.
  3. Obtain iSCSI username, password, and storage server IP address (target host).

Step # 1: Configure iSCSI

Open /etc/iscsi/iscsid.conf with the vi text editor:

# vi /etc/iscsi/iscsid.conf

Set up the username and password:
node.session.auth.username = My_ISCSI_USR_NAME
node.session.auth.password = MyPassword
discovery.sendtargets.auth.username = My_ISCSI_USR_NAME
discovery.sendtargets.auth.password = MyPassword

Where

  • node.session.* is used to set up a CHAP username and password for initiator authentication by the target(s).
  • discovery.sendtargets.* is used to set up a discovery session CHAP username and password for the initiator authentication by the target(s).

You may also need to tweak and set other options. Refer to the main page for more information. Now, start the iscsi service:

# /etc/init.d/iscsi start

Step # 2: Discover targets

Now, use the iscsiadm command, which is a command-line tool allowing the discovery of and ability to log in to iSCSI targets; it also allows access to and management of the open-iscsi database. If your storage server IP address is 192.168.1.5, enter the following:

# iscsiadm -m discovery -t sendtargets -p 192.168.1.5
# /etc/init.d/iscsi restart

Now, there should be a block device under the /dev directory. To obtain a new device name, type the following:

# fdisk -l
or
# tail -f /var/log/messages

Output:
Oct 10 12:42:20 ora9is2 kernel:   Vendor: EQLOGIC   Model: 100E-00           Rev: 3.2
Oct 10 12:42:20 ora9is2 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 05
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: 41963520 512-byte hdwr sectors (21485 MB)
Oct 10 12:42:20 ora9is2 kernel: sdd: Write Protect is off
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: drive cache: write through
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: 41963520 512-byte hdwr sectors (21485 MB)
Oct 10 12:42:20 ora9is2 kernel: sdd: Write Protect is off
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: drive cache: write through
Oct 10 12:42:20 ora9is2 kernel:  sdd: unknown partition table
Oct 10 12:42:20 ora9is2 kernel: sd 3:0:0:0: Attached scsi disk sdd
Oct 10 12:42:20 ora9is2 kernel: sd 3:0:0:0: Attached scsi generic sg3 type 0
Oct 10 12:42:20 ora9is2 kernel: rtc: lost some interrupts at 2048Hz.
Oct 10 12:42:20 ora9is2 iscsid: connection0:0 is operational now

/dev/sdd is an example of a block device.

Step # 3: Format and mount iSCSI Volume

You can now partition and create a filesystem on the target using the usual fdisk and mkfs.ext3 commands:

# fdisk /dev/sdd
# mke2fs -j -m 0 -O dir_index /dev/sdd1

OR
# mkfs.ext3 /dev/sdd1

Mount the new partition:

# mkdir /mnt/iscsi
# mount /dev/sdd1 /mnt/iscsi

Step #4: Mount iSCSI drive automatically at boot time

First, make sure the iscsi service turned on at boot time:
# chkconfig iscsi on

Open the /etc/fstab file and append the config. directive:
/dev/sdd1 /mnt/iscsi ext3 _netdev 0 0

Attachments

0fe456bdc1f41aefe37dd2554a60437e a26b38f94253cdfbf1028d72cf3a498b e8e50b42231236b82df27684e7ec0beb d02f9caf3e11b191a38179103495106f d245cfd276e66749824316e20bfd8ade 2897d76d56d2010f4e3a28f864d69223

Email subscription for changes to this article
Save as PDF