XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

9
[email protected] www.xtravirt.com © 2009 | 1 how-to guide How to Configure Openfiler iSCSI Storage for VMware ESX 4 Title: How to Configure Openfiler iSCSI Storage for VMware ESX 4 Author(s): Xtravirt (Paul Buckle) Target Audience: Technical - Intermediate Current Revision: 1.0 (Aug 2009) First Published: Aug 2009 Product(s): Openfiler 2.3, VMware ESX 4 UID: 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 locally- hosted 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. 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 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 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

Transcript of XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

Page 1: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 1

how-to guide

How to Configure Openfiler iSCSI Storage for VMware ESX 4

Title: How to Configure Openfiler iSCSI Storage for VMware ESX 4

Author(s): Xtravirt (Paul Buckle)

Target Audience: Technical - Intermediate

Current Revision: 1.0 (Aug 2009)

First Published: Aug 2009

Product(s): Openfiler 2.3, VMware ESX 4

UID: XD10119

Content Overview:

• Step by Step guide to setup the Openfiler Appliance within a VMware ESX 4

environment

1.0 IntroductionThis document describes how to provision a locally-

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

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

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

3.0 Configuration DetailsThe 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

Page 2: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 2

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

• 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 openfiler-

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

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

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 host’s 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.

Online resources for the virtualization industryWe simplify complex concepts and make them valuable, practical assets. Free white papers, articles, how-to-guides, e-books,presentation tools and much more.

Page 3: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 3

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.

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. don’t select Allocate and commit space on

demand and that it is stored with the existing files,

i.e. select Store with virtual machine.

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

-------------------------------------------------------------------------

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

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.

8. Logon to the console as root. Note: By default, no root password is set so you will not be

prompted for one.

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.

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/networkNETWORKING=yes

HOSTNAME=openfiler03.demolab.local

GATEWAY=192.168.4.9

b. /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0

BOOTPROTO=static

ONBOOT=yes

TYPE=Ethernet

MTU=1500

USERCTL=no

IPADDR=192.168.4.33

NETMASK=255.255.255.0

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

Page 4: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 4

c. /etc/resolv.conf (only required if using DNS)search demolab.local

nameserver 192.168.4.13

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 host’s VMKernel interface by pinging it

by name if using DNS, by IP address if not.

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.

16. Reboot the Openfiler appliance by typing

shutdown –r now and pressing Enter. Monitor

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.

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.

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.

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

Page 5: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 5

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.

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.

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.

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.

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.

26. Select the Services tab. Click the Enable link

adjacent to iSCSI target server. Click the Disable

link adjacent to iSCSI initiator.

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

Page 6: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 6

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.

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

29. Select the Network ACL sub-tab and change the

Access from Deny to Allow. Click Update.

30. The iSCSI target is now accessible to any iSCSI

requester on the permitted network/s or IP

addresses.

31. Leave the Openfiler GUI open and switch to

vSphere Client. Select Configuration -> Storage

Adapters, select the iSCSI Software Adapter

(vmhba32) and click Properties.

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.

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.

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

Page 7: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 7

34. Select the Static Discovery tab and confirm that

the iSCSI Server Address and Target Name are

shown.

35. Click Close and when prompted, click Yes to

accept the recommendation to rescan the host

bus adapter.

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

37. Select Configuration -> Storage and click Add

Storage. Select Disk/LUN and click Next.

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.

39. The only possible disk layout configuration will be

displayed. Click Next.

40. Enter a name for the datastore (example:

openfiler03) and click Next.

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

Page 8: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected] www.xtravirt.com © 2009 | 8

41. Accept the default values for Maximum file size

and Capacity and click Next.

42. Click Finish.

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.

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.

The new datastore is ready to be used for Virtual

Machine disk files.

This concludes the how-to guide.

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

Page 9: XD10119 How to Configure Openfiler iSCSI Storage for VMware ESX 4

[email protected]

References1. Nil.

Useful Links1. Openfiler, http://www.openfiler.com/

2. VMware vSphere iSCSI SAN Configuration Guide, http://www.

vmware.com/pdf/vsphere4/r40/vsp_40_iscsi_san_cfg.pdf

TagsOpenfiler, iSCSI, VMware, ESX 4

www.xtravirt.com © 2009 | 9

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

About XtravirtXtravirt 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 [email protected]

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.