Category Archives: iSCSI

VMware – Attaching iSCSI disks to an ESXi 4 server

VMware – Attaching iSCSI disks to an ESXi 4 server

Introduction

This article explains how to attach an iSCSI disk to a VMware ESXi 4 server.

The infrastructure used for this article is an Openfiler 2.3 server configured as an iSCSI Target Server with a single NIC to connect to the Internal LAN and provide iSCSI connectivity also.

Enabling the iSCSI storage adapter

The iSCSI storage adapter in ESXi comes as part of the standard installation but is disabled by default.  To enable the adapter perform the following steps :-

  1. Open the vSphere client and connect to the ESXi host
  2. Click on the Configuration tab and then click on Storage Adapters in the Hardware section
  3. Highlight the iSCSI software adapter and select Properties.
  4. Click on the configure button, tick Enabled and then click on OK.

Adding a send target server

Once the iSCSI software adapter is enabled perform the following steps within the adapters Properties :-

  1. Click on the Dynamic Discovery tab
  2. Click on the Add button
  3. When prompted enter in the IP address of the iSCSI target server and click on OK.
  4. When prompted to re-scan the host select Yes.
  5. Once the re-scan has completed the iSCSI LUN’s which are available on the iSCSI target server appear.

Assigning an iSCSI LUN as a datastore

One way to present an iSCSI LUN(s) for use by a guest is to create it as a datastore.  To create a datastore for an iSCSI disk resource perform the following steps :-

  1. In the vSphere Client click on the Configuration tab.
  2. Select Storage from the Hardware section and then click on the Add Storage link
  3. When prompted select the Disk/LUN option and click on Next
  4. You will be presented with a list of available LUN’s which the ESXi server can see.
  5. Select the desired LUN and then click on Next
  6. At the current disk layout screen click on Next when prompted to create a new partition
  7. Enter the desired Datastore name and then click on continue
  8. Configure the Block Size to the desired setting and then click on Next and then Finish to create the Datastore

Assigning an iSCSI LUN to a virtual machine

It is also possible to directly assign a LUN to a virtual machine as either part of the creation of the guest or as an additional disk.  The following sections provide information on how to perform either of these methods to add a LUN to a virtual machine.

Assigning a LUN during virtual machine creation

To assign a LUN to a virtual machine during its creation perform the following steps :-

  1. Click on the Create a new virtual machine option
  2. Select a Custom configuration and then click on Next
  3. When prompted set the Virtual Machine name as desired and then click on Next
  4. Set the datastore to be used as desired and then click on Next
  5. Select the Virtual Machine Version required (Either v4 or v7 depending on your requirements) and then clcik on Next
  6. Select the Guest Operating System required and then click on Next
  7. Configure the amount of Memory you wish to assign and then click on Next
  8. Assign the amount of Network Cards you require and the pertinent Networks to connect them to and then click on Next
  9. Select the LSI Logic Parallel SCSI controller and then click on Next
  10. Select the Raw Device Mappings option for the disk and then click on Next
  11. Select the desired LUN from the list to assign to the Virtual Machine and then click on Next
  12. When prompted for where to store the LUN mapping select Store with Virtual Machine and then click on Next
  13. Select whether the LUN is presented to the Virtual Machine as a Physical or Virtual and then click on Next
  14. Configure the Virtual Device Node SCSI ID as desired and then click on Next
  15. Click on Finish to create the new Virtual Machine

Assigning a LUN as an additional disk for a virtual machine

To assign as LUN as an additional disk on a virtual machine perform the following steps :-

  1. Edit the virtual machine’s Properties and click on the Add button
  2. Select Hard Disk from the list of devices and then click on Next
  3. Select Raw Device Mappings for the disk type and then click on Next
  4. Select the desired LUN from the list to assign to the Virtual Machine and then click on Next
  5. When prompted for where to store the LUN mapping select Store with Virtual Machine and then click on Next
  6. Select whether the LUN is presented to the Virtual Machine as a Physical or Virtual and then click on Next
  7. Configure the Virtual Device Node SCSI ID as desired and then click on Next
  8. Click on Finish to add the new Hard Disk device to the Virtual Machine

