Showing posts with label OpenIndiana. Show all posts
Showing posts with label OpenIndiana. Show all posts

2012-06-19

OpenIndiana Installation walkthrough - Part 4

This is Part 4 of a series of posts explaining how to configure OpenIndiana as NAS storage device. The series is made up of the following parts:

  • Background information about OpenIndiana and OS installation
  • Network configuration and Setting up storage
  • Presenting storage to your Hosts with iSCSI and/or NFS
  • Performance testing

    Today we will go into the performance I was able to get out of the OpenIndiana appliance that I have installed.

    But first a small bit of detail around the hardware setup this is actually running on.

    This a lab – therefore the setup is not optimal.

    I am using an HP DC7800 PC for an ESXi imagehost. The PC can hold 4 SATA devices and up to 8GB of RAM.
    I also have 2 hard disks in the Host – 1 Western Digital Caviar Blue WD2500AAKS 250GB 7200 RPM 16MB Cache SATA 3.0Gb/s 3.5" where I have ESX installed and use as a local storage, and also 1 Intel® Solid-State Drive 520 Series – 180GB. And on this drive I have installed OpenIndiana. 




    The setup was identical to the walkthrough from the previous stages, with some exceptions.

    The VM has 10 VMDK’s attached to it – each 15GB in size and they are all connected to a separate SCSI adapter (SCSI1).

    image

    I then created a RAIDZ1 volume of all of these disks and presented this as both NFS and iSCSI storage.

    root@nas1:~# zpool list -v
    NAME          SIZE  ALLOC   FREE  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
    disk1         146G  66.1G  79.9G         -    45%  1.00x  ONLINE  -
      raidz1      146G  66.1G  79.9G         -
        c4t0d0       -      -      -         -
        c4t1d0       -      -      -         -
        c4t2d0       -      -      -         -
        c4t3d0       -      -      -         -
        c4t4d0       -      -      -         -
        c4t5d0       -      -      -         -
        c4t6d0       -      -      -         -
        c4t8d0       -      -      -         -
        c4t9d0       -      -      -         -
        c4t10d0      -      -      -         -

    root@nas1:~# zfs list
    NAME                       USED  AVAIL  REFER  MOUNTPOINT
    disk1                      103G  25.1G  51.9K  /disk1
    disk1/iscsi_1              103G  69.4G  58.8G  -
    disk1/nfs_1                317M  25.1G   317M  /disk1/nfs_1
    rpool                     6.30G  5.45G  45.5K  /rpool
    rpool/ROOT                3.20G  5.45G    31K  legacy
    rpool/ROOT/openindiana    10.6M  5.45G  1.95G  /
    rpool/ROOT/openindiana-1   816M  5.45G  1.87G  /
    rpool/ROOT/openindiana-2  2.39G  5.45G  1.96G  /
    rpool/dump                1.50G  5.45G  1.50G  -

    OpenIndiana has 3 NICs (eth0-2) where eth1 & eth2 are used for iSCSI traffic and eth2 is used for NFS traffic (the reason being I wanted to check the multipathing options)

    The Openindiana VM was configured with two configurations. 2GB RAM and 4GB RAM. The test I performed was Max IOPs (512b block 0% Random – 100% Read) from VMware’s I/O Analyzer 1.1.

    The tests were done on:

  • Native SSD (not through OpenIndiana)
  • iSCSI LUN
  • NFS mount

    And here are the results


    Native SSD


    Maximum IOPs 9,364.23 with ~2.6 ms latency

    image

    image

    image

    msaidelk-esx2-vmhba0-iopsmsaidelk-esx2-vmhba0-latencymsaidelk-esx2-vmhba0-throughput


    NFS

    Maximum IOPs 9,364.23 with ~2.6 ms latency

    image

    image

    image

    The interesting thing you may notice here about the last graphic – is that the NFS disk is actually pushing a large amount of IO requests but the underlying physical disk is actually not really working very hard.image

    Memory\Kernel MBytes913
    Memory\NonKernel MBytes2461
    Group Cpu(416665:nas2)\% Used64.2
    Network Port(vSwitch2:50331656:vmk3)\MBits Received/sec85.5

    iSCSI

    Maximum IOPs 14,331 with ~1.3 ms latency

    image

    image

    image

    msaidelk-esx2-vmhba0-iopsmsaidelk-esx2-vmhba0-latencymsaidelk-esx2-vmhba0-throughputmsaidelk-esx2-vmhba33-iopsmsaidelk-esx2-vmhba33-latencymsaidelk-esx2-vmhba33-throughput

    Again note the actual IO to the SSD

    image

    The numbers are quite impressive as you can see.

    What I learned from this:

    1. NFS/iSCSI performance was very much the same – besides the fact the NFS put a much higher load on the OpenIndiana server than iSCSI did (something like 60 times more CPU usage!)
    2. The performance achieved through OpenIndiana was higher than native disk – due to the fact that OpenIndiana makes use of RAM as a caching mechanism.

    My apologies for the delay in the last part of this series.

  • 2012-05-15

    OpenIndiana Installation walkthrough - Part 3

    This is Part 3 of a series of posts explaining how to configure OpenIndiana as NAS storage device. The series is made up of the following parts:
    1. Background information about OpenIndiana and OS installation
    2. Network configuration and Setting up storage
    3. Presenting storage to your hosts with iSCSI and/or NFS
    4. Performance testing
    At the end of Part 2 we had the network set up, VMware Tools installed, additional disk space added to the VM, and a zpool created.
    What we will go through in this part is:
    1. Configuring NFS and iSCSI services
    2. Creating a Volume for iSCSI
    3. Create an NFS folder
    4. Create a LUN and share it with an iSCSI
    5. Export NFS Volume and set export parameters
    6. Mount NFS and iSCSI storage
    So first we need to turn on the iSCSI and NFS services. NFS is just to start a service, iSCSI has a bit more to it.
    svcadm enable -r iscsi/target:default
    svcadm enable network/nfs/status

    enable iscsi and nfs
    Now we create the target with
    itadm create-target
    You can check the status with
    itadm list-target
    create target
    Create the volume and the NFS folder (I will create a small 2GB Volume) and then query for status

    zfs create -V 2G disk1/iscsi_1
    zfs create disk1/nfs_1

    create volumes
    zfs list
    list volumes
    Here you can see disk1 is 5GB (USED+AVAIL), disk1/iscsi_1 is 2GB is size (thin provisioned) and the disk1/nfs_1 has 3GB space left in total
    Now we create the iSCSI LUN with
    sbdadm create-lu /dev/zvol/rdsk/disk1/iscsi_1

    and add it to the masking of the iSCSI initiator with the GUID that was just created
    stmfadm add-view 600144f0ccf40a0000004fb114700002
    Just to check that all is set correctly list the LUNs
    stmfadm list-lu

    List the masking
    stmfadm list-view -l 600144F0CCF40A0000004FB114700002
    iSCSI LUN
    One last thin left to do is to set the NFS export permissions with the following (you will need either the FQDN of the host or the correct IP for the export permissions)
    zfs set sharenfs=on disk1/nfs_1
    zfs set sharenfs=root=msaidelk-esx.maishsk.local disk1/nfs_1
    zfs get mountpoint,sharenfs disk1/nfs_1

    NFS shares
    And that is it – the storage configuration is complete.
    Now we go over to the ESX and mount the storage.
    First the iSCSI volume
    Add target
    After a rescan of the adapter I now have a new 2GB LUN
    New LUN
    On to NFS.
    Add NFS
    We now have a new NFS storage mount
    New NFS
    There you have it a fully working storage appliance on OpenIndiana.
    In Part 4 I will show some Performance statistics I am getting out of this VM.

    2012-05-14

    OpenIndiana Installation walkthrough - Part 2

    This is Part 2 of a series of posts explaining how to configure OpenIndiana as NAS storage device. The series is made up of the following parts:
    1. Background information about OpenIndiana and OS installation
    2. Network configuration and Setting up storage
    3. Presenting storage to your Hosts with iSCSI and/or NFS
    4. Performance testing
    We ended Part 1 with a newly installed OS and a login screen. Now it is time to configure and start to use the OS.
    I found the configuration a good learning process. I do not call myself a Linux Expert, but I do know my way around most Linux Distributions, but OpenSolaris – is not one that I have ever played with – so there was a steep learning curve involved until I found the information I needed, and collected here in this post.
    So.. What are we going to do in this part?
    1. Install VMware Tools (so we that the VMXNET3 adapter will be recognized)
    2. Configure networking
    3. Allow SSH to OpenIndiana
    4. Add virtual storage to OpenIndiana and create a ZPool
    Login to the OS with the user you created in the precious part and then su – to root user.
    Login
    First things first – is install VMware Tools – otherwise we cannot configure the network. From the vSphere console mount the VMware Tools ISO in the guest. Extract the tarball and install Vmware Tools with
    tar zxvf /media/VMware\ Tools/vmware-solaris-tools.tar.gz and then
    ./vmware-tools-distrib/vmware-install.pl --default
    Untar VMware Toolsinstall tools
    Here is where I hit my first snag. The tools would not configure properly – I was presented with a error like the one below
    VMware Tools Error
    The solution that I found to solve this was to create the file that it was complaining about
    touch /usr/lib/vmware-tools/configurator/XFree86-3/XF86_VMware
    After that VMware Tools installation and configuration went smoothly.
    A reboot is now needed.
    The commands in OpenIndiana are quite different from any other linux distribution. To check which network card(s) are installed in the system use the dladm command (in my VM there are two).
    dladm
    As you can see the NICs have strange names. I felt more comfortable using the a naming convention like all other Linux distributions and changes the name of the links – with the syntax below.
    dladm rename-link vmxnet3s0 eth0
    rename link
    The interface by default does not receive its IP from DHCP – in fact from I saw it is not even active. In order to set the NIC to receive it’s IP from DHCP this needs to be configured with the ipadm command.
    ipadm create-addr –T dhcp eth0/v4dhcp
    configure dhcp
    To see what IP was assigned to the VM.
    ipadm show-addr eth0/v4dhcp
    If you have no DHCP on the subnet and would like to configure a static IP for the interface
    ipadm create-addr -T static -a local=192.168.168.5/24 eth0/v4addr
    Working in a console session is not as convenient as a remote putty session to the VM – and here I hit snag #2. I was presented with an error:
    "Error connecting SSH tunnel: Incompatible ssh server (no acceptable ciphers)".
     ssh error
    This post led me to the solution for this problem. 
    Add this into the /etc/ssh/sshd_conf on the VM and restart the ssh service (service sshd restart does not work!!)
    Ciphers aes128-cbc,blowfish-cbc,aes256-cbc,3des-cbc
    and then svcadm restart ssh

    Setting up DNS is also not so bad.
    Create the resolv.conf file with vim /etc/resolv.conf and put in the domain suffix and your DNS server IP
    resolv.conf
    Then configure the nsswitch.conf file so that the resolution will be done through DNS.
    cp /etc/nsswitch.dns /etc/nsswitch.conf
    You can check that you resolution is working with
    ping google
    Now it is time to update the OS with pkg
    I thought similar to apt-get (which it is) I would run pkg update but I was returned an error.
    pkg update error
    First you will need to update the pkg package itself with pfexec pkg install pkg:/package/pkg
    Which will update the package itself and then you can run a OS update
    Update pkg package
    pkg update
    We will install one addition package as well for iSCSI for later.
    pkg install iscsi/target
    iscsi/target
    Now we have an updated system, and it is time to add some storage to the VM (for the sake of this tutorial I only added a 5GB disk). Power off the OS.
    poweroff
    Add a new Hard disk, 5 GB Thick Lazy Zero to a new SCSI adapter and power on the machine.
    Adddisk
    ThickNew SCSI adapter
    Finished
    First we will find the name of the disk that was added.
    cfgadm -la 2> /dev/null
    list disks
    c3t0d0 is the first disk where the OS is installed and the new that was added is c4t0d0 – this is the one we will use.
    First we need to create a zpool, but what is a zpool you may ask?
    Storage pools
    Unlike traditional file systems, which reside on single devices and thus require a volume manager to use more than one device, ZFS filesystems are built on top of virtual storage pools called zpools. A zpool is constructed of virtual devices (vdevs), which are themselves constructed of block devices: files, hard drive partitions, or entire drives, with the last being the recommended usage. Block devices within a vdev may be configured in different ways, depending on needs and space available: non-redundantly (similar to RAID 0), as a mirror (RAID 1) of two or more devices, as a RAID-Z (similar to RAID-5) group of three or more devices, or as a RAID-Z2 (similar to RAID-6) group of four or more devices.
    Thus, a zpool (ZFS storage pool) is vaguely similar to a computer's RAM. The total RAM pool capacity depends on the number of RAM memory sticks and the size of each stick. Likewise, a zpool consists of one or more vdevs. Each vdev can be viewed as a group of hard disks (or partitions, or files, etc.). Each vdev should have redundancy because if a vdev is lost, then the whole zpool is lost. Thus, each vdev should be configured as RAID-Z1, RAID-Z2, mirror, etc. It is not possible to change the number of drives in an existing vdev (Block Pointer Rewrite will allow this, and also allow defragmentation), but it is always possible to increase storage capacity by adding a new vdev to a zpool. It is possible to swap a drive to a larger drive and resilver (repair) the zpool. If this procedure is repeated for every disk in a vdev, then the zpool will grow in capacity when the last drive is resilvered. A vdev will have the same capacity as the smallest drive in the group. For instance, a vdev consisting of three 500 GB and one 700 GB drive, will have a capacity of 4 x 500 GB.
    In addition, pools can have hot spares to compensate for failing disks. When mirroring, block devices can be grouped according to physical chassis, so that the filesystem can continue in the case of the failure of an entire chassis.
    Storage pool composition is not limited to similar devices but can consist of ad-hoc, heterogeneous collections of devices, which ZFS seamlessly pools together, subsequently doling out space to diverse filesystems as needed. Arbitrary storage device types can be added to existing pools to expand their size at any time.
    The storage capacity of all vdevs is available to all of the file system instances in the zpool. A quota can be set to limit the amount of space a file system instance can occupy, and a reservation can be set to guarantee that space will be available to a file system instance.
    (Source: Wikipedia)
    If you would ask me to summarize this in my own words – a zpool is a group of one or more disks that can make up a disk volume. So lets create the first zpool
    zpool create disk1 c4t0d0
    create zpool
    and check that it succeeded  with zpool status disk1
    zpool status
    That is the end of Part 2 – next up is how you can present storage to your Hosts with iSCSI and/or NFS.