Technologist

Tech stuff about Cloud, DevOps, SysAdmin, Virtualization, SAN, Hardware, Scripting, Automation and Development

Browsing Posts in Hardware

VMware ESXi can take advantage of Flash/local SSDs in multiple ways:

  • Host swap cache (since 5.0):  ESXi will use part of the an SSD datastore as swap space shared by all VMs.  This means that when there is ESX memory swapping, the ESXi server will use the SSD drives, which is faster than HDD, but still slower than RAM.
  • Virtual SAN (VSAN) (since 5.5 with VSAN licensing): You can combine  the local HDD and local SSD on each host and basically create a distributed storage platform.  I like to think of it as a RAIN(Redundant Array of Independent Nodes).
  • Virtual Flash/vFRC (since 5.5 with Enterprise Plus): With this method the SSD is formatted with VFFS and can be configured as read and write through cache for your VMs, it allows ESXi to locally cache virtual machine read I/O and survives VM migrations as long as the destination ESXi host has Virtual Flash enabled. To be able to use this feature VMs HW version needs to be 10.

Check if the SSD drives were properly detected by ESXi

From vSphere Web Client

Select the ESXi host with Local SSD drives -> Manage -> Storage -> Storage Devices

See if it shows as SSD or Non-SSD, for example:

flash1

 

From CLI:

To enable the SSD option on the SSD drive

At this point you should put your host in maintenance mode because it will need to be rebooted.

If the SSD is not properly detected you need to use storage claim rules to force it to be type SSD. (This is also useful if you want to fake a regular drive to be SSD for testing purposes)

Add a PSA claim rule to mark the device as SSD (if it is not local (e.g. SAN))

For example (in case this was a SAN attached LUN)

 

Add a PSA claim rule to mark the device as Local and SSD at the same time (if the SSD drive is local)

For the device in my example it would be:

Reboot your ESXi host for the changes to take effect.

 

To remove the rule (for whatever reason, including testing and going back)

Once the ESXi server is back online verify that the SSD option is OK

From vSphere Web Client

Select the ESXi host with Local SSD drives -> Manage -> Storage -> Storage Devices

See if it shows as SSD or Non-SSD, for example:

flash2

From CLI:

Exit Maintenance mode.

Do the same on ALL hosts in the cluster.

Configure Virtual Flash

Now that the ESXi server recognize the SSD drives we can enable Virtual Flash.

You need to perform the below steps from the vSphere Web Client on all ESX hosts

ESXi host -> Manage -> Settings -> Virtual Flash -> Virtual Flash Resource Management -> Add Capacity…

flash3

You will see that the SSD device has been formatted using the VFFS filesystem, it can be used to allocate space for virtual flash host swap cache or to configure virtual Flash Read Cache for virtual disks.

flash4

 

Configure Virtual Flash Host Swap

One of the options you have is to use the Flash/SSD as Host Swap Cache, to do this:

ESXi host -> Manage -> Settings -> Virtual Flash -> Virtual Flash Host Swap Cache Configuration -> Edit…

// Enable and select the size of the cache in GB

flash5

 

Configure Flash Read Cache

Flash read cache is configured on a per-vm basis, per vmdk basis. VMs need to be at virtual hardware version 10 in order to use vFRC.

To enable vFRC on a VM’s harddrive:

VM -> Edit Settings -> Expand Hard Disk -> Virtual Flash Read Cache

Enter the size of the cache in GB (e.g. 20)

You can start conservative and increase if needed, I start with 10% of the VMDK size. Below, in the monitor vFRC section, you will see tips to rightsize your cache.

flash6

 

If you click on Advanced, you can configure/change the specific block-size (default is 8k) for the Read Cache, this allows you to optimize the cache for the specific workload the VM is running.

flash7

The default block size is 8k, but you may want to rightsize this based on the application/workload to be able to efficiently use the cache.

If you dont size the block-size of the cache you could potentially be affecting the efficiency of the cache:

  • If the workload has block sizes larger than the configured block-size then you will have increased cache misses.
  • If the workload has block sizes smaller than the configured block-size then you will be wasting precious cache.