W2K8 R2 – Adding an iSCSI Disk

W2K8 R2 – Adding an iSCSI Disk

This article provides the steps to add an iSCSI Disk to a Windows 2008 R2 server.

To add an iSCSI Disk or Disks to a Windows 2008 R2 server perform the following steps :-

  • Logon to the server and open the iSCSI Initiator
  • If prompted to start the Microsoft iSCSI service click on Yes
  • Enter the IP address of your iSCSI Target Server and click on Quick Connect
  •  
  • You should now see the iSCSI Targets) listed in the Discovered Targetsbox
  • click on Done
  •  
  • Go to the Volumes and Devices tab and click on Auto Configure
  •  
  • You will now see all the iSCSI volumes available shown in the Volume List
  • Open the Server Manager and expand the Storage branch
  • Click on Disk Management
  • The iSCSI Disks should now be listed and showing as offline
  • Bring each of the required iSCSI Disks online in turn and initialise them
  • Format each of the required iSCSI Disks as a Simple Volume in turn
  • Assign the desired Drive Letters to each of the disks and format asNTFS

The iSCSI Disks should now be visible to the server and persistent on a reboot.

Windows – Creating A Diskless iSCSI Boot Windows 2003 Server

Windows – Creating A Diskless iSCSI Boot Windows 2003 Server

Introduction

This article explains how to create a diskless Windows 2003 server which is booted from an iSCSI drive.

The infrastructure used for this article is an Openfiler 2.3 Server used to deploy the iSCSI target disks and a Virtual Machine deployed under VMWare Server 1.0.8 running on a Fedora Core 8 64-Bit host.

A separate network was used for the iSCSI traffice between the Openfiler and VMWare servers and the Virtual Machine was deployed using two Network Cards.  The first NIC was connected to the iSCSI Network to allow booting from the disk whilst the second was connected to the Host Only LAN to provide normal network connectivity.

Instructions for the Openfiler Server and the VMWare Server 1.0.8 builds are outside the scope of the article.

Pre-requisites

In order to create a diskless Windows 2003 server build which boots from an iSCSI drive the follolwing pre-requisites must be met :-

  • A network SAN / NAS server deploying iSCSI Disks
  • gPXE ROM drivers for the PCNet32 Network Card
  • A DHCP server used to provide reservations for the iSCSI server
  • The Microsoft iSCSI Initiator Boot software

Creating an initial Windows 2003 server image

As Windows 2003 is unable to install to an iSCSI disk an initial installation of the OS is required before it can be re-configured to run on an iSCSI disk.

To create an initial installation of Windows 2003 go through a Windows 2003 installation as normal to a server with a local disk.

For this article a normal installation was performed to a Virtual Disk attached to the Virtual Machine.

Install the Microsoft iSCSI initiator  software

Once the server has been built with an initial installation logon to the server and install the Microsoft iSCSI Initiator Boot software.  In order to install the Microsoft iSCSI Initiator Boot software perform the following steps :-

  1. Launch the software
  2. When prompted click on Next to continue
  3. When prompted for the installation options ensure the the Microsoft MPIO Multipathing Support for iSCSI is not ticked and click on Next to continue
  4. When prompted tick the Configure iSCSI Network Boot Support option
  5. Select the Network Card which is to be used for the iSCSI traffic and click on Next to continue

Configure a local shutdown script

It is important to re-check the iSCSI configuration whenever any hardware is changed in the server and the easiest way to ensure this is to run it when ever the server is shutdown or rebooted.  To create a Shutdown script on the server itself to perform the iSCSI configuration check perform the following steps :-

  1. Click on Start, Run and type in gpedit.msc to launch the local Group Policy editor
  2. In the Group Policy editor expand the Computer Configuration
  3. Expand the Windows Settings branch
  4. In the Scripts branch double click Shutdown in the right hand pane
  5. In the Shutdown Properties dialog box click on Add
  6. In the Script Name box enter C:\Windows\System32\Iscsibcg.exe
  7. In the Script Parameters box enter /Verify /Fix
  8. Click on OK to add the Shutdown script and then exit the Group Policy editor

