Sie sind auf Seite 1von 9

how-to guide

How to Configure Openfiler iSCSI Storage for VMware ESX 4


Title: Author(s): Target Audience: Current Revision: First Published: Product(s): UID: How to Configure Openfiler iSCSI Storage for VMware ESX 4 Xtravirt (Paul Buckle) Technical - Intermediate 1.0 (Aug 2009) Aug 2009 Openfiler 2.3, VMware ESX 4 XD10119

Content Overview: Step by Step guide to setup the Openfiler Appliance within a VMware ESX 4 environment

1.0 Introduction
This document describes how to provision a locallyhosted iSCSI storage target and the process to present it as a datastore on a VMware ESX 4 host using the freely available Openfiler appliance. This configuration is not a suitable solution for a production environment and it does not include any iSCSI CHAP authentication or datastore multipathing.

Openfiler appliance) VMware vSphere Client 4.0 Openfiler x86_64 VMware ESX Virtual Appliance from http://www.openfiler.com/community/download/ Hostname and TCP/IP configuration details for the Openfiler appliance Recommended: Direct Internet access and Internet name resolution (for Openfiler updates) Optional: Local DNS services Optional: VMware vCenter Server 4.0

2.0 Pre-Requisites
Gigabit networking A VMware ESX 4.0 host with: a minimum of 5GB of free space on the local datastore a VMkernel interface (for iSCSI traffic) with connectivity to the same network on which the host can provision Virtual Machines (ie. the

3.0 Configuration Details


The procedure detailed below is based on the following configuration: A single TCP/IP subnet of 192.168.4.0/24 for the ESX host Service Console, VMkernel (iSCSI) and Openfiler appliance network interfaces
Note: This does not adhere to VMware best practices

Illustration 1-1: Openfiler and ESX 4

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

Online resources for the virtualization industry


We simplify complex concepts and make them valuable, practical assets. Free white papers, articles, how-to-guides, e-books, presentation tools and much more.

A single ESX host, esx03.demolab.local, with approximately 60GB of free space on the local datastore and the following TCP/IP configuration details: IP address (Service Console) 192.168.4.103 IP address (VMkernel interface) 192.168.4.113 Subnet mask (both interfaces) 255.255.255.0 Default gateway (both interfaces) 192.168.4.9 DNS server (Service Console) 192.168.4.13 Openfiler appliance source file openfiler2.3-x86_64.esx.tar.gz with an SHA-1 checksum of be09b8cae8b58fdeac8979cfc331bbca12d94f8d (the latest available at the time of writing) Openfiler appliance assigned the hostname openfiler03.demolab.local and the following TCP/IP configuration details: IP address 192.168.4.33 Subnet mask 255.255.255.0 Default gateway 192.168.4.9 DNS server 192.168.4.13 Local DNS (demolab.local) and direct Internet connectivity with Internet name resolution

2.

Start vSphere Client and connect to the ESX host directly, or to the vCenter Server that is managing it. Use the Datastore Browser feature to upload the Openfiler directory to the ESX hosts local VMFS datastore (example: esx03-local).

3.

Open this directory in the Datastore Browser, right click the .vmx file and select Add to Inventory. Complete the Add to Inventory wizard, electing to host the appliance on the same ESX host as where the Virtual Machine files are stored.

4.0 Procedure
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: openfiler03).

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

4.

Use the vSphere Client to determine the free space available on the local datastore. This space will be used to provision the iSCSI volume that the Openfiler appliance will serve.
Note: Do not use all the available capacity; leave a small amount free. In this example, the esx03-local datastore has 58GB available after uploading the Openfiler appliance; 50GB of it will be used for the iSCSI volume.

displayed within the web interface. Therefore, even if the appliance had initially been assigned an IP address via DHCP, without this update being applied, it would not be possible to configure the appliance with a static IP address anyway, without modifying a system file via the console. This modification is detailed below. ------------------------------------------------------------------------7. From the vSphere Client, power on the Openfiler appliance, select the Console tab and monitor the boot process. The errors regarding eth0 and time server that may be observed can safely be ignored.
Note: The You do not appear to have networking message appears once the boot process has completed.

5.

