Archive for FreeNas

Configure FreeNAS 8.3 for sharing and iSCSI and VMWare ESXi

Sharing Configuration

Once you have a volume, create at least one share so that the storage is accessible by the other computers in your network. The type of share you create depends upon the operating system(s) running in your network, your security requirements, and expectations for network transfer speeds. The following types of shares and services are available

  • Apple (AFP) Shares

The Apple File Protocol (AFP) type of share is the best choice if all of your computers run Mac OS X.

  • Unix (NFS) Shares

The NFS type of share is accessible by MAC OS X, Linux, BSD, and the professional/enterprise versions (not the home editions) of Windows. It is a good choice if there are many different operating systems in your network. Depending upon the operating system, it may require the installation or configuration of client software on the desktop.

NFS typically is generally more accessible because it’s a file level protocol and sits higher up on the network stack. This makes it very appealing when working with VMware virtual disks aka vmdk’s simply because they also exist at the same layer. NFS is ubiquitous across NAS vendors and can be provisioned by multiple agnostic implementation endpoints.  An NFS protocol hosts the capability to be virtualized and encapsulated within any Hypervisor instance either clustered or standalone. The network file locking and share semantics of NFS grant it a multitude of configurable elements which can serve a wide range of application

  • Windows (CIFS) Shares

This type of share is accessible by Windows, MAC OS X, Linux and BSD Computers but it is slower than an NFS Share due to the single threaded design of Samba. It provides more configuration options than NFS and is a good choice on a network containing only Windows systems. However, it is a poor choice if the CPU on the FreeNAS™ system is limited; if your CPU is maxed out, you need to upgrade the CPU or consider another type of share.

http://www.freenas.org/images/resources/freenas8.2/freenas8.2_guide.pdf

iSCSI

iSCSI is a protocol standard for the consolidation of storage data. iSCSI allows FreeNAS™ to act like a storage area network (SAN) over an existing Ethernet network. Specifically, it exports disk devices over an Ethernet network that iSCSI clients (called initiators) can attach to and mount. Traditional SANs operate over fibre channel networks which require a fibre channel infrastructure such as fibre channel HBAs, fibre channel switches, and discrete cabling. iSCSI can be used over an existing Ethernet network, although dedicated networks can be built for iSCSI traffic in an effort to boost performance. iSCSI also provides an advantage in an environment that uses Windows shell programs; these programs tend to filter “Network Location” but iSCSI mounts are not filtered. FreeNAS™ uses istgt to provide iSCSI.

Before configuring the iSCSI service, you should be familiar with the following iSCSI terminology:

CHAP: an authentication method which uses a shared secret and three-way authentication to determine if a system is authorized to access the storage device and to periodically confirm that the session has not been hijacked by another system. In iSCSI, the initiator (client) performs the CHAP authentication.

Mutual CHAP: a superset of CHAP in that both ends of the communication authenticate to each other. Initiator: a client which has authorized access to the storage data on the FreeNAS™ system. The client requires initiator software to connect to the iSCSI share.

Target: a storage resource on the FreeNAS™ system.

Extent: the storage unit to be shared. It can either be a file or a device.

LUN: stands for logical unit number and represents a logical SCSI device. An initiator negotiates with a target to establish connectivity to a LUN; the result is an iSCSI connection that emulates a connection to a SCSI hard disk. Initiators treat iSCSI LUNs the same way as they would a raw SCSI or IDE hard drive; rather than mounting remote directories, initiators format and directly manage filesystems on iSCSI LUNs

High Level Overview of iSCSI in FreeNas

  • Decide if you will use authentication, and if so, whether it will be CHAP or mutual CHAP. If using authentication, create an authorized access.
  • Create either a device extent or a file extent to be used as storage.
  • Determine which hosts are allowed to connect using iSCSI and create an initiator.
  • Create at least one portal.
  • Review the target global configuration parameters.
  • Create a target.
  • Associate a target with an extent.
  • Start the iSCSI service in Services -> Control Services

Instructions

  • Log into your FreeNas Box – Instructions detailed in previous post
  • Make sure you have added Disks to the FreeNas Machine and created a volume right up to the point of the previous post or follow the quick steps below
  • Navigate to Storage > Volume Manager

