Friday, December 20, 2013


Innovation
Occasionally in my business dealings I come across an individual with exceptional talent and innovation. +Mark King  is one of those people.  You have got to check out his Ted Talk Below where he talks about building an electric car while in High School.

 It’s this level of motivation to get out there and make something that I fear we are losing in this country.  I have made it my goals as a public school worker to inspire young people to accomplish extravagant goals and to set high expectations.



I have also joined with Mark in promoting his newest project (The Trayvax Wallet for life).  I would encourage everyone to visit his website at http://trayvax.com and pick up a wallet.  These wallets not only amazing but they go to the bigger cause of helping to fund his not-for-profit venture “Water Core”.  Mark building a product that will help distribute clean and healthy water to Africa and other countries that don’t have access to this precious resource that we take advantage of.
Thanks for reading, and hey GET OUT THERE AND MAKE SOMETHING!

-Michael




Tuesday, December 17, 2013

Arduino Christmas lights

Arduino Lights to Music

Intro

This will show you how to build a lights-to-music controller using an “Ardunio” micro-controller.  You will need a windows computer to run “Vixen” the free software program to make the lights turn off and on, and you will need either a PC or a Mac to run the Arduino programing program.

Here’s what you need (Basic Design)




LED Lights $7.89 for 60 (make sure they come with resistors)
http://www.amazon.com/gp/product/B004UZDKRG/ref=oh_details_o00_s01_i00


Basic Circuit Design