Edit the Openfiler appliance settings and add a second disk of the size determined above (example: 50GB). Although they are the default settings, ensure that the disk is thick-provisioned, i.e. dont select Allocate and commit space on demand and that it is stored with the existing files, i.e. select Store with virtual machine. Edit the Openfiler appliance settings and assign the vNIC to the appropriate port group (example: Virtual Machine Network. By default the vNIC is configured to use the VM Network portgroup). Deselect the Connect at power on option.
Note: The required network configuration will be applied before connecting the appliance to the network.

8.

Logon to the console as root.


Note: By default, no root password is set so you will not be prompted for one.

6.

9.

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.

------------------------------------------------------------------------By default, the Openfiler appliance will attempt to obtain an IP address via DHCP, but best practice is to assign a static one. Such configuration is typically done via the Openfiler web interface but this will not be possible if a DHCP server is not available as the web interface would not be accessible. Instead, an IP address would need to be assigned via the console - this is the approach used in this procedure and is recommended whether a DHCP server is available or not. Additionally, once network connectivity has been established via the console, it can used, subject to direct Internet access being available, to download any updates to the appliance. For the version of Openfiler used in this example, one of the updates resolves an issue which prevents the network interface from being

10. Setting the required network configuration requires the editing of four files. Use a text editor such as nano or vi, to ensure they precisely match the versions below, substituting the elements highlighted in red for your own configuration parameters.
Note: All files except for /etc/resolv.conf will already exist and any comments, those lines starting with a # character, can be left in place.

a. /etc/sysconfig/network
NETWORKING=yes HOSTNAME=openfiler03.demolab.local GATEWAY=192.168.4.9

b. /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 BOOTPROTO=static ONBOOT=yes TYPE=Ethernet MTU=1500 USERCTL=no IPADDR=192.168.4.33 NETMASK=255.255.255.0

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

c. /etc/resolv.conf
search demolab.local nameserver 192.168.4.13

(only required if using DNS)

the boot process and confirm that it completes without any errors.
Note: The Web administration GUI: https://xx.xx.xx.xx/ message appears once the boot process has completed.

d. /etc/hosts

(this all one line)

127.0.0.1 openfiler03.demolab.local openfiler03 localhost. localdomain localhost

11. Edit the Openfiler appliance settings, connect the vNIC and configure it to be connected at power on. 12. Type service network restart and press Enter to commit the network configuration which should complete without error. Test network connectivity to the ESX hosts VMKernel interface by pinging it by name if using DNS, by IP address if not.

17. Browse to https://openfiler03:446, or to the IP address if not using DNS, and ignore the certificate warning.
Note: The default administrative port number is 446.

18. Logon to the Openfiler web interface with the default administrator. Username openfiler and default Password password.

13. If Internet access is available: Test connectivity to the Internet by pinging conary.rpath.com (the online source for Openfiler updates). 14. If Internet access is available: Update the Openfiler installation by typing conary updateall and pressing Enter.
Note: It will take quite a few minutes for the updates to be downloaded and applied.

15. If Internet access is not available: Edit the /opt/ openfiler/var/www/includes/network.inc file to resolve the issue that prevents the network interface from being displayed in the web interface. Replace: exec(sudo /bin/grep \eth\ / var/log/dmesg,$output); with: exec(sudo /sbin/ifconfig | /bin/ grep eth,$output);
Note: After making this change, if Internet connectivity is available in the future and the conary updateall command is used, the application of any patches that relate to this file will fail, as it will not be in the expected state.

19. Select the Accounts tab and click the Admin Password link. Change the password for the Openfiler account to one of your choice and click Submit.

20. Click the Log Out link and log back in using the new password.

16. Reboot the Openfiler appliance by typing shutdown r now and pressing Enter. Monitor

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

21. Select the System tab and scroll down to the Network Access Configuration section. Define the networks you require Openfiler to accept connections from (set the Type value to Share for each of them); alternatively, specify individual host IP addresses. Click Update after entering each set of details.

24. Click the Volume Groups link. Enter a Volume Group name volumegroup (the name is not critical), select /dev/sbd1 and click Add volume group.

22. Select the Volumes tab and click the Block Devices link. Confirm the presence of disk /dev/ sdb.
Note: Disk /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.

25. Click the Add Volume link. The only existing volume group of volumegroup (or the name given) 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.

