This post describes on how to setup and configure hosted Openfiler iSCSI storage target on a VMware ESX/ESXi or VMware server 1.x or 2.x host using the freely available Openfiler appliance. However this configuration and setting not a suitable solution for a production environment as it does not include any iSCSI CHAP authentication or datastore multipathing. But it’s good for troubleshooting and learning. Openfiler is an Open Source Network Attached Storage and Storage Area Network Solution.
- a. VMware ESX/ESXi/Server 2.0/Vmware workstations/VMware player as a host with a minimum of 5GB of free space on the local datastore.
- b.Addional Space for extra logical volume on Openfiler iSCSI Storage (e.g dev/sdb)
- c.Openfiler appliance source file. (e.g openfiler-2.3-x86_64.vmware.tar.gz) You may download at this URL :
- Disk /dev/sdb (30GB) has been added as below :
[[email protected] ~]# fdisk -l Disk /dev/sda: 2355 MB, 2355978240 bytes 16 heads, 63 sectors/track, 4565 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 4565 2300696 83 Linux Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 3917 31457279+ ee EFI GPT
TCP/IP Configuration :
The procedure detailed below is based on the following configuration. Openfiler appliance assigned the hostname and TCP/IP configuration details:
Steps and Procedure on How to Setup and Configure Openfiler iSCSI Storage :
1. Extract the contents of the downloaded Openfiler tar.gz file (one .vmx file and two .vmdk files) into a directory, the name of which reflects the hostname you wish to use for the Openfiler appliance (example: storage01).
2. Login to ESXi/ESX/VMware Server/Vmware Workstation console, add extracted Openfiler tar.gz file to inventory.
3. Skipped this step on VMware Server 1.x, VMware Server 2.x and VMware Workstation. In ESXi/ESX server edit the Openfiler appliance settings and add a second disk of the size determined.(example: 30GB).
4. Modify the vCPU and Memory setting to meet your requirement.
5. Power on the Openfiler appliance. By default, the Openfiler appliance will attempt to obtain an IP address via DHCP, but best practice is to assign a static Ip address and this such configuration is typically done via the Openfiler web interface. On the Screen capture, hostname and static ip address has been assigned as below :
6. Logon to the console as root. By default, no root password is set so you will not be prompted. Set a root password by entering the command passwd, pressing Enter and following the prompts.
Note: A password must be set in order to permit a remote root login from a SSH client.
[[email protected] ~]# passwd Changing password for user root. New UNIX password:
7. Browse to https:/DHCP_IP_Address:446, or to the IP address if not using DNS, and ignore the certificate warning. Logon to the Openfiler web interface with the default administrator. Username openfiler and default Password password.
Note: The default administrative port number is 446.
8. To Change to static IP, Select the System tab then scroll down to the “Network Interface Configuration” click “Configure“. On the Network Interface Configuration”, change default Boot Protocol, DHCP to Static for eth0. Then Enter the IP Address, Netmask and leave default for MTU.
9. To configure network range allowed, select the System tab and scroll down to the “Network Access Configuration” section. Define the allowed networks that accept connections from Openfiler appliance. You also can specify individual host IP addresses and ranges. Click Update after entering each set of details.
10. To add the the new logical disk select the Volumes tab and click the Block Devices link. Confirm the presence of disk /dev/sdb.
Please note that the isk /dev/sda is the disk that Openfiler is running on; /dev/sdb is the second disk that was added and that will be provisioned as iSCSI storage.
Click the /dev/sdb link and scroll down to the Create a partition in /dev/sdb section. By default, a partition will be created that fills the entire disk. Accept the defaults and click Create.
11. To add volume Group,select the Volumes tab. Click the Volume Groups link and enter a Volume Group name “datagroup” (the name is not critical), select /dev/sdb1 (30GB) and click Add volume group.
12. To Create a volume in “datagroup“, select the Volumes tab. Click the Add Volume link. The only existing volume group of volumegroup (datagroup) will be selected by default. Scroll down to the Create a volume in “volumegroup” section. Enter a Volume Name of volume (the name is not critical), a Volume Description of vmware (the description is not critical), adjust the required Space slider up to the maximum, select a Filesystem/Volume type of iSCSI and click Create.
13. This steps is to enable iSCSI target and disable iSCSI initiator. Select the Services tab. Click the Enable link adjacent to iSCSI target server. Click the Disable link adjacent to iSCSI initiator.
14. To Add new iSCSI target, select the Volumes tab and click the iSCSI Targets link from the Volumes Section menu. Modify the auto-generated Target IQN to include the Openfiler name (iqn.2012.openfilerlab1.local in this example) and click Add.
Then select the LUN Mapping sub-tab and click Map to map the previous defined volume as a LUN to the newly created iSCSI target (accepting all the defaults).
Finally, select the Network ACL sub-tab and change the Access from Deny to Allow. Click Update.
15. Congratulation!! Now the iSCSI target is accessible to any iSCSI requester on the permitted network/s or IP addresses.