Sysprep the server

Following any additional configuration changes for your environment have been made to the server the next step is to Sysprep the server so that the server image automatically configures itself when used.  To Sysprep the server perform the following steps :-

Copy the Sysprep files to the server

  1. Unpack the DEPLOY.CAB file from the Support folder on the Windows 2003 CD to C:\Sysprep

Run the Setupmgr program

  1. From the C:\Sysprep folder run the program Setupmgr.exe
  2. When prompted click on Next
  3. Select Create New and then click on Next to continue
  4. Select Sysprep setup and then click on Next to continue
  5. Select the relevant OS version installed on the server and then click on Next to continue
  6. Select Yes, fully automate the installation and then click on Next to continue
  7. Configure the Name and Organization as required and then click on Next to continue
  8. Configure the Display settings as required and then click on Next to continue
  9. Select the Time zone as required and then click on Next to continue
  10. Enter the Product Key required and then click on Next to continue
  11. Configure the Licensing Mode as required and then click on Next to continue
  12. Select Automatically generate computer name and then click on Next to continue
  13. Configure the Administrator Password as required and then click on Next to continue
  14. Configure the Domain settings as required and then click on Next to continue
  15. Configure the Advanced Settings pages as required click on Next to continue
  16. Click on Finish after the last Advanced Settings page and OK to save the filename as C:\Sysprep\sysprep.inf

Edit the Sysprep.inf file

  1. Open the C:\Sysprep\sysprep.inf file and Add the line LegacyNic=1 under the [Unattended] section
  2. Save and exit the file

Run Sysprep on the server

  1. Run the Sysprep.exe file from the C:\Sysprep folder
  2. Click on OK when warned you are running the tool
  3. Ensure that the Shtudown Mode is set to Shut Down and then click on the Reseal button
  4. When prompted that you will regenerate the SIDs for the server click on OK to run Sysprep
  5. Sysprep will now run on the server and shut it down once completed

Using gPXE To allow booting from iSCSI

There are several ways which gPXE can be used with a server including chaining it with an existing PXE installation and burning a ROM version in to the Network Card itself.

For this article the option used was to use a gPXE modified ROM for the network card as this is straight forward enough to perform on a virtual machine.

Obtaining the VMWare PCNet32 gPXE ROM

To obtain the ROM version for the PCNet32 NIC used in VMWare perform the following steps :-

  1. Go to the web-site www.rom-o-matic.org
  2. Click on the latest Production release link
  3. When prompted select the output format to be a ROM binary (flashable) image (.rom)
  4. Choose the pcnet32 NIC Type from the drop down box.
  5. Set the PCI VENDOR CODE to 1022  and the PCI DEVICE CODE to 2000
  6. Click on the Get Image button and save the file to the relevant place on the VMWare Server.

Modifying the VMWare Guest configuration file

Once the PCNet32 ROM has been obtained and saved on to the VMWare Server perform the following steps to modify the Virtual Machines Network Cards to use the gPXE ROM :-

  1. Open the VMWare Configuration File (.VMX File) for the Virtual Machine
  2. At the end of the file add in the line below :-nbios.filename = {Path to the PCNet32 ROM file}E.G. nbios.filename = “/downloads/pcnet32.rom”
  3. Save and exit the file

FreeNAS 8.0 iSCSI 4 – Starting The ISCSI Service

FreeNAS 8.0 iSCSI 4 – Starting The ISCSI Service

Starting The iSCSI Service

