Enabling Server side includes in IIS7

July 22nd, 2009

A relatively little used feature now, but still important if your HTML passes server side includes. Mainly used for templated html structures which call various blocks of layout to the page, this feature is not enabled by default in IIS7.

To switch the feature on, firstly:
Control Panel > Programs and Features > Turn Windows Features On or Off

control panel

Next you need to enable the SSI feature as shown:

enabling ssi includes in IIS7 on Vista

If you’re in Vista -the next time you go into the Handler Mappings in IIS, you’ll see that .shtml, .shtm and .stm file types have been automatically added with the correctly configured handler. If you’re not using Vista, you may need to add these mappings yourself manually through the Add Module Mapping section.

Should be relatively easily tested by setting a test .shtml page to call another section using the standard include:

< !–#include file=”foo.html”– >

As long as the content of that file pulls through, you’ll know it’s working.

Creating nlite image discs for your PC/server

July 10th, 2009

For anyone who regularly (or even irregularly) has to re-install operating systems in a business environment, you’ll know exactly how time consuming, dull and repetitive this can be. Thankfully there are products out there for making this process a little easier, and this one is even free!

One such product is called nlite (or vlite for vista products). It’s not a fully fledged imaging product- but instead allows you to take a huge amount of the hassle out of the re-installation process by bundling together service packs, windows updates, drivers and pretty much anything else you might want, into one neat iso.  What this means for administrators who look after just a few different models of workstation, is that you can build up and keep a library of up-to-date disc images, so that in the event of needing to re-install – you’ve got a disc on hand which will leave the machine in a much more ready state than a standard OS disc.

So, first of all, download nlite

http://www.nliteos.com/download.html

Once installed, launch the Appnlite in action

Now, you’ll need to point the installation at your OS disc, for nlite to start to build it’s own image.

At this point, you’ll be prompted to chose the various features of nlite’s features,

nlite features

the most important (read as: useful) features are

1. Slipstreaming Service packs and updates
2. Including Drivers

You can then customise pretty much every aspect of Windows, ripping out services, languages, all kinds of features can be remove to save space, or for security – but the real risk here is that you might rip something out that you’ll later need, so take care here.

In the customisation section there’s some really good features, such as being able to setup your default windows explorer views, customising your ‘start’ toolbar and many many more – one of my personal favourites is the ability to add the OS, Service Pack and version to the bottom right hand corner of your desktop background. Until I saw this in nlite, I didn’t even know that it existed in Windows!

Once you’ve finalised all of your options, you’ll get a page where you’re prompted to begin the build

nlite ready to build

nlite will then build you a bootable image which you simply write to disc with your favourite CD writing software and you’re ready to install your machine.

Automating VMWare ESXi snapshots through Scheduled Tasks

July 7th, 2009

Earlier I wrote about Creating ESXi snapshot backups with ghettoVCB.sh. Now, the next logical step is to be able to automate these snapshots so you don’t need to ssh to the ESXi host and run the script manually and wait for the result.

We can use plink, and Windows Scheduled tasks to achieve this result.

In order to use Plink, the file plink.exe will need either to be on your PATH or in your current directory. To add the directory containing Plink to your PATH environment variable.

Start -> Control Panel -> System -> Advanced -> Environmental Settings -> System Variables -> Path -> Edit, and enter the path for your plink.exe file.

OK, so once plink is setup correctly, you can use the following command to connect to your ESXi host, and set your script running with the appropriate ‘vmbackups’ file for the relevant machine.

E:\backup\putty\plink.exe [email protected] -pw passsword “nohup /vmfs/volumes/datastore1/scripts/ghettoVCB.sh /vmfs/volumes/datastore1/scripts/vmbackupsbuilder > /vmfs/volumes/datastore1/scripts/backuplog.txt &”

Picking the above command apart:

1. E:\backup\putty\plink.exe (the path to plink.exe)

2. [email protected] -pw passsword (the username, IP address and password of your ESXi Host)