Size correctly the block-size of your Cache

To correctly size the block-size of your cache you need to determine the correct I/O length/size for cache block size:

Login to the ESX host running the workload/VM for which you want to enable vFRC

 

Find world ID of each device

 

Start gathering statistics on World ID // Give it some time while it captures statistics

Get the IO length histogram to find the most dominant IO length

You want the IO length for the harddisk you will enable vFRC, in this case scsi0:1

(-c means compressed output)

As you can see, in this specific case,  16383(16k) is the most dominant IO length, and this is what you should use in the Advance options.

flash8

Now you are using a Virtual Flash Read Cache on that VM’s harddisk, which should improve the performance.

Monitor your vFRC

Login to the ESX host running the workload/VM for which you enabled vFRC, in the example below it is a 24GB Cache with 4K block-size:

There is a lot of important information here:
The Cache hit rate shows you the percentage of how much the cache is being used. A high number is better because it means that hits use the cache more frequently.
Other important items are IOPs and latency.

This stats also show information that can help you right size your cache, if you see a high number of cache evictions, Evict->Mean blocks per I/O operation, it could be an indication that your cache size is small or that the block-size of the cache is incorrectly configured.

To calculate available block in the cache, do the following:
SizeOfCache(in bytes) / BlockSizeOfCache(in bytes) = #ofBlocksInvFRC

For the example: A 24GB cache with 4k block-size, will have 6291456 blocks in the vFRC, see:
25769803776
/
4096
=
6291456

 

In the stats above we see 5095521 as the Mean number of cache blocks in use, and no evictions which indicates that 24GB cache with 4k seems to be a correctly sized cache.

Keep monitoring your cache to gain as much performance as you can from your Flash/SSD devices.

I have been playing with my raspberry Pi for a while now, while connected to a TV or a monitor(), but the below guide shows how to connect to its console using a serial cable, this allows me to take it on the road and connect to it from my laptop. Also the serial cable provides power to it so I only need to take my Raspberry Pi and my usb-serial cable (as well as the SD card and WIFI adapter) and I have a complete system on the road.

You will need a usb to serial cable like the: USB to TTL Serial Cable – Debug / Console Cable for Raspberry Pi

I am using my Macbook Air and needed to get the following drives for my usb-serial cable:
http://prolificusa.com/pl-2303hx-drivers/
OR
http://changux.co/osx-installer-to-pl2303-serial-usb-on-osx-lio

Install the drivers and reboot.
Once you plug in your device, open your terminal and you will see the drivers under /dev

Connect the usb-serial cable to the Raspberry Pi like this:
raspberry_pi_console_cable

Ok, now that Raspberry Pi is connected to the usb-serial cable and the this to the computer, let’s start our terminal.

You should see the Raspberry Pi starting up and its console messages:
Raspberry Pi Console

Now you can log in and start using your Raspberry Pi, like when it was connected to a TV (of course on command line mode).
Screen Shot 2013-12-05 at 9.36.02 AM

 

This is guide is for the first steps to get started with the Raspberry Pi, I will be working with the Raspberry Pi Model B (http://www.raspberrypi.org/wp-content/uploads/2011/07/RaspiModelB.png)

OS Config:

The first thing you should do, while waiting for the Raspberry Pi to be shipped is to burn the OS in a SD card. When you get a SD card or any piece of hardware or peripheral for the Raspberry Pi be sure to check http://elinux.org/RPi_VerifiedPeripherals

Download an OS to install on the SD card from http://www.raspberrypi.org/downloads
For this guide I am using Raspbian ‘Wheezy’ – which is based on Debian.

To burn the OS on the SD card, on a Mac:
Insert the SD card and find its devide node:

At this point you should have the OS ready on the SD card, if you will be using a TV with HDMI as the display for your Raspberry Pi, skip the next section(HDMI-VGA Adapter Display + Sound Config), otherwise see the ‘HDMI-VGA Adapter Display + Sound Config’ section for how to configure a non-HDMI display

HDMI-VGA Adapter Display + Sound Config::

The raspberry Pi conveniently comes with an HDMI port and also an RCA video port to allow to use a TV to display its output. That is great, but I wanted to use my PC monitor (or one I had lying around) to play with my raspberry Pi.

For those of you who have older monitors and want to use one, know this:
1) If the monitor has a HDMI port, you are all set
2) If the monitor has DVI, you can buy a HDMI to DVI cable
3) If the monitor has VGA, you CANNOT buy a HDMI to VGA cable. This was my situation and what I wanted to do, I wanted to use a small DELL monitor that only had a VGA port.