The final part of the configuration of iSCSI on a FreeNAS Version 8.0 RELEASE server is to start the iSCSI Service.  To start the iSCSI service perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane
  • Click on Control Services
  • The iSCSI Service will be showing as Off (Red)
  • Click on the Off box to start the iSCSI service
  • The iSCSI Service will now be showing as On (Blue)

FreeNAS 8.0 iSCSI 3 – Configuring Targets And Extents

FreeNAS 8.0 iSCSI 3 – Configuring Targets And Extents

Configuring Targets And Extents

The final step in configuring iSCSI on a FreeNAS Version 8.0 RELEASE server is to configure the Targets and Extents.  For this article we will be configuring an iSCSI Disk Target.  An iSCSI Disk Target effectively takes one of the disks in the server and deploys it to the Initiators (Clients) as a Raw block device.  The presented iSCSI Disk will be just like a new hard disk in the Initiator (Client) machine and will require partitioning and formatting before use.

Configuring iSCSI Disk Targets

The first part of the configuration is to configure the Target required.  To configure the Target perfom the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Targets branch and click on Add Target
  • Configure the Target Name to the desired name
  • Configure the Type as Disk
  • Configure the Portal Group ID as 1 (The Portal set up in the first article)
  • Configure the Initiator Group ID as 1 (The Initiator Group set up in the first article)
  • Click on OK to create the new Target

Configuring Device Extents

The next part of the configuration is to configure the Extent required on the server for our iSCSI Disk Target which is a Device Extent.  To configure the Device Extent perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Device Extents branch and click on Add Extent
  • Configure the Extent Name to desired name
  • From the Disk Device drop down box select the disk ID required

N.B. Ensure you select the correct Disk Device ID

  • Click on OK to create the new Device Extent

Associating The Target And Extent

The final part of the configuration is to associate the Target with the Extent on the server.  To associate the Target with the Extent perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Target / Extents branch and click on Add Target / Extent
  • From the Target drop down box select the iSCSI Disk Target required
  • From the Extent drop down box select the Device Extent required
  • Click on OK to create the new Association

FreeNAS 8.0 iSCSI 2 – Configuring The Target Global Configuration

FreeNAS 8.0 iSCSI 2 – Configuring The Target Global Configuration

The next step in configuring iSCSI on a FreeNAS Version 8.0 RELEASE server is to configure the Target Global Configuration.  To configure the Target Global Configuration perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Target Global Configuration branch
  • Either configure the Base Name to something more meaningful for your environment or leave it set as the suggested value
  • Leave Discovery Auth Method and Discovery Auth Group as None.  This allows anonymous discovery of the iSCSI Target from all initiators.
  • Tick the Enable LUC (Logical Unit Controller) checkbox
  • Configure the Controller IP Address as 127.0.0.1
  • Configure the Controller TCP Port as 3261
  • Configure the Controller Authorised Netmask as 255.255.255.0
  • Configure the Controller Auth Method as CHAP
  • Configure the Controller Auth Group as 1 (The Authorised Access Group setup in the previous article)
  • Click on OK to save the Target Global Configuration

FreeNAS 8.0 iSCSI 1 – Configuring Authorised Access

FreeNAS 8.0 iSCSI 1 – Configuring Authorised Access

Configuring Access

The first step in the configuration is to set up the Access for iSCSI by configuring the Authorised Access, Authorised Initiators, and setting up an iSCSI Portal.

Configuring Authorised Access

The first step in configuring access is to setup Authorised Access.  To configure Authorised Access for iSCSI perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Authorized Access branch and then click on Add Authorized Access
  • In the Add Authorized Access screen leave the Group ID as 1
  • For the User field enter in the CHAP Username you wish to use
  • For the Secret field enter in the CHAP Password you wish to use and confirn it in the Secret (Confirm)  setting
  • Click on OK to create the new Authorized Access Group

Configuring Authorised Initiators

The next step in configuring access is to setup the initiators which are authorised to access iSCSI and from which network(s).