23. 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.

26. Select the Services tab. Click the Enable link adjacent to iSCSI target server. Click the Disable link adjacent to iSCSI initiator.

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

27. Select the Volumes tab and click the iSCSI Targets link. Modify the auto-generated Target IQN to include the Openfiler name (iqn.2006-01. com.openfiler:openfiler03 in this example) and click Add.
Note: This step is not critical; it simply helps identify the server when configuring the remote iSCSI initiator.

31. Leave the Openfiler GUI open and switch to vSphere Client. Select Configuration -> Storage Adapters, select the iSCSI Software Adapter (vmhba32) and click Properties.

28. 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).

32. Click Configure and change the auto-generated iSCSI Name to include the ESX host name (iqn.1998-01.com.vmware:esx03 in this example).
Note: This step is not critical; it simply helps identify the server when viewing connections to the iSCSI target.

Ensure the adapter is enabled and click OK.

29. Select the Network ACL sub-tab and change the Access from Deny to Allow. Click Update.

33. Select the Dynamic Discovery tab and click Add. Enter the iSCSI Server name (example: openfiler03.demolab.local) or IP address if not using DNS. Leave the port at the default value of 3260 and click OK.
Note: This change will take a few moments to take effect.

30. The iSCSI target is now accessible to any iSCSI requester on the permitted network/s or IP addresses.

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

34. Select the Static Discovery tab and confirm that the iSCSI Server Address and Target Name are shown.

38. Select the iSCSI disk that is displayed (this is the one that was presented to the ESX host in the previous steps) and click Next.

35. Click Close and when prompted, click Yes to accept the recommendation to rescan the host bus adapter. 39. The only possible disk layout configuration will be displayed. Click Next.

36. The iSCSI disk will be added and displayed in the bottom pane of vSphere Client. The disk is now visible to the ESX host but needs to be formatted as VMFS and defined as a datastore before it can be used to store Virtual Machines

40. Enter a name for the datastore (example: openfiler03) and click Next.

37. Select Configuration -> Storage and click Add Storage. Select Disk/LUN and click Next.

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

41. Accept the default values for Maximum file size and Capacity and click Next.

44. Switch back to the Openfiler web interface, select the Status tab and click the iSCSI Targets link.
Note: The record of the connection from the ESX host should be shown.

42. Click Finish.

The new datastore is ready to be used for Virtual Machine disk files.

This concludes the how-to guide.

43. When the format process has completed, the new datastore will be displayed.
Note: The alert against the local VMFS datastore can be ignored and is simply due to the available disk space being low.

information@xtravirt.com

www.xtravirt.com 2009 |

visit www.xtravirt.com for the latest version of this document

About Xtravirt
Xtravirt is a knowledge-based company that delivers its expertise in virtualization online and in person. We have developed a reputation for astute leadership and expertise through our work with an impressive array of organisations. It is this real-world experience that drives our ability to provide independent, current and free advice online. We work with organisations whose IT staff are frustrated with how hard it is to find detailed information and skills around virtualisation. We help our clients deliver the true benefits of virtualization, resulting in cost and time savings. For more information contact: Dorset House, Regent Park 297 Kingston Road, Leatherhead Surrey KT22 7PL t +44 (0) 1372 824 296 f +44 (0) 1372 824 576 e information@xtravirt.com w www.xtravirt.com
Copyright 2009 Xtravirt Ltd. All rights reserved. The information contained herein is subject to change without notice. Xtravirt Ltd shall not be liable for technical or editorial errors or omissions contained herein. Xtravirt and the Xtravirt logo are registered trademarks of Xtravirt Ltd. The names of actual companies and products mentioned herein may be the trademarks or registered trademarks of their respective owners. This document remains the property of Xtravirt Ltd. Contents may not be copied, reproduced or modified without written consent from Xtravirt Ltd.

References
1. Nil.

Tags
Openfiler, iSCSI, VMware, ESX 4

Useful Links
1. 2. Openfiler, http://www.openfiler.com/ VMware vSphere iSCSI SAN Configuration Guide, http://www. vmware.com/pdf/vsphere4/r40/vsp_40_iscsi_san_cfg.pdf

information@xtravirt.com

www.xtravirt.com 2009 |

Das könnte Ihnen auch gefallen