Update ESXi 5.0 to 5.1

Today I will writing about running an update for ESX 5.0 to ESX 5.1 using nothing but the update file and some storage.

Issue: ESXi 5.0 is out of date and does not support Windows 8.
3-25-2013 8-24-02 AM

Solution: We update ESXi 5.0-5.1

First we need to download the update files for ESXi you can find the latest version at: http://www.vmware.com/patchmgr/findPatch.portal 

At the time of this article it was ESXi510-201210001.zip

We need to download this file and get it somewhere the ESX host can see it. For example I am going to use NAS1 as my device that holds the datastore, altrnatively you can plug in a USB stick and mount it or burn the ISO VMware provides however this is the fastest method.

Once you have copied the ESXi510-201210001.zip file to the datastore do not unzip it keep it in the .ZIP format. We need to quickly enable SSH on the ESX box. This can create a security hole so we will not run the server automatically we will run it until the server reboots. This is perfect as we need to reboot the server when we are done anyways.

3-25-2013 8-22-24 AMTo do this go to the Configuration tab, choose the Security Profile button under Software. Now you will see a properties option. Select it and a new window will appear.




3-25-2013 8-23-48 AMYou will see SSH Stopped , double click it and a new window will open. Select Start and Stop with host then click START.




Now we need to download Putty and connect to the host. You can  grab a  copy of putty from here if you dont already have it. Now that you have putty open it up and type in the IP address of the ESXi server. For this example we will use the port will automatically be added.

3-25-2013 8-01-31 AMYou will be prompted for your username and password. The username is commonly root and the password you would have set when installing ESXi. Once logged in lets verify that the update is in the datastore NAS1. ESXi has all the mounted datastores in a folder called vmfs. Just keep using the LS command until you find the folder that contains the update. Here you can see NAS1 under the VMFS folder keep going deeper until you see the ESXi510-201210001.zip file.

Here it is! /vmfs/volumes/NAS1/ESXi510-201210001.zip
/!\ It is important that you dont change directory into the folder that the update resides in. If you attempt to call the update from within the folder and not the full path then it will spit out a error like this. 

3-25-2013 8-04-45 AM



This is  because  you have called the file without putting in the full /vmfs/volumes/…/…/ESXi510-201210001.zip path. Incase you are confused here are two examples:

WRONG: 3-25-2013 8-02-29 AM
CORRECT!3-25-2013 8-06-32 AM

Now we need to call the update with the update command:
esxcli software vib install -d /vmfs/volumes/[DATASTORE]/[PATCH_FILE].zip

3-25-2013 8-20-51 AM

You will now see nothing for a few seconds but if you check back in about 1-2 min you will see the update applying. When your update is done you will see something  similar  to this:



Good job! We simply need to restart the host from putty or from vCenter itself. After restarting the host you will see that it clearly has updated!

3-25-2013 8-27-39 AMNow you can get to running Windows 8 and Server2012 on ESXi 5.1!

Creating Event ID’s Manually

If you have ever needed to test a monitoring system like Overseer that monitors Event ID’s in the system log then this article is for you.

Say for example you set up a monitoring system to look for low disk space, or attacks on your  database. These kinds of alters might be hard to set up since you would need the event to actually occur before it will show up in the event viewer. So how can you test low disk space without actually causing your fileserver to come to a griding halt?

Issue – I need to create a event ID  without  actually creating an the issue that would normally generate the ID.

Solution – Open up a new command line (Start > CMD).
Then type the following text into the command line, dont worry Ill explain it in a seconds just dont hit eneter yet.

EventCreate /S HOSTNAME /ID 18456 /L Application /SO TestHacker /T Information /D “The quick brown fox jumps over the lazy dog”

Ok now lets take a look and see what we have here.
EventCreate – this is the windows function we are calling.
/S – this tells the command that we want to create a event on a remote computer, if you want to create the event on the computer your logged onto right friggin now, dont put this in.
HOSTNAME – this is going to be the server name or IP address that you want the event created on.
/ID 18456 – fill in the EventID number you want to create.
Application – this states that the event will be created by an application not the system.
/SO TestHacker – this is the source name
/T Information– This is the type of the event, there are 4 levels Warning, Error, Information,
/D – This is the text that the event ID will contain.

And there you have it!

Enable Administrative C$ Shares on Windows 8

With every new OS there will be new challenges, and Windows 8 is no exception. For example in windows you can commonly access the files on a PC (provided you have the authority) by simply typing the hostname and the disk letter followed by a $. I have outlined an example below:

3-6-2013 3-11-46 PM\\hostname\c$
You get the point, well in Windows 8 these are disabled by default, I know right. So instead of setting up your shares again lets just re-enable it really quickly!


Issue – Unable to connect to Windows 8 C$ shares

Solution – First of all you will need to be an  administrator  to access the registry.
On the computer you want to add the shares to start a new notepad document and paste in the following information:

Windows Registry Editor Version 5.00


Now click File > Save As > Enable Shares.REG 
Now that you have saved the file simply run it to add it to the registry, you may need to reboot before it takes effect but from here on you will be able to access the shares.





Using Powershell to manage Data Deduplication | Server 2012 and Windows 8

Here is a quick guide on how to quickly check how well and when data deduplication will occur on Server 2012, and Windows 8 (if you have that installed, covered in  another  guide). Deduplication is a great way to save tons of space, its also built into Windows Server 2012 and can be added to Windows 8.

Issue – (any of the below)
I want to see how well deduplication is working,
I want to see when its running,
I want to force a data deduplication right now.
I hacked Windows 8 and dont have the server manager to see my disk space savings.
Windows 2012’s Server Manager takes a year to open, I just want to see some stats here people.

Solution –  First open up PowerShell, if you have removed it from the task bar then do a search for it then open it up.

/ ! \ It is important to note, you can not enable deduplication on the partition that windows is on. This will throw an error when you attempt to try and do this.

Once powershell is open we will be using the Get-Dedup commands see below for them.

First if you have not already enabled dedupe on a disk thats ok we can do that now. I will be using the drive letter E:\ as my example you will fill in your own disk where ever you see E:\ Type in Enable-DedupVolume E:

Set-DedupVolume E: -MinimumFileAgeDays 0 (This will set deduplication to run 24/7 as the file age is set to nothing this may cause high resource usage if you have lots of storage as it constly will try to  optimize  the system, I  recommended  3 days for a home file server. Microsoft  recommends 5 days.)

Start-DedupJob E: –Type Optimization (Now we want to run a single dedupe job to see how much we can save, since I dont want to wait for the system to check the age on all my files on my disk so lets just run it now. Give it about a  minute  to kick off the job and then we will check and see if its running.)

3-6-2013 2-57-18 PMGet-DedupStatus (This will output a simple list of your disks and how much space you have saved on them).


There you go! Dont forget to set the file age on the command Set-DedupVolume E: -MinimumFileAgeDays 5 or it will run constantly in the background! If your looking to add data deduplication to Windows 8 follow my guide here.