To configure Authorised Initiators for iSCSI perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Initiators branch and then click on Add Initiator
  • In the Add Initiator screen leave the Initiators as ALL
  • For the Authorized Network setting leave it also as ALL
  • Enter a Comment for the Authorized Initiators 
  • Click on OK to create the new Authorized Initiators Group

The Authorised Initiators setup above is a very basic configuration which allows access to iSCSI from all Initiators (Clients) on all networks.  Further locking down of this can be done to allow different access from different networks for named initiators and will be explained later in an advanced article.

Configuring An iSCSI Portal

The next step in configuring access is to setup an iSCSI Portal which controls which networks iSCSI will listen on.  To configure an iSCSI Portal perform the following steps :-

  • Logon to the FreeNAS Web Console as an administrative account
  • Expand Services in the left hand pane and then expand iSCSI
  • Expand the Portals branch and then click on Add Portal
  • In the Add Portal screen leave the Portal as 0.0.0.0:3260
  • Enter a Comment for the Portal 
  • Click on OK to create the new iSCSI Portal

The iSCSI Portal seup above is again a very basic configuration which sets iSCSI up to listen on all IP Addresses on the server.  Further locking down of this can be done to configure iSCSI to listen on different IP Addresses and will be explained later in an advanced article.

FreeNAS 8.0 iSCSI – Introduction And Pre-Requisites

FreeNAS 8.0 iSCSI – Introduction And Pre-Requisites

Introduction

FreeNAS is an open source FreeBSD based NAS solution which supports various ways of sharing storage on a network including CIFS (Windows shares), NFS, and iSCSI.

iSCSI (Internet Small Computer System Interface) is an inexpensive method of providing storage over IP across LAN’s and WAN’s as an alternative to Fibre SAN attached storage.

The following articles explain how to configure iSCSI on a FreeNAS Version 8.0 RELEASE server.

For these articles iSCSI was configured to deploy disk devices to a Windows 2008 R2 Failover Cluster.

The configuration of iSCSI on a FreeNAS Version 8.0 RELEASE server can be split down in to the following sections :-

  • Configuring Access
  • Configuriing the Target Global Configuration
  • Configuring Targets and Extents

Pre-Requisites

In order to configure iSCSI on a FreeNAS Version 8.0 RELEASE server the following pre-requisites must be met :-

  • A FreeNAS Version 8.0 RELEASE installation
  • Free Hard Disks for deploying as iSCSI Disk Devices
  • At least one Network Connection

Where as iSCSI can be used to deploy disks across any network connection it is recommended if possible to have a seperate dedicated iSCSI network so that production LAN performance is not impacted.

Hardware Used

The hardware used for these articles was all Virtual Machines running on a CentOS 5.5 64-Bit VMware Server Version 1.0.8 host.

FreeNAS Server

The FreeNAS Virtual Machine hardware was configured as shown here. The server has also had the following additional hardware added :-

  • An additional Network Interface connected to an iSCSI only Network
  • Three additional Hard Drives for iSCSI Deployment

Windows 2008 R2 Servers

The Windows 2008 R2 Cluster Node servers Virtual Machine hardware was configured using the Windows 2003 64-Bit Enterprise template with the following additional hardware added :-

  • An additional Network Interface connected to an iSCSI only Network
  • An additional Network Interface connected for Cluster Heartbeat

 The installation and configuration of the Windows 2008 R2 Failover Cluster and nodes is outside the scope of these articles but are mentioned here as a reference.

CentOS – Configuring an iSCSI Volume on CentOS 5.5

CentOS – Configuring an iSCSI Volume on CentOS 5.5

Introduction

iSCSI is a network protocol which allows you to use SCSI over a network and is a cheaper alternative to a Fibre Network or SAN solution.

Connecting iSCSI Volumes to a CentOS server is a simple procedure and is explained in the following steps.

Pre-Requisites

  • An iSCSI Target server
  • iSCSI Target(s) configured on the Target server

Installing The iSCSI Initiator Software