1.    Connect your power wire to the “Anode” side of the LED
2.    Connect your “Cathode” side of the LED to one side of a “Resistor”
3.    Connect the other side of the “Resistor” to the ground wire.
This will complete the circuit and let turn the LED on.  For our project the Power wire will be one of the pin outputs from the arduino (labeled 2 – 13 on the side of the board”

 

Circuit with Arduino

1.    Each pin on the board (2-13) connect to a strip on the board
2.    Each strip then plugs into the Anode of its own LED
3.    Each LED cathode plugs into a strip on the opposite side of the breadboard
4.    That strip is then connected to an adjacent strip on the breadboard by a resistor
5.    The strip on the resistor side then connects to a common ground “BUS” at the bottom of the breadboard
6.    On the right side of the breadboard use a wire to connect the top ground “Bus” to the bottom ground “Bus” as indicated by the green wire on the image below.
7.    Now on the Ardunio you will see a pin near the top that says Gnd.  Make sure this is connected to your ground bus.
Once all LEDs are wired in you are ready to program your ardunio.
This will complete the circuit and let turn the LED on.  For our project the Power wire will be one of the pin outputs from the arduino (labeled 2 – 13 on the side of

Basic Program

To make an Ardunio work you must program it.  To do this we must use the Ardunio programing software.  You can download it from: http://arduino.cc/en/Main/Software
This software will work on both PC and Mac
After downloading your software use a USB cable and plug the Arduino into the computer and start the programming software program.
Under the tools menu you will need to select the device you are using.  In this document we are selecting the “Arduino Uno”

Now you will need to select the port so the computer knows where to find the Arduino.  On a windows machine this will typically be something like “Com 3, Com 4 ect…”, on a Mac it will look like /dev/tty.USB  (don’t use Bluetooth as indicated below because the Arduino does not have a Bluetooth connector).

Now for the code

All arduino code has at least 3 sections
1.    Top of code (you define what things are)
2.    Setup(). The code in setup() is run first always
3.    Loop().  The loop code is where your program runs
In any of the code below, if you see // that means it is a comment and the code will not do anything with that text.  We use this to describe what is happening in each section without messing up our programming code.

Simple code to turn 3 lights on and then off.



Int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
void setup(){
    Serial.begin(9600);
        pinMode(pin2, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin2, 0); // Turn pin 2 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin2, 255); // Turn Pin 2 off and make the light go off
      //Do the same thing with Pin 3
       pinMode(pin3, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin3, 0); // Turn pin 3 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin3, 255); // Turn Pin 3 off and make the light go off
//Do the same thing with Pin 4
       pinMode(pin4, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin4, 0); // Turn pin 3 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin4, 255); // Turn Pin 3 off and make the light go off
}
void loop()
{
Make light 1 blink 2 times
        pinMode(pin2, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin2, 0); // Turn pin 2 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin2, 255); // Turn Pin 2 off and make the light go off
        pinMode(pin2, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin2, 0); // Turn pin 2 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin2, 255); // Turn Pin 2 off and make the light go off
      //make light 3 blink once
        pinMode(pin3, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin3, 0); // Turn pin 3 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin3, 255); // Turn Pin 3 off and make the light go off
       //make light 4 blink twice
        pinMode(pin4, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin4, 0); // Turn pin 3 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin4, 255); // Turn Pin 3 off and make the light go off
        pinMode(pin4, OUTPUT); //Tell what kind of pin this is, We want OUTPUT
        analogWrite(pin4, 0); // Turn pin 3 on and make it light up
        delay(250); // wait for ¼ of a second ( 1000 is 1 second)
        analogWrite(pin4, 255); // Turn Pin 3 off and make the light go off
}

Send the code to the Arduino

Once we have written our code we need to verify it. In order to do that just click the check box in the top left, if there are no errors then click the little arrow next to the checkbox jnext to the arrow.  If everything looks right your lights should start blinking.

VIXEN LIGHTS

I will do another blog on vixen lights and provide refined code for doing that project, but you should understand the concepts in this post before moving on to that.  Until then if you are interested in pursuing this further you may want to download Vixen at http://vixenlights.com Cheers

Virtual Servers - 3

Intro

This blog has a lot of information.  Please note that it is not "All inclusive" but rather a guideline.  If you feel I have left something out and would like me to modify it to reflect "more accurate" information please leave me a comment and I will update as needed.  I am working through this process for the first time so I hope we can all learn together!     

Setting up PowerConnect 6224 Switches

Console setup

Connect your console cable and use putty or some other terminal program to console in using the same configuration ans the EqualLogic putty settings below.

Once you have setup the ip address on the switch you need to decide how you would like to stack them. You can use LAG port aggregation or the stacking module on the back of the switch if its available.

I chose Link aggregation and rather than re-inventing the wheel here is a great document on dell on how to do that

Commands

enable
configure
ip address 192.168.0.xxx 255.255.255.0
username somenamehere password somepasswordhere

Setting up EqualLogic

Remote Setup Tools

 The EqualLogic SAN comes with a remote install configuration utility on a disk provided by Dell.  You don't need this but it can make the process of setting up the switch easier if you choose not to use console with putty or some other terminal program.  In order to run this you must install the .net framework or you will get an error during setup.  This can be done in the "Add / Remove features" inside of the server.  To quickly get there just select it as an option in the top right of server manager.

NOTE:  You should download this tool from Dell directly as the disk may be outdated as was in my case.  I kept getting an error when installing and found that the version I was trying to install off the disk was not supported in Server 2012.

Config via Serial using Putty

First you will need to connect your Dell provided serial plug (DB9) to the active controller.  The PS4100E has two controllers on board and they run in an "Active/Passive" state.  The active controller will have a green light on the "AC1" LED on the back of  the SAN.  You will need to make sure your DB9 plug is put into that serial port and not the passive one.

I use putty to establish serial, ssh, and telnet sessions because it rocks!  Just set it up exactly like the following screenshots from my config:



Once you are in you will need the default username and password:
LOGIN: grpadmin
PASSWORD: grpadmin

Here are some example settings you will need to configure, you may change the IP address to anything you need.  Keep in mind the 10.x.x.x addresses below represent my primary LAN and the 192.168.x.x addresses are the VM only network managed off my dell switches.
Group Name: SAN0
Group IP and mask (iSCSI): 192.168.0.100/24
Management Network IP and mask: 10.x.x.x/24

1st Member Name: PS4100E0
iSCSI traffic (Eth0): 192.168.0.101/24
iSCSI traffic (Eth1): 192.168.0.102/24
Management Port IP (Eth2): 10.x.x.x/24
2nd Member... (reserved for future)
iSCSI traffic (Eth0): 192.168.0.111/24
iSCSI traffic (Eth1): 192.168.0.112/24
Management Port IP (Eth1): 10.x.x.x/24

Manage SAN Array

Once you have  your SAN configured and connected to your switches and your switches configured and stacked then you should be able to access the management interface on the SAN from any computer on your network.  Keep in mind that the management interface (Eth2) on the SAN is going to your primary network, so based of the schema above it will be pulling a 10.x.x.x address.

You will need to make sure that the java version you have is supported by EqualLogic.  At the time of this blog Java 7.x was released but EqualLogic only supports java 6.x build 25.  To make sure you have the correct java version and build you should uninstall java on the machine you will be accessing any EqualLogic tools and then in your browser access the management network IP address ie, http://10.x.x.x this will prompt you to install the correct java version.

Once you have the correct java version you will be prompted for a username and password.  This will be whatever username and password you created via command line or the remote setup on the Dell Disk.  When you gain access to the SAN you will see this page:
I won't be going over all the details of all the options at this time (maybe a future blog) but essentially you can create new volumes here (under the volumes tab).  To my understanding it is better to have many smaller volumes than one bit volume.   I started my build with 4 250 gb volumes and have roome for 12 mor of the same size.
NOTE:  Never let your available volume space drop below 10% or you will have a huge performance hit.


After clicking on the volumes option within the SAN you will see something like the image below (if you have created volumes.


Double clicking on one of the volumes brings up information about that volume
Clicking on the access tab will show what servers have an active connection to this volume.  These connections are added manually with the following process.
  •  First go to the control panel on your server
  • Select the iscsi Initiator
  • Next click on the configuration tab and copy the Initiator Name.  This is your iqn and needs to be added to each volume you want to be accessible on the server.
  • Under the "Access" tab on the EqualLogic you will see a screen like the following.  You can click "Add" in the top right and add your iqn to this volume here.
  • Once this is added you will be able to go into your server and the volume should be available as a mountable drive in Disk Management.  If not you may need to check your iSCSI initiator settings to make sure its connecting correctly.  You should use "Quick Format" and you are ready to go.

Other Conisderations

install latest 4.5 HIT (*tool kit) so you can enable MPIO

Make sure you set all the NIC addresses correctly on the windows server for you VM Lan

If on EqualLogic make sure MPOI is installed on every server you are clustering and make sure each host has a static IP address in the  SAN network for ISCSI

Virtual Servers - 2

INTRO

This is the actual setup and install of the 3 Dell servers some terminology used may only apply to the Dell products listed in my Virtual Servers - 1 post.

SERVER SETUP

 Port setup and configuration:

  • 1 Ethernet port needs to be set as the DRAC (Dell Remote Access Controller).  This will serve as a remote management port for troubleshooting the server.  This can be setup in the bios upon system book.  Essentially you just choose which port will be the DRAC and then connect it to your primary switch.
  • 1 Ethernet port is needed to serve as the primary connection to the network
  • all remaining ports (6) are plugged into the switches.  I will be staggering them 3 on one switch and 3 on the other.

 Server install and setup

Installing server 2012 Data-center is a little different than 2008 R2 so I may have to go back and adjust this post.  During the install you have 2 options, Core mode or GUI mode.  I chose to set them all up in GUI mode because it can be removed at any time and it makes the setup process much easier.

After installing server 2012 I went into "network adapter properties and renamed all my adapters so I was familiar with which one it was and what port on the switch it went to.  For example:


  • Primary Switch 22
  • VM Switch 3
  • VM Switch4
  • iDRAC
Now that I know what each port is go into "Server Manager".  Under local machine you will see an option to turn on NIC Teaming   You will want to turn this on and then team your two data NICs and name is something you are familiar with like "Primary" or "Data".  For more info see this article from Microsoft
Do the same setup above for every server and then decide which server you want to be the management server.  The other two servers in the cluster will work as the primary VM servers, pooling their resources and creating redundancy for the system while the management server will manage infrastructure and if absolutely necessary be a fallback if the other two fail.

Here is a few screenshots on the NIC teaming process:

NIC Teaming is disabled by default. When you open it you can click on TASKS to add NICs to a team

First Select "New Team"
Select the NICs you want to be in that team and you are done!  I set a static IP address for my team "PRIMARY SWITCH"


Setting up Management

I love how easy managing servers is in server 2012.  Rite from the start you can add other servers directly into the management preferences and assign them into logical groups.




WIRING CONFIGURATION

While the way the system is wired is to some degree a matter of preference, I chose the following configuration for my servers.  From here on out "Primary Switch" refers to my switch array for the LAN that all servers are connected to, and "VM Switch" as the 2 switches that are between the VM servers and SAS controller.
  • 1 Ethernet cable from each server going into a management VLAN on my primary network
  • 2 Ethernet cables from each server going into my primary switch as my data interface.  I will be utilizing NIC Teaming
  • 2 Ethernet cables into VM Switch 1 on every server
  • 2 Ethernet cables into VMSwitch 2 on every server
  • 1 Ethernet port on each server is currently left empty as a backup
As indicated in the diagram below:

Virtual Servers - 1

Virtual environments have intrigued me for the last 5 - 7 years so I decided to look into virtualizing servers.  This turned out to be a much more difficult choice than I first anticipated.  Many factors had to be considered including but not limited to:

  • Server Provider
  • SAN provider
  • In-Lin SAS drives vs standard SAS drives
  • Number of switches to use and what type
  • and the BIG one vmWare or the new Hyper-v 2012
With much deliberation and hours of conversations with vmWare and Microsoft coupled with extensive communication with people already using those products, I ultimately chose the Hyper-V option.  I honestly just could not get past the "free" part, and the advancements made by Microsoft are so phenomenal I just could not see vmWare being worth the price tag.  
Before I go on let me say that this is not a cheap project by any means, but I believe in the long run I will see a great amount of savings and my server room will be much more efficient.  With quotes from many vendors including HP, Lenovo, and Dell, we ultimately decided on Dell.  Here are the specs:
Three PowerEdge 520s
  • 64gb Ram
  • 3 1500 RPM SAS drives  
  • 3 licenses of Microsoft Server Datacenter 2012
  • 8 NIC cards
Two PowerConnect 6224 L3 switches (you have to have switches that support jumbo frames
One Dell EqualLogic PS4100


This is a great entry level system but has a price of around $38,000.  I would say the week link here is the EqualLogic.  While I am happy with the purchse and I feel it will meet and exceed my needs for about 20 - 50 virtual servers, it is an in-line SAS which basically means industry standard SATA drives running on a SAS controller.  This gives you the benefits of SAS with standard 7200 RPM SATA drives.  While they will out perform standard SATA arrays, it will not meet the standards of SAS and this needs to be a primary consideration when looking into VMs.  Another option we considered was the NETAPP FAS2220A which has wonderful reviews and great performance.  

Why all the servers and switches?

When running VM servers over a hypervisor like vmWare or Hyper-V you need to have redundancy.  Ideally my system will use the resources from 2 servers and have the 3rd pop in if either 1 or both the other servers ever go down.  I also have each server splitting their power connections between various APC battery backups.  The Servers each have 8 NICs, 6 of these ports will be used to transfer data between the SAS controller and the 3 servers.  1 port will be used for management and the final one will be used to gain primary network access.  I have two switches for the same reason.  All network ports on the servers and SAS controller are split between the two switches, and each switch is on a different battery backup system.  This lets everything stay running even if one switch goes down which is very nice.  Lastly my SAN has two SAS controllers built in that are in an ACTIVE / PASSIVE state which means the first one to get power will be active and the second one to get power will remain passive unless the first one goes off.  Again each of these controllers are wired to their APC.  It is very important that you have extreme redundancy when working with VMs because you don't want a single point of failure anywhere in the system.
This should be an interesting process and I will either add to this post or make a new post as I work through this, feel free to ask questions or express concerned about this process.  I hope we can all learn something through it!
-Michael