Capture

  • Enter a Volume Name, select disk(s), select Filesystem Type ZFS then click Add Volume. It defaults to Vol1 but I names mine VMware as I want to label it clearly for use as a VMware iSCSI volume

Capture

  • Click Storage, Volume Manager and click in the existing volume you have below

  • Select the fifth button from the left which is to Create a ZFS Volume

Capture

  • Click Add ZFS Volume
  • Once created it will then be listed below as per below screenprint

  • Click the Services box at the top of FreeNas and turn on the iSCSI service

Capture

  • If you will be using CHAP or mutual CHAP to provide authentication, you must create an authorized access in Services – ISCSI – Authorized Accesses – Add Authorized Access

  • Explanation of boxes shown below

  •  Go to iSCSI > Initiators – Add Initators – Keep ALL in the boxes or type in the servers separated by a comma which you want to be able to connect

  •  Next go to iSCSI > Portal and Click Add Portal. You can keep this on 0.0.0.0.This will cause it to listen on all IP Addresses for the initiator or select your IP Address for the FreeNas unit. I have selected my FreeNas IP Address

  •  Go to Target Global Configuration
  • In Discovery Auth Method, choose CHAP
  • In Discovery Auth Group, choose 1
  • Leave the other settings unless you know what you’re doing

  • Next go to iSCSI > Target – Add Target
  • Enter a Target Name and Alias. Select the Portal and Initiator Group IDs, and Authentication Group number and click Save at the bottom

  • Next go to iSCSI > Device Extents. Device extents allows an unformatted disk, a zvol, or an existing HAST device to be exported via iSCSi

There are 2 iSCSI extent types called File Extents or Disk Extents. File Extents which allows you to export a portion of a volume by creating a file and using it as a virtual disk. It can take advantage of snapshots and other volume features. Device extents allows entire disks to be exported by iSCSI. Can perform better than file extents in certain situations but the entire disk is exported instead of a piece as in file extents

  • Specify your extent name and the Disk Device should show up as your ZFS Volume which you created earlier in the steps

  • Click Associated Targets
  • Click Add Extent to Target
  • Select your previously created Target and Extent

  •  It is Best Practive to associate extents to targets in a one to one manner although the software will allow multiple extents to be associated to a target
  • Once ISCSI has been configured, in order to access the data on the iSCSI share, clients will need to use iSCSI initiator software. Clients are available for Windows 7/2003/2008 or VMware
  • Log into VMware using the vClient
  • Click on the VMware Host
  • Select Configuration
  • Select Storage Adapters
  • Click on iSCSI Software Adapter
  • Click Properties of the Software iSCSI adapter click General > Configure

Capture

  • Tick Status > Enable
  • Click on Network Configuration

iscsi0

  • Click Add and choose the Management Network

iscsinetwork1

  • Click Dynamic Discovery and click Add
  • Add Send Target Server > iSCSI Server will be the Freenas Server IP

Capture

  • Click CHAP
  • Enter your user ID for the iSCSI user which you set up on your Freenas box as above steps
  • Note: I had to put this to No Chap to get it to work on vSphere 5 iSCSI adaptor settings but try it anyway, you can always change this if needed without changing any of the Freenas settings

Capture

  • A rescan of the HBA will be carried out
  • Go to Storage
  • Click Add Storage

iscsi3

  • Choose Disk/LUN

iscsi4

  • Choose VMFS Version

iscsi5

  • Review the Current Disk Layout

iscsi6

  • Click Next and Enter a Datastore name

iscsi1

  • Click Next

iscsi2

  • Choose Disk/LUN formatting
  • Click Next

iscsi3

  • Review and Finish
  • Test Storage vMotion

If you want to add your iSCSI target as a disk to a Windows Server

http://www.virtuallyimpossible.co.uk/connect-an-iscsi-san-to-server-2008-r2-using-the-microsoft-iscsi-initiator/

 

How to Install FreeNas 8.3.0 on VMware Workstation 8

Setup

This setup is all on my laptop running all virtual machines.

  • VMware Workstation 8
  • One Domain Controller
  • One SQL 2008 Server
  • One VMware vCenter Server
  • 2 x ESXi 5 VMware servers
  • One FreeNas VM (Also called FreeBSD)

Note: This does not work well on IE10. I used Firefox which was fine

What is NAS (Network Access Storage)?

Physically NAS is a hardware device with hard drives, and its accessible via network port.  In production environment there are famous NAS brands, such as