In order to connect to an iSCSI Target server the client requires the iSCSI Initiator Software installed.  To install the iSCSI Initiator Software perform the following steps :-

  1. Logon to the client machine as root
  2. At the command prompt execute yum install iscsi-initiator-utils

iSCSI Chap Credentials Configuration (Optional)

If your iSCSI Target server is configured to require Chap credentials perform the following steps :-

  1. Edit /etc/iscsi/iscsid.conf
  2. Uncomment the line node.session.auth.username = username by removing the # symbol from the start of the line
  3. Change the username to the Chap username required for you iSCSI Target Server
  4. Uncomment the line node.session.auth.password = password by removing the # symbol from the start of the line
  5. Change the password to the Chap password required for you iSCSI Target Server
  6. Uncomment the line discovery.sendtargets.auth.username = username by removing the # symbol from the start of the line
  7. Change the username to the Chap username required for you iSCSI Target Server
  8. Uncomment the line discovery.sendtargets.auth.password = password by removing the # symbol from the start of the line
  9. Change the username to the Chap password required for you iSCSI Target Server
  10. Save and exit the file

Start the iSCSI Service

Once the Chap Credentials have been configured (If required start the iSCSI Service by executing the following step :-

  1. In the command prompt execute service iscsi start

Discover Targets

To discover targets perform the following steps :-

  1. In the command prompt execute iscsiadm -m discovery -t sendtargets -p {iSCSI Target Server IP Address}
  2. Once the iscsiadm command finishes restart the iSCSI Service by executing service iscsi restart

The iscsiadm command will discover any targets available to your client on the network and to see which disks have been found perform the following steps :-

  1. In the command prompt execute fdisk -l

From the list of disks shown by the fdisk command locate the new device(s) which have been added.  For the purposes of this article we’ll use /dev/sdb and /dev/sdc.

N.B. The fdisk will list ALL disks discovered by the iscsiadm command and care must be taken identifying the correct disk to use

Partition And Format The iSCSI Volumes

Once you’ve identified the iSCSI Disk(s) they will need to be formatted and mounted.  To format and mount the disk(s) perform the following steps :-

  1. In the command prompt execute fdisk /dev/sdb
  2. In fdisk type n to create a new partition and press enter
  3. When prompted select the partition type to use from eitherextended or primary and press enter
  4. When prompted select the partition number to use and press enter
  5. To apply the settings to the disk type w and then enter
  6. Repeat steps 1 to 5 for each Disk which requires partitioning

After creating the Partitions on the Disk(s) format them as required.  For the purposes of this article we’ll create an ext3 filesystem.  To create the filesystem on the disks perform the following steps :-

  1. In the command prompt execute mke2fs -j -m 0 -O dir_index /dev/sdb1
  2. Repeat step 1 for each disk which requires a filesystem

Mount The iSCSI Volumes

To mount the disks once they’ve been prepared perform the following steps :-

  1. In the command prompt execute mkdir /mnt/iscsi-disk1 and thenmkdir /mnt/iscsi-disk2
  2. In the command prompt execute mount /dev/sdb1 /mnt/iscsi-disk1 and then mount /dev/sdc1 /mnt/iscsi-disk2

Configure The iSCSI Service To Start Automatically At Boot

To configure the iSCSI Service to start automatically at boot time perform the following step :-

  1. In the command prompt execute chkconfig iscsi on

Automatically Mount The iSCSI Volumes At Boot Time

To configure the iSCSI Volumes to mount at boot time perform the following steps :-

  1. Edit the file /etc/fstab
  2. Add the following lines to the bottom of the file:-

/dev/sdb1    /mnt/iscsi-disk1 ext3 _netdev 0 0

/dev/sdc1    /mnt/iscsi-disk2 ext3 _netdev 0 0

  1. Save and exit the file

Thanks go to the site below which I used to learn how to configure my test server and for further information follow the link below :-

http://www.cyberciti.biz/tips/rhel-centos-fedora-linux-iscsi-howto.html