3. “nohup /vmfs/volumes/datastore1/scripts/ghettoVCB.sh /vmfs/volumes/datastore1/scripts/vmbackupsbuilder > /vmfs/volumes/datastore1/scripts/backuplog.txt &” (this is the path to your ghettoVCB.sh file, the path to your vmbackups file, and a command to log the output

We also run this as a ‘nohup’ command so that the snapshot can continue without anyone being continuously logged into the host.

You probably want to run this without the nohup as a first test, to make sure everything is working OK.

Once you’re happy with the command and it runs successfully for you, you can simply add this command to a .bat file, and then use the standard Windows Task Manager to schedule it to run as frequently as you wish.

Spotlight on Windows, fantastic windows management tool, and it’s free!

July 6th, 2009

I’ve seen a lot of software meant for managing the performance of windows servers, obviously a lot of those tools are extremely specific (for services like SQL and Exchange etc) but for standard windows machines absolutely nothing I’ve seen matches the amazing GUI of Spotlight on Windows. Initially the GUI looks like it’s trying too hard, but actually it’s an amazing blend of static and real-time info. Here’s how it looks

Spotlight on Windows
click for bigger

In terms of content – if offers pretty much everything you’d expect:

CPU usage
CPU queue length
LAN usage
Disk I/O
Processes
Memory usage
Virtual Memory usage
Memory queue
Page file usage
Fixed Disk usage

it also shows the various buses between these objects and shows the pages/sec moving around the motherboard, this feature is sorely missing from many other management products, and it’s often key at determining what’s going on with your server. Each monitor has a helpful explanation in case you’re feeling a little knowledge-light.

My advice for this product would be as follows.

1. Download and Install from the Quest Software site (it’s free!)

2. Set-up your connections (File -> Connect)

3. Ensure Spotlight successfully connects and choose a 6 hour calibration period.

This last step is most important, ideally you want to let Spotlight gather data from the machine over a time-span where it’s under some load, ie a representative snapshot of its daily load. Otherwise you’ll spend a lot more time in future customising the alert levels for usage which you know is “normal”.

Once all your connection are calibrated you’ll have a management tool which can tell you more about a servers performance in a single glance than you’d think possible.

Thanks to Quest Software.

IBM RAID adapters – will it fit?

July 6th, 2009

For those of us who work with IBM server hardware, there’s a baffling array of RAID cards which may or may not fit into your server’s architecture. Without having to locate and flick through your Technical manual for each one, the following page is a wonderfully comprehensive guide to virtually every IBM RAID card ever, and a matrix at the foot of the page showing which cards are compatible with this servers.

http://www.redbooks.ibm.com/abstracts/tips0054.html

Fantastic resource!

Where’s the Disk Cleanup option in Windows Server 2008?

July 3rd, 2009

Windows Server 2008 doesn’t have the Disk Cleanup option switched on as a default.  In order to enable it, you’ll need to install the ‘Desktop Experience’ which actually contains rather a lot of other stuff. Not quite sure why Microsoft have bundled so much stuff into this ‘Desktop Experience’ when 99% of most people will just want the Disk Cleanup option, just another MS idea which *could* have been good, but not quite.

To enable the ‘Desktop Experience’

Step 1 – Open the Server Manager (Start -> Administrative Tools -> Server Manager)

Step 2 – In the Features Summary section, click on Add Feature.

Step 3 – Select the Desktop Feature experience and click through the various ‘Next’ steps to install

Step 4 – Reboot your machine and then you should find the Disk Cleanup option now appears in the usual place. (Right click on disk name -> properties)

That’s it, you’ll now be able to easily delete the swathes of junk that Windows builds up, easily and from one place.  If you’re going to De-frag a disk, always run this first and get rid of as much junk as you can.

Adding Remote Desktop MMC Snap-in for Windows Vista

July 3rd, 2009

A lot of Sys Admins use the RDP Snap-in, on either Windows XP or Windows Server 2003 because it makes it far easier to manage mutliple machines. Unfortunatelty, this feature isn’t available in any version of Windows Vista.

However, due to the similarities between 2003 and Vista, you can get it working, with a bit of tinkering, here’s how.

Step 1 – Download and install the adminpak.msi for Windows Server 2003 and install it on your Vista machine. Both

Windows Server 2003 Service Pack 1 (SP1) Administration Tools Pack and Windows Server 2003 R2 Administration Tools Pack

can be installed onto Vista without error. Unfortunately, you might run into one or two error messages if you use Active Directory Users and Computers on your Vista machine.  So there’s more to be done.

Step 2 – Open an elevated permission command prompt, (Right click on ‘Cmd’ and chose ‘Run as Administrator) and register the following dll’s

regsvr32 /s adprop.dll
regsvr32 /s azroles.dll
regsvr32 /s azroleui.dll
regsvr32 /s ccfg95.dll
regsvr32 /s certadm.dll
regsvr32 /s certmmc.dll
regsvr32 /s certpdef.dll
regsvr32 /s certtmpl.dll
regsvr32 /s certxds.dll
regsvr32 /s cladmwiz.dll
regsvr32 /s clcfgsrv.dll
regsvr32 /s clnetrex.dll
regsvr32 /s cluadmex.dll
regsvr32 /s cluadmmc.dll
regsvr32 /s cmproxy.dll
regsvr32 /s cmroute.dll
regsvr32 /s cmutoa.dll
regsvr32 /s cnet16.dll
regsvr32 /s debugex.dll
regsvr32 /s dfscore.dll
regsvr32 /s dfsgui.dll
regsvr32 /s dhcpsnap.dll
regsvr32 /s dnsmgr.dll
regsvr32 /s domadmin.dll
regsvr32 /s dsadmin.dll
regsvr32 /s dsuiwiz.dll
regsvr32 /s imadmui.dll
regsvr32 /s lrwizdll.dll
regsvr32 /s mprsnap.dll
regsvr32 /s msclus.dll
regsvr32 /s mstsmhst.dll
regsvr32 /s mstsmmc.dll
regsvr32 /s nntpadm.dll
regsvr32 /s nntpapi.dll
regsvr32 /s nntpsnap.dll
regsvr32 /s ntdsbsrv.dll
regsvr32 /s ntfrsapi.dll
regsvr32 /s rasuser.dll
regsvr32 /s rigpsnap.dll
regsvr32 /s rsadmin.dll
regsvr32 /s rscommon.dll
regsvr32 /s rsconn.dll
regsvr32 /s rsengps.dll
regsvr32 /s rsjob.dll
regsvr32 /s rsservps.dll
regsvr32 /s rsshell.dll
regsvr32 /s rssubps.dll
regsvr32 /s rtrfiltr.dll
regsvr32 /s schmmgmt.dll
regsvr32 /s tapisnap.dll
regsvr32 /s tsuserex.dll
regsvr32 /s uddi.mmc.dll
regsvr32 /s vsstskex.dll
regsvr32 /s w95inf16.dll
regsvr32 /s w95inf32.dll
regsvr32 /s winsevnt.dll
regsvr32 /s winsmon.dll
regsvr32 /s winsrpc.dll
regsvr32 /s winssnap.dll
regsvr32 /s ws03res.dll

Step 3 – At this point a lot of people have had a mixture of success in attempting to add the ‘Remote Desktops’  through the MMC Snap-in, it just doesn’t appear in there for some people. The easiest way around it is simply to add a shortcut to the tsmmc.msc file, I’ve added this to my Desktop, and it can be launched without elevated permission to bring up the Remote Management Screen.

Step 4 – Now it’s just a question of adding your connections and you’re away.

Enjoy.

Download and install VMWare Infrastructure Client

July 3rd, 2009

There’s a lot of people searching and posting about the VMWare Infrastructure Client that’s used for managing your ESXi Host, people don’t seem to be able to find and download it from the web.

There’s a good reason for this, it’s not widely available online!  Do install it, simply visit the IP address of your ESXi host in your favourite internet browser, and you can download the Infrastructure Client from the ESXi Host directly.

Hope this helps some of the confused!

Creating NFS share on Windows Server 2003…

July 2nd, 2009

In this post, I’ll talk through how to create an NFS Share in Windows 2003, I’ll then follow it up with a quick post about how to connect to this NFS Share from within your ESXi host.

This post is largely similar to The musings of an IT Consultant: backups VMware ESXi blog, Raj also has a blog called The World Runs on Technology – both of which are excellent – you should check them out.

Stage 4 – setting up NFS Share on Windows Server 2003.

1. Using your FTP client, grab a copy of the following two files from your ESXi host and put them somewhere safe:

/ etc /passwd
/ etc /group

2. Now, download Windows Services for Unix 3.5 from here, and install onto your Windows 2003 server, requires reboot.

3. During install ensure you select the Server for NFS and User Mapping components during the install.

4. In the user mapping section, choose Local User Name Mapping Server and choose Password and Group files

5. In the user name mapping screen, select the passwd and group files that you ftp’s earlier.

6. Reboot your 2003 server and then launch into the MMC (Start -> Run -> MMC)

7. You now need to add the Services for Unix snap-in.  (File -> Add/Remove Snap In -> Add)

Windows Services for Unix Snap In

8. Now, chose User Name Mapping on the left hand side, then select the MAPS section in the right hand side

9. Make sure ‘simple maps’ is checked and then click on show user maps – then list both the Windows and Unix users.

10. Your best option here is to Map your Administrator account to the unix root user – then Apply your settings. You’re done.

Now, on your 2003 machine, create a new folder called, ‘Backup’ for example. Right click on this folder and chose properties. You’ll notice that you have a new tab – called ‘NFS Sharing’. In this tab we can set the share name as Backup. In the permissions section, allow root ‘read-write’ access.

That’s it for setting up the share, you now have a storage area in windows that your ESXi can communicate with. All that’s left, is to point your ESXi host at the new share. So, from the VMWare Infrastructure Client – Go to the ‘Configuration’ tab and then chose ‘Storage’ and then ‘Add Storage’ (which is on the far right)

Here, simply enter the details of the NFS Share you just created and the Share Name etc, like so:

ESXi NFS Share screenshot

Ok, you’re done. In the next post, I’ll be showing you how to automate ESXi snapshot backups through a combination of Scheduled Tasks, ghettoVCB.sh and plink.

Creating ESXi snapshot backups with ghettoVCB.sh

July 2nd, 2009

This is the second post in a series regarding the backup of ESXi Virtual Machines.  Once you’ve got ssh and ftp access sorted you’ll be able to connect remotely to the ESXi host and run scripts (which use the ESXi command line) to automate certain tasks.

One of the best scripts out there for backing up ESXi hosts is called ghetto.vcb You can find out more about the script here:

http://communities.vmware.com/docs/DOC-8760

So, here’s how to set this up

Stage 2 – implementing the ghettoVCB.sh script.

1. First of all, download the ghettoVCB.sh script, and the example file vmbackup

2. Now, you’ll need to ftp these files to you ESXi host (If you haven’t already enabled ftp access, you can find my guide on how to do it here http://www.rancidswan.com/?p=4)

3. Now, ssh to your ESXi host and edit the ghettoVCB.sh file. There are a number of options at the top of the file, but not many, and they should all be fairly self explanatory. Just for testing you can set the path of the backup location to be somewhere on the ESXi host itself. Later I’ll be writing a guide on how to setup an NFS share on a Windows 2003 server so that these snapshot backups can be pushed directly to a windows machine.

4. You’ll also need to edit the file I’ve called vmbackup. This file purely contains just the name of the machine you want to backup (note: it’s the machine’s Virtual Machine name, not it’s Computer name you use, the name has to be understandable by the ESXi host)  You can have multiple machine names if you wish, with distinct names on each line, but personally I’d recommend just having one name in the file, this will make it easier to automate individual machine backups later on)

5. OK, now you’ll need to set the permissions on the file ghettoVCB.sh like this:

chmod 777 ghettoVCB.sh

5. Now, to run the script, you simply need to write:

./ghettoVCB.sh vmbackups

The script will now run and either show a progress meter, or show you any error messages you might need to tackle!