Hyper-V, undersizing your boot partition and swap file fun

I have a bad habit of making the boot drives for my virtal machines quite small, usually around 16GB. My Exchange 2010 server is virtualised and has this sort of configuration, a 16-gigabyte C: drive which just the OS, and a D: drive with Exchange and the databases on it. At some point, Windows decided to increase the swapfile to a point where I was uncomforable with the amount of free space on C: drive. No problems I thought, I’ll put it on D: drive. It would refuse to take it and would recreate the swap file on C: as a temporary swap file leading to bad performance.

After a fair amount of hair pulling and bad performance, I found out the issue. As detailed here, you can’t boot a Hyper-V machine from a SCSI Virtual Disk (that is, a virtual hard disk created and attached to the VM’s SCSI controller), not can you create a swapfile on it. This is apparently caused by the nature of the SCSI disk and controller and can be fixed by using an IDE virtual hard disk instead. So now the Exchange server has a 3rd drive, S: drive which is a 32-gigabyte IDE virtual disk that happily stores the swap file. Performance is much improved as a result.

Tricks of the Trade macro

Rogues in World of Warcraft have an ability called Tricks of the Trade. I wanted a way of being able to easily use it on a predetermined character (ie. the tank). The best I could do is the following macro:

#showtooltip Tricks of the Trade
/cast [target=Focus] Tricks of the Trade
/say Showing %f the |cff71d5ff|Hspell:57934|h[Tricks of the Trade]|h|r

The fun bit is the 3rd line. %f is WoW macro shorthand for “focus name” (just like how %t is for target name) and the horrible mess after that is the in-game ability link for Tricks of the Trade. So party members will see you saying “Showing BobTheTank the [Tricks of the Trade]”. I’ll be making a similar macro for Misdirects at some stage.

Accessing ServerManager cmdlets remotely

I’ve been working on a little project of late that requires a Powershell script to check what roles a server has installed. Under 2008, this is fairly trivial as there is a ServerManager module for Powershell which can simply output which roles are installed. This is fine if you’re wanting to run the check locally, but what if you want to run it remotely? And if your local machine is not running 2008?

I tried to be sneaky and copy across the ServerManager module files but this didn’t work. I posted on the Microsoft powershell forums for help before I found the answer myself – use the invoke-command cmdlet. Below is an example of the code I used:

$strComputer = "someserver" # The server to run the command against
$strCommand = { import-module servermanager ; get-windowsfeature | Where {$_.installed -eq $true} | select displayname,name,installed,featuretype} # import the module, run the command to get the features that are installed
$FeatureList = invoke-command -computername $strComputer -scriptblock $strCommand # invoke-command against our remote server and run command we constructed

$FeatureList can then be manipulated as you see fit. This sort of thing could probably be used for a range of tasks.

Bitnami