Monday 30 September 2013

Offload Data Transfer (ODX) in Windows Server 2012

I've been working on a nice Dell R720 host based Hyper-V cluster this week with a Dell Compellent array providing the storage.

One of the things I was looking forward to with this job was getting hands on with the ODX feature of the Compellent.

ODX (Offload Data Transfer) is a feature found on some of the newer storage arrays that helps with large file operations by (in simplified terms) keeping the transfers within the array rather than passing the file to the source then destination servers then back to the array.

The first thing to do (assuming you know the hardware supports it) would be to check that the OS and it's software components supports ODX.

Now this is a Windows Server 2012 and 2012 R2 only feature so if you're on 2008 R2, time to upgrade.

From a PowerShell prompt, run the following command:
Fltmc instances



Take a note of the volume name of either the drive, or in my case the CSV volume you want to check.  Then run:
Fltmc instances -v <Volume Name>

e.g. Fltmc instances -v C:\ClusterStorage\Volume1


This will give you the filter names that you will need to check.
Run this command, replacing the <Filter Name> with those shown by the previous command.

Get-ItemProperty hklm:\system\currentcontrolset\services\<FilterName> -Name "SupportedFeatures"

So for my two filters of FsDepends and MpFilter I get the following output:


The property that needs checking is "SupportedFeatures".  If this has a value of 3 then ODX is supported and you're good to go.  Anything else and you'll need to look into it further.

Lastly, check if ODX is enabled on your server using this command:
Get-ItemProperty hklm:\system\currentcontrolset\control\filesystem -Name "FilterSupportedFeaturesMode"

If it returns a "FilterSupportedFeaturesMode" other than 0 as shown below then ODX isn't enabled.


Run this to enable ODX:
Set-ItemProperty hklm:\system\currentcontrolset\control\filesystem -Name "FilterSupportedFeaturesMode" -Value 0 -Type DWord


Or this to disable ODX if needed:
Set-ItemProperty hklm:\system\currentcontrolset\control\filesystem -Name "FilterSupportedFeaturesMode" -Value 1 -Type DWord

In order to demonstrate to the client that ODX was indeed enabled and more to the point worth having, I modified the script on Hans Vredevoort shows on his blog post discussing ODX testing between 3Par and Compellents here: http://www.hyper-v.nu/archives/hvredevoort/2013/07/notes-from-the-field-using-odx-with-hp-3par-storage-arrays/

I ran the script which loops through creating 10 x 50Gb and 10 x 475Gb fixed disks with ODX enabled and then does the same but with ODX disabled.

This was the timings from the test:

With ODX
12.6 seconds for 10 x 50Gb vhdx files
84.2 seconds for 10 x 475Gb vhdx files
96.8 seconds total for all vhdx files

Without ODX
1015.5 seconds (nearly 17 mins) for 10 x 50Gb vhdx files
8615.8 seconds (just over 2 hours) for 9 x 475Gb vhdx files (N.B. I ran out of disk space for the 10th)
9631 seconds or 2.7 hours total for all vhdx files
 


There is a MASSIVE difference in creation times!

ODX is a feature well worth having in my opinion.  What I really can't wait for is ODX support with SCVMM libraries in the SCVMM 2012 R2 release!!


I've uploaded the ODX Test script to SkyDrive here: http://sdrv.ms/16QhZZE

Thursday 26 September 2013

Using PowerShell CIM Sessions to Query Dell Hardware

I've been "playing" with some Dell hardware recently and as with everything I like to try and automate as many tasks as possible.

Dell have a really useful tool called Racadm which is a command line utility which you can call from a script to read and write various properties of Dell iDRAC and CMC (Chassis Management Controller).

However, since the latest iDRAC and CMC are built around WSMAN and DMTF standards, I prefer a more PowerShell only approach.

The key PowerShell command for querying is Get-CimInstance. Before we can use this command however we first need to establish a remote CIM Session to the hardware.

This is accomplished by using the New-CimSession and New-CimSessionOption cmdlets.

So...
Use some variables to store the IP, username and password for the iDRAC
$UserName="root"
$Password="calvin"

$DracIP="10.10.0.120"

Convert the username and password into a PS Credential
$SecurePass = ConvertTo-SecureString $Password -AsPlainText  -Force
$DracCred = new-object -typename System.Management.Automation.PSCredential -argumentlist $UserName,$SecurePass


We can then create a new CimSessionOption object, which for the Dell Hardware the below works nicely
$cimop=New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 -UseSsl

Then using the above variables and new session object we can create a new CIM session to the iDRAC
$Dracsession=New-CimSession -Authentication Basic -Credential $DracCred -ComputerName $DracIP -Port 443 -SessionOption $cimop -OperationTimeoutSec 10000000


Once we have the session established, we can then use the Get-CimInstance cmdlets to query various properties by passing in a WSMAN/WinRM ResourceURI.