So, I needed to buy a HDMI to VGA adapter, there are several out there that look like a regular HDMI to VGA cable and they indeed do work with the raspberry Pi, but keep in mind that it will use power to feed the digital to analog conversion, and power is a scarce resource in the Raspberry Pi.

I am using the following adapter, which comes with external power, from Amazon:
Generic PC DVD HDMI to VGA & Audio For HDTV CRT Video Converter Box Adapter 1080P New

To be able to use a HDMI-VGA adapter, you will need to edit a config file, most likely on another computer because the Pi is not available yet due to display not available.

Put the SD card on another computer and edit config.txt

*** To test sound once the Raspberry Pi starts up, plug in speakes to the HDMI-VGA adapter, then type:

Keyboard/Mouse Config:

The Raspberry Pi comes with 2 USB ports, which will be taken by the keyboard and mouse, but I needed another one for the Wifi. So I got the following keyboard which includes a TouchPad, so I don’t need an extra mouse and works perfectly with the Pi and Raspbian:
Smart Touch Mini USB TouchPad Keyboard

Network (WIFI) Config:

On the other USB port I plugged a Edimax EW-7811Un 150 Mbps Wireless 11n Nano Size USB Adapter which works out of the box with Raspbian. You can use the graphical interface to scan and connect, or edit the config file:

Start Up:

After booting your Raspberry Pi you will see a menu, the important things to do are:
1. Expand Filesystem so that the whole SD card is available
2. Change User Password
3. Enable Boot to Desktop – THIS DEPENDS IF YOU THINK YOU WILL BE USING THE DESKTOP MOST OF THE TIME, otherwise dont enable it, and know that from the command line you can start the graphical environment by executing ‘startx’
4. Internationalisation Options
I1 Change Locale – Change to en_US.UTF-8
I2 Change Timezone – US/Eastern
I3 Change Keyboard Layout – English (US)

8. Advanced Options
A2 Hostname
A4 SSH – if you need to enable SSH

Select

// If later you want to go back to this menu, from a terminal type: ‘raspi-config’

You will be left in a command prompt, you can type startx and you will be taken to the graphical interface

That is it, you are all set, enjoy your Raspberry Pi

For a while now, I have been playing with the Soekris SingleBoard Computers (SBCs), they are compact, low-power, low-cost, advanced communication computers based on an up to 500 Mhz 586 class processor. In this particular model 5501, I installed ubunuty JeOS, and it has been my always on computer for a while.

Boot the Soekris while connected via serial. I am using my Macbook Air and needed to get the following drives for my usb-serial cable:
http://prolificusa.com/pl-2303hx-drivers/

Install the drivers and reboot.
Once you plug in your device you will see it under /dev

I had previously configured my soekris to have console speed of 57600 (default baud rate is 19200)

When connecting via console to a device, I usually prefer to use minicom, but you alternatives:

But in this case, because I will be using XMODEM to transfer the bios image I downloaded from Soekris I will use ‘cu’

Download the latest BIOS from soekris’ website:
http://soekris.com/downloads.html

Connect to the serial using ‘cu’

// It will show you the BIOS version, in this case 1.32
// If the below does not show, it is very likely that you need to set ConMute=Disabled, after pressing Ctrl+P to get to the Menu

// Enter Ctrl+P to get to the menu

// Now update the flash with the downloaded image:

// That’s it not reboot and you will see the new version