These NAS devices support iSCSI, which is required for cluster and high availability setup for servers.  But for the testing purpose in VMware we can’t have expensing physical NAS devices to configure cluster or high availability servers in VMware. So, there is some free open source NAS software where you can use a computer as NAS. These free storage virtualization software make your computer hard disk as network access storage and allow other clients to access the disk directly through network.

There re two free NAS softwares can be installed in your computer to make a NAS system.

This blog explains how you can install FreeNAS on VMware workstation virtual machine to enable iSCSI target disks. I would avoid using Openfiler if you want to test setting up Windows 2008 and Windows 2008 R2 clusters as Openfiler does not support SCSI-3 persistent reservation disks but FreeNAS supports SCSI-3 persistent reservation disks.

What is FreeNas?

FreeNAS can be used like a physical Network Storage in your physical or virtual environment

FreeNAS is a free network-attached storage server, supporting: CIFS (Samba), FTP, NFS, rsync, AFP protocols, iSCSI, S.M.A.R.T., local user authentication, and software RAID (0,1,5), with a web-based configuration interface. FreeNAS takes less than 64 MB once installed on CompactFlash, hard drive or USB flash drive. FreeNAS is currently distributed as an ISO image and in source form. Through version 7.x, it was possible to run FreeNAS from a Live CD, with the configuration files stored on an MS-DOS-formatted floppy disk or USB thumb drive. There is also a VMware disk image available (Last updated in 2006). With the release of 8.x, Live CD is not currently supported. FreeNas 8.x needs to be installed on a Compact Flash, USB, or dedicated hard drive. Using the dedicated hard drive will use that drive just for the operating system, and files cannot be stored on it.

Instructions

  • First step is to download the software from SourceForge
  • Create a new machine in VMware Workstation
  • Choose FreeBSD or FreeBSD 64 depending on which one you are using

  • Mount the FreeNas ISO
  • Name your VM and choose the location

Capture1

  • Choose the Processors. I left mine at 1

Capture2

  • Set minimum RAM 256 MB, recommended is 512MB memory for VM.

Capture3

  • Next choose your networking setup. I use NAT

Capture4

  • Select I/O Controller Type as LSI Logic

Capture5

  • Create a new Virtual Disk

Capture6

  • Select a Disk Type

Capture7

  • I suggest adding one virtual hard disk of 2GB for the OS

Capture8

  • Check the disk names are correct

Capture9

  • Finish

Capture10

  • Power on the FreeNas VM

  •  Choose Option 1
  • Select the Install Option

  •  Select the virtual hard disk to install in next screen. Press Yes to start

Capture

  • Click Yes

Capture1

  • Once you have successfully installed FreeNAS 0.8 on VMware Workstation and received the following message, click OK to get back to the main menu screen then remove the ISO or attached software.
  • Then reboot

  • After rebooting, you should get to the following page. Choose 1 to Configure Network Interfaces

Capture2

  • Enter the following Details as per below changing to your relevant settings

Capture3

  • Add your extra disks to the FreeBSD VM in VMware Workstation. For example. I want to add 2 x 30GB Disk Drives to be used as iSCSI drives. 1 added so far in the screenprint below

Capture6

  • Log in to FreeNAS via a webpage using http://youripaddress, with root or admin login and freenas password. Note: It may log you in automatically

  • You will land in completely different interface here. It’s totally changed from earlier FreeNAS versions.
  • First thing you have to do is, change the time zone in first screen. Go to System Settings and change the time zone and Web GUI Address to your IP Address

Capture4

  • Go back to your web interface for FreeNas and click Storage. It should look like the below screen-print

Capture5

  • Click View Disks
  • Click Edit
  • I left my 30GB disk as da0
  • Serial Blank
  • Description – Whatever you want
  • HDD Standby – Always On
  • Advanced Power Management – Disabled
  • Acoustic Level – Disabled
  • Enable Smart
  • Smart Extra Options Blank

  • Click Storage
  • Click Volume Manager
  • Type vmware or whatever name you want
  • Select the disk – You have to actually select the disk

  • Click Add Volume and it will run and show you the below screen post completion

Documentation

http://www.freenas.org/images/resources/freenas8.2/freenas8.2_guide.pdf

YouTube Links

http://www.youtube.com/channel/HC0kKk7WONqsw