For example, if we just wanted to query the general BIOS properties, we could use the following URI: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_SystemView

That would form the following command (cmdlet - session - resourceuri):
Get-CimInstance -CimSession $Dracsession -ResourceUri "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_SystemView"

Which supplies information like this:



This way if you assign the object to a variable ($BIOSINFO=Get-CimInst ...) then we can pull out specific items within scripts:



Again, you can do similar things with other hardware properties, for example I can use the resource URI for getting the network card information from a server (http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_NICView)

Drop this into a command:
$NICS=Get-CimInstance -CimSession $Dracsession -ResourceUri "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_NICView"

... and now we can get the various MAC Addresses of the various NICs
$NICS[0].PermanentMACAddress
$NICS[1].PermanentMACAddress
...
$NICS[6].PermanentMACAddress
$NICS[7].PermanentMACAddress



Hmm... Useful for SCVMM Bare Metal deployment scripting maybe?

The only thing that I struggled with this very simple method of querying the hardware for info, was the resource URI needed.

Well to help with this, the following bits of information from Dell are a god send:

DCIM Profile Library
http://en.community.dell.com/techcenter/systems-management/w/wiki/1906.dcim-library-profile.aspx

WinRM WebServices for Lifecycle Controller
http://en.community.dell.com/techcenter/extras/m/white_papers/20066174.aspx


Next time I'll post about using PowerShell to set the values rather than just query them.

Microsoft System Center 2012 Orchestrator Cookbook

Better late than never...
In the last few days of August, Packt released the latest book I've had the pleasure of co-authoring.

The book is stocked by all major online retailers, below are the links for Packt and Amazon (UK)
http://www.packtpub.com/microsoft-system-center-2012-orchestrator-cookbook/book
http://www.amazon.co.uk/Microsoft-System-Center-Orchestrator-Cookbook/dp/1849688508/


Book Outline
In Microsoft System Center 2012 Orchestrator Cookbook you will learn how to plan, create, and manage powerful runbooks to help you automate mission critical and routine administration tasks.
In this practical Cookbook you will learn how to master System Center 2012 by creating runbooks to control and automate every feature possible. You will start by learning how to efficiently install and secure System Center Orchestrator.

You will then learn how to plan and create functional and fault-tolerant System Center runbooks to automate daily tasks and routine operations. Diving deep into runbooks, you will learn how to create powerful and practical runbooks for the entire System Center family of products.
Unleashing your inner control freak, you will then master System Center automation by creating IT Service Management process runbooks and advanced runbooks to help you control every feature imaginable of System Center. If you want to save time and energy automating mission critical tasks with System Center 2012 Orchestrator, then this book is for you!

Approach
This book is written in a practical, Cookbook style with numerous chapters and recipes focusing on creating runbooks to automate mission critical and everyday administration tasks.

Who this book is for
System Center 2012 Orchestrator is for administrators who wish to simplify the process of automating systems administration tasks. This book assumes that you have a basic knowledge of Windows Server Administration, Active Directory, Network Systems, and Microsoft System Center technologies.

Saturday 21 September 2013

Converting a WIM file to VHD on a UEFI system

I always use the excellent Convert-WindowsImage.ps1 script by Mike Kolitz for taking the WIM files from the Windows media and converting them into bootable VHD files.  It's the quickest and easiest way for creating VM Templates in SCVMM.

The script can be found here: http://gallery.technet.microsoft.com/scriptcenter/Convert-WindowsImageps1-0fe23a8f/

However, I ran into a problem today with the script throwing an error about "Could not get the BootMgr object from the Virtual Disks BCDStore"


It turns out from a couple of replies in the discussion thread of the TechNet Gallery listing that this will generally happen if trying to run the script from a device that uses UEFI to boot, which I happen to be doing.

Thankfully the fix is relatively easy, you just need to modify the script slightly.

  1. Do a search in the script for $bcdBootArgs which is usually first referenced at line 4055
  2. On the line a couple below (usually 4057) change the following
    "/s $Drive" modify to "/s $Drive /f ALL"
This tells the BCDboot.exe command to create boot entries to enable the vhd(x) to boot for both BIOS and UEFI systems.
http://technet.microsoft.com/en-us/library/dd744347(v=WS.10).aspx

Save the script and you're good to go!

 

Wednesday 11 September 2013

Cloud OS Week - Empower People Centric IT

As part of the Microsoft Cloud OS Week, Thursday will be the day for learning about everything "desktop" related and how Microsoft can help you shift from looking at managing devices to how you can empower your users with self-service and a seamless experience across devices.

I've been lucky enough to be asked to help out on the day and take over the Virtual Desktop Infrastructure and Remote Desktop Services in Windows Server 2012 session.

http://www.eventbrite.com/event/7530739645/es2/?rank=1

If you're not already signed up to attend the session, I definitely recommend signing up quick and attending as it's sure to be a brilliant day packed full of information from some brilliant MVP's!