Fastest Disk for Running Virtual Machines?

I read a discussion the other day about a laptop review as well as comments about running virtual machines on a Solid State Disk (SSD).

The two comments that made me think were (to paraphrase):

1) “I heard running virtual machines can cause issues with your SSD

2) “I don’t notice a large performance difference between running a virtual machine on an SSD and a normal disk

These comments were of interest to me since I run my primary virtual machines off my SSD disk. Am I potentially trashing it for no performance improvement?

I put together my own speed test based on a few disks I have lying around.

The contenders are:

Disk  Connection Comment
Intel X-25M SSD (160GB)  SATA My Solid State Disk in a laptop caddy
Western Digital 7,200 RPM 2.5” (200 GB)  E-SATA Generic external enclosure
Western Digital Passport (1TB)  USB 3 My latest external disk
Western Digital Passport (80GB)  USB 2 My first external disk, still going strong after 6 years

(From Left to Right) Intel X25-M SSD, Generic WD e-Sata, WD Passport USB3, WD Passport USB2

Disclaimer

This test is definitely not exhaustive, and applies only to Hyper-V and my particular laptop configuration.

In addition, only some general aspects of the newly released Windows 8 (Developer Preview). The comparisons for the operations that interest you may be quite different. The comparisons I made were just to determine if there was a trend between the underlying disks.

A better test would do similar comparisons between Virtual Box, VMWare, Virtual PC etc.

Finally, the SSD had the advantage of being directly connected to the main SATA bus. I could have tested a normal disk in the caddy as well, but I felt e-SATA should be nearly as fast (if not as fast).

Test Setup

I have created a 20GB Hyper-V disk file with Windows 8 installed. The same file is copied to each of the disks above.

The Hyper-V machine for each has 4 processors with 4092MB of RAM. The configurations are identical.

Just to make things fair, I tested each machine twice by shutting down and then starting again.

The laptop was a Lenovo W520 with an i7 CPU and 16GB of RAM. The operating system was Windows Server 2008 R2 Standard Edition.

Nothing was running except for the Hyper-V process itself, and only the machine being tested run running.

A list of my Hyper-V machines. Windows 8 test machines at the bottom

Testing

I just tested and timed some simple operations in Windows 8 that anyone can do out of the box.

Results

The results in seconds are below:

Test  Intel X-25-M WD e-Sata WD Passport USB3 WD Passport USB2
Windows Startup 

10

21

26

35

Windows Login 

5

4

5

8

Launch Visual Studio 11 

6

24

26

36

Build basic HTML5 solution in Visual Studio 

1

4

4

7

Launch Expression Blend 5 

2

8

15

19

Conclusion

There is a considerable speed advantage to using a Solid State Disk for running your Hyper-V virtual machines.

e-Sata still proved to be slightly faster than USB 3.

Surprisingly, USB 2 was not extremely slow compared to its USB 3 successor.

What Next?

I recognize that by using my SSD to run virtual machines, I am potentially reducing the life of the disk quite considerably.

At the time of writing an Intel SSD with 160GB is retailing at USD $300. Therefore the productivity advantage (for me) seems to outweigh the cost of the disk itself.

I will still run some machines (such as Active Directory and betas) on a ‘normal’ disk.

I’m also likely to use USB 3 more from now on. Although my e-Sata disks are a little faster, I find the connection more temperamental as well as needing two cables (data + power) which is inconvenient.

Hyper-V RemoteFX GPU driver crash with IE9

I am running Windows Server 2008 R2 with Service Pack 1, and wanted to try out RemoteFX.

It looks really good, except the GPU driver kept crashing, and I kept having to reboot the machine to RDP back into it.

I noticed it only happened when IE was running, and I suspected that the new GPU features in IE 9 ‘might’ be the culprit.

So I turned off the setting in IE options and sure enough the driver is no longer crashing!

 

 

Update: 1st September 2011

I found another tip from Microsoft to prevent the RemoteFX display driver going into ‘Turn Off Display’ mode:

http://support.microsoft.com/kb/2501816

Basically two commands:

  • powercfg -X -monitor-timeout-ac 0
  • powercfg -X -monitor-timeout-dc 0

 

 

 

 

 

 

 

 

Podcast List

Just a list of Podcasts I’m listening to right now:

IT Related

Title Description Web URL
.NET Rocks A look each week at a different aspect of developing with .NET http://www.dotnetrocks.com
Run As Radio The same as .NET Rocks, but from an IT Pro perspective. This is pretty valuable for developers to listen to in order to understand the issues encountered in the infrastructure world. http://www.runasradio.com
Hanselminutes Scott Hanselman interviews interesting people in Microsoft and ALT.NET. http://www.hanselminutes.com
This Developer’s Life A look at the emotions experienced by developers through their careers. http://thisdeveloperslife.com
SharePoint Pod Show Informative show that gives you an insight into experiences and best practices from SharePoint experts. http://www.sharepointpodshow.com
Stack Exchange Back after a year! Jeff Atwood and Joel Spolsky (founders of StackExchange) talk about the building of the site, which helps you think about the interactions of business and technology in growing a startup. http://blog.stackoverflow.com/category/podcasts/

Other

Title Description Web URL
In Our Time Always interesting discussion around the history of a wide variety of science, religious and social topics. http://www.bbc.co.uk/radio4/features/in-our-time/
Judge John Hodgman Comic time out http://www.maximumfun.org/shows/judge-john-hodgman
Korean Class 101 Free Korean lessons. They also sell a good iPad application based on this material. feed://www.koreanclass101.com/wp/wp-feed-audio-video.php

Where is Disk Cleanup for Windows Server 2008?

Discovered something new today.. in order to use the handy Disk Cleanup utility in your Windows Server 2008 machine, you need to enable the ‘Windows ‘Desktop Experience’ feature.

Fantastic, so I get to slow down my server in order to use the clean up utility?

Luckily, this guy worked out how to enable that utility again with very little effort (just drop it from one location into your System32 folder)

http://juliusphua.com/2010/10/disk-cleanup-missing-in-windows-server-2008-and-windows-server-2008-r2/

Developing Custom Screens for SharePoint 2010

When building a SharePoint site, you may find yourself having to build custom screens. This may be because you need to integrate with a third party system, or perhaps your users require a more sophisticated user interface than can be provided out of the box.

There are a few (non exhaustive) options around building custom screens in SharePoint 2010, and I have created them on the basis that you need to read and write to some tables held in a separate SQL Server instance.

There is no conclusion to the best method. You should always consider your business requirements in determining which is most appropriate.

This is also assuming that you have to use SharePoint as a platform instead of ASP.NET.  (At least for Options 1 & 2)

Option 1: Custom .NET WebPart + Services

For total flexibility, you can create a custom web part with any kind of experience you like.  You can employ AJAX, Javascript and third party UI components such as Infragistics or Telerik.

The seperate service layer allows you to abstract your data access code away from your User Interface. The additional benefit is that your service layer can take advantage of .NET 4.

Advantages

  • Implement any user interface you like
  • Abstract data access / business logic away from user interface
  • Easier to secure (no database connections in web site web.config)
  • Easier to unit test web services
  • Leverage .NET 4 in your service layer

Disadvantages

  • Requires more coding for extra layer

Option 2: Custom .NET Webpart + Direct Access

This is the same as Option 1, with the Service Layer removed.

Advantages

  • Implement any user interface you like
  • Faster to develop.

Disadvantages

  • Restricted to .NET 3.5
  • Database connection strings in SharePoint web.config
  • Harder to unit test User Interfaces than abstract services.

Option 3: JavaScript + SharePoint REST Services

SharePoint 2010 can now expose all of its lists through a REST API. This combined with External Data Sources make SharePoint a good web service provider.

The idea is that the whole User Interface can be built with JavaScript ( and JQuery ), that can easily consume and update data through the SharePoint REST API.

The JavaScript is hosted in a content web part, although a Visual Web Part may give you more flexibility for this.

Advantages

  • No .NET coding required, just JavaScript / JQuery
  • Easy to configure SharePoint to do this
  • For a large number of end users, this approach will be far less demanding on the SharePoint server. (All User Interface processed on the client machine).

Disadvantages

  • All User Interface is managed on the Web Browser
  • Permissions to read / update / delete data are manages far down in the database
  • Harder to build event driven logic in JavaScript than ASP.NET
  • All JavaScript can be read by the end user. Hacking may be possible.

Option 4: InfoPath

SharePoint 2010 can host InfoPath forms inside the browser. This combined with External Data Sources means you can very quickly create a user experience on top of external data.

Advantages

  • No .NET coding required, just define InfoPath forms
  • InfoPath rules are easier/safer to implement than .NET business logic
  • Easy to configure SharePoint to do this
  • Ideal for simple operations such as filling a table with data.

Disadvantages

  • Little control over the User Interface and the controls you want to use (few custom development options)

Simple Hyper-V Test Domain for SharePoint

Did you ever have that feeling that something fundamental was missing from your relationship? I have been feeling this for some time, and the time has come to face the cold brutal truth.. a life of SharePoint development is just empty without Active Directory.

So I have taken the first brave step in admitting this.. now what?

Back in the days of Virtual Server, it WAS possible to set up a domain controller on a virtual machine. It was also rather painful.

But in these days of Hyper-V, I wondered.. just how hard can it be? You will still need all your infrastructure skills for the advanced features, but for basic “Lets create domain service accounts, users and groups” it is actually pretty easy.

These are the steps I took:

First Task: Set up the Domain Controller

Step 1: Create a ‘New virtual network’, and make it a Private virtual machine network

Step 2: Install Windows Server 2008 R2 Standard Edition on a new Virtual Machine.
(Handy tip: Install this machine with 2GB of RAM. After installation you can crank it back down to 512MB. If you install with 512MB then be prepared to wait a awhile)
Step 3: Set the network for this machine to your new private network.
Step 3: Configure the TCP/IP settings- Use the values below (Static values are the way to go)
Step 4: Change the name of the Computer to ‘DC’ (or actually, whatever you want.. it is YOUR domain controller after all)
Step 5: Add the ‘Active Directory Domain Services” role. (I have used Andrew.com, but I’m sure you can come up with better)

Second Task: Connect your SharePoint Machine to the domain

Step 1: Add a second network adapter to your SharePoint machine. Associate this with the Internal network that your DC is sitting on.

(Note: By having two network adapters, you can connect to the domain on the internal network and the internet on the other at the same time)

(Note 2: I seem to have installed a legacy adapter here. It seems to work fine however)

(Note 3: You probably want to configure SharePoint after you connect to the domain, since you may want to use those nice domain service accounts)

Step 2: Change the TCP/IP settings on the Internal Network to be consistent with those of the Domain Controller machine.

(Note: Use the same values as the screenshot)

Step 3: Connect your SharePoint machine to the domain.

Step 4: Create lots of test users named after characters in Battlestar Galactica

Step 5: Savor the thrill of adding Battlestar Galactica users into your SharePoint

Microsoft OneNote for iPhone (US Only)

This news ‘almost’ made my day, until the realization that it isn’t going to be available outside the US iTunes store anytime soon.

So two issues really:

A) I have locked myself into the Apple iTunes platform, and they make it difficult to publish widely

B) Microsoft went to the effort to publish this, but not the extra effort to publish internationally.

 

With regards to music, although frustrating, I understand that there is complex regional licensing around all published music and as such it isn’t always feasible to publish a new album in all regions.

With ‘Apps’, what is the big deal???

 

I hope Microsoft learn from this and make a ‘Version 2.0′ that utilizes the iPad and is global! I also hope we can look back on this in 10 years time and laugh at the illogical regional barriers to all content, whether it is free or paid for. :)

Bing Maps Javascript Control as SharePoint Consumer Web Part

I previously showed you how to add the Javascript flavor of Bing Maps to a SharePoint 2010 page, and consume data from a SharePoint list via the handy REST interface.

However the benefits of SharePoint WebParts can be made more readily available by connecting to the List from where the data is published.

The code below extends the Web Part in order to connect to the list of travel requests.

This works by parsing the incoming data to a JSON array that can be easially passed to the ASPX page.

I constructed the JSON with the Json.NET open source library:


/// <summary>
 /// Property that will be read from the ASPX page
 /// </summary>
 public string FlightRequests { get; set; }

 private IWebPartTable _provider;
 private ICollection _tableData;

 [ConnectionConsumer("Table")]
 public void SetConnectionInterface(IWebPartTable provider)
 {
 _provider = provider;

 if (_provider != null)
 {
 _provider.GetTableData(new TableCallback(GetTableData));
 }
 }

 /// <summary>
 /// Call back method for TableCallback
 /// </summary>
 /// <param name="tableData"></param>
 private void GetTableData(object tableData)
 {
 // Set property to value
 _tableData = (ICollection)tableData;

 if (_provider != null)
 {
 // Discover schema
 PropertyDescriptorCollection props = _provider.Schema;

 // String into which we will write our JSON
 StringBuilder sb = new StringBuilder();
 StringWriter sw = new StringWriter(sb);

 using (JsonWriter jsonWriter = new JsonTextWriter(sw))
 {
 // This is going to be one looooooong string so that Javascript can use it.
 jsonWriter.Formatting = Formatting.None;

 if (props != null && props.Count > 0 && _tableData != null)
 {
 jsonWriter.WriteStartObject();
 jsonWriter.WritePropertyName("TravelRequests");
 jsonWriter.WriteStartArray();

 // For each travel request
 foreach (DataRowView o in _tableData)
 {
 int counter = 0;
 jsonWriter.WriteStartObject();

 // For each 'column' in the list
 foreach (PropertyDescriptor prop in props)
 {
 string propertyName = prop.DisplayName;

 // I really don't like this, but for a valid JSON string we need to strip out the ':' and spaces.
 propertyName = propertyName.Replace(':', ' ');
 propertyName = propertyName.Replace(" ", "");

 jsonWriter.WritePropertyName(propertyName);

 if (o[counter] is String)
 {
 string value = o[counter] as String;
 // ... and the commas.. whos know what chaos may ensue?
 value = value.Replace(',', ' ');
 jsonWriter.WriteValue(value);
 }
 else
 {
 jsonWriter.WriteValue(o[counter]);
 }

 counter++;
 }

 jsonWriter.WriteEndObject();
 }

 jsonWriter.WriteEndArray();
 jsonWriter.WriteEndObject();
 }
 }

 // Finally add this JSON to our FlightRequests string property.
 FlightRequests = sb.ToString();

 }
 }

Then in the ASPX file, get a reference to the string:

 var theFlightRequests = '<%= FlightRequests %>';

and in the Javascript file, process it with the following function:


function SetFlightRequests() {

 var results = JSON.parse(theFlightRequests);

 $.each(results.TravelRequests, function (i, result) {

 var origin = new VELatLong(result.OriginLatitude, result.OriginLongitude);
 var originShape = new VEShape(VEShapeType.Pushpin, origin);
 originShape.SetCustomIcon(originIcon);
 map.AddShape(originShape);

 var destination = new VELatLong(result.DestinationLatitude, result.DestinationLongitude);
 var destinationShape = new VEShape(VEShapeType.Pushpin, destination);
 destinationShape.SetCustomIcon(destinationIcon);
 map.AddShape(destinationShape);

 var line = new VEShape(VEShapeType.Polyline, [origin, destination]);
 line.HideIcon();

 map.AddShape(line);
 });
}

Use Bing Maps as a Dashboard Visualization in SharePoint 2010

In my previous two posts, I have shown how to define a SharePoint list from external data, and how to integrate a simple map into SharePoint.

Now I would like to show how they can be used together in a Dashboard style visualization.

My external list is a collection of Airports around the world (along with descriptions and geographical locations).

I want to create a new list that allows users to place travel requests between two airports, and then visualize those requests on a map like this:

This SharePoint page will consist of a Map WebPart and a List.

Step 1: Create a geographically aware list

I created a Travel Requests List using two columns of External Data from my external Airports List:

Step 2: Read the contents of the Travel Requests list via the REST interface

SharePoint 2010 has the the great facility that allows you to access list data via REST.

Since I am using JQuery in the Map component, this is really useful.

The REST interface (in my instance is http://winsuite2010/sites/FlightTracks/_vti_bin/listdata.svc/TravelRequests )

Here is a fragment of my Travel Requests list:

<pre id="line1"> <m:properties>
        <d:ContentTypeID>0x010013786946E27C1041A4AAE48EEB53186C</d:ContentTypeID>
        <d:Title>PDC Conference</d:Title>
        <d:Approved m:type="Edm.Boolean">true</d:Approved>
        <d:OriginCity>Paris</d:OriginCity>
        <d:OriginCountry>France</d:OriginCountry>
        <d:OriginName>Charles De Gaulle</d:OriginName>
        <d:DestinationCity>Los Angeles</d:DestinationCity>
        <d:DestinationCode>LAX</d:DestinationCode>
        <d:DestinationCountry>United States</d:DestinationCountry>
        <d:DestinationLatitude m:type="Edm.Double">33.9425</d:DestinationLatitude>
        <d:DestinationLongitude m:type="Edm.Double">-118.407222</d:DestinationLongitude>
        <d:DestinationName>Los Angeles International</d:DestinationName>
        <d:OriginCode>CDG</d:OriginCode>
        <d:OriginLatitude m:type="Edm.Double">49.016667</d:OriginLatitude>
        <d:OriginLongitude m:type="Edm.Double">2.55</d:OriginLongitude>
        <d:Id m:type="Edm.Int32">3</d:Id>
        <d:ContentType>Item</d:ContentType>
        <d:Modified m:type="Edm.DateTime">2011-01-01T12:11:24</d:Modified>
        <d:Created m:type="Edm.DateTime">2011-01-01T12:11:24</d:Created>
        <d:CreatedById m:type="Edm.Int32">1</d:CreatedById>
        <d:ModifiedById m:type="Edm.Int32">1</d:ModifiedById>
        <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
        <d:Version>1.0</d:Version>
        <d:Path>/sites/FlightTracks/Lists/Travel Requests</d:Path>
      </m:properties>
</pre>

Step 3: Adapt the map rendering Javascript to display travel paths

Using JQuery getJSON method, we can easily call this REST service, loop through the elements and add them as geographic objects to the map.


var originIcon = "<div class='OriginAirport'></div>"
var destinationIcon = "<div class='DestinationAirport'></div>"

function GetMap() {
 map = new VEMap('myMap');
 map.LoadMap(null, 1);
}

$(document).ready(function () {
 GetMap();
 GetLocations();
});

function GetLocations() {

 $.getJSON('http://winsuite2010/sites/FlightTracks/_vti_bin/listdata.svc/TravelRequests', function (data) {
 var count = 0;
 $.each(data.d.results, function (i, result) {

 var origin = new VELatLong(result.OriginLatitude, result.OriginLongitude);
 var originShape = new VEShape(VEShapeType.Pushpin, origin);
 originShape.SetCustomIcon(originIcon);
 map.AddShape(originShape);

 var destination = new VELatLong(result.DestinationLatitude, result.DestinationLongitude);
 var destinationShape = new VEShape(VEShapeType.Pushpin, destination);
 destinationShape.SetCustomIcon(destinationIcon);
 map.AddShape(destinationShape);

 var line = new VEShape(VEShapeType.Polyline, [origin, destination]);
 line.HideIcon();

 map.AddShape(line);
 });
 });
}

Step 4: Create better icons for PushPins (Optional)

Add a SharePoint Mapped Folder to Template->Layouts->Styles

Step 5: Define Pushpin look (optional)

Create an empty stylesheet (CSS) file. I called mine FlightTracks.css
I wanted to define the icons in CSS for the origin and destination airports. I wanted to draw circles and didn’t want to use a graphic.

 .OriginAirport
 {
    height: 1em;
    width: 1em;
    -webkit-border-radius: 5em;
    -moz-border-radius: 5em;
    border: 0.2em solid #888943;
    background-color: #CACC7F;
    margin: auto;
 }

  .DestinationAirport
 {
    height: 1em;
    width: 1em;
    -webkit-border-radius: 5em;
    -moz-border-radius: 5em;
    border: 0.2em solid #B25900;
    background-color: #FF8000;
    margin: auto;
 }

Step 6: Add reference to StyleSheet in in WebPart (Optional)

You can just add the SharePoint CssRegistration control:


<SharePoint:CssRegistration runat="server" ID="css" EnableCssTheming="true" Name="FlightTracks.css" />

Fun Fact: The circle effect is not supported by IE8 and below and will appear as squares. It works with IE9 as well as all major CSS 3 compliant browsers (Firefox, Chrome etc)

Advantages of this approach:

  • Lightweight way of displaying a map and results in SharePoint
  • Works on almost every client / device

Disadvantages of this approach:

  • Requires Internet connection on client machine to display map
  • Internet facing sites may not want to expose the SharePoint REST service in this way
  • Map WebPart does not truly integrate with SharePoint list

[/sourcecode]

Bing Maps in my Sharepoint? It is more likely than you think..

Actually, there are many mapping solutions for SharePoint, both commercial and open source.

The thing I didn’t understand was why it was hard to find a ‘Hello World‘ example for a Javacript based map?

Microsoft provide an interactive SDK that allows you to quickly get maps up and running in HTML.

To do the same in SharePoint 2010, I will use this SDK as the basis of an example WebPart built in Visual Studio 2010.

The main problem of integration these examples is that the Map has to be created after the page has finished loading, hence the definition of the <Body onload=”"> tag.

It is really hard to add this onload attribute to SharePoint since we do not have ready access to it. In addition, by hacking away at the underlying template you might break something else.

The solution is to not use onload, but to use JQuery’s $(document).ready function, that will also make a call back once the document has finished loading.

It does mean some extra configuration of your code however.. follow the steps below:

Step 1: Create a SharePoint WebPart project in Visual 2010

Step 2: Add a SharePoint Mapped Folder to your project

Step 3: In the following dialog, add the Templates->Layouts folder

This will add a corresponding folder to your WebPart solution.

Step 4: Create a unique folder under Layouts, and add javascript files.

Create a unique folder here (I have used the name ‘FlightTracks’).

In this folder, add the JQuery javascript file. Download from here. (Hint: Use the development version for easy debugging)

Then create a new empty javascript file such as ‘FlightTracks.js’.

Step 5: Add content to the custom Javascript file

function GetMap() {
map = new VEMap('myMap');
map.LoadMap();
}

$(document).ready(function () {
GetMap();
});

Step 6: Add code to the UserControl’s CodeBehind file

        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlGenericControl bingMapsScript = new HtmlGenericControl("script");
            bingMapsScript.Attributes["type"] = "text/javascript";
            bingMapsScript.Attributes["src"] = "http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2";

            HtmlGenericControl jQueryScript = new HtmlGenericControl("script");
            jQueryScript.Attributes["type"] = "text/javascript";
            jQueryScript.Attributes["src"] = ResolveClientUrl("../../_LAYOUTS/FlightTracks/jquery-1.4.4.js");

            HtmlGenericControl flightTracksScript = new HtmlGenericControl("script");
            flightTracksScript.Attributes["type"] = "text/javascript";
            flightTracksScript.Attributes["src"] = ResolveClientUrl("../../_LAYOUTS/FlightTracks/FlightTracks.js");

            HtmlGenericControl script = new HtmlGenericControl("script");
            script.Attributes["type"] = "text/javascript";
            script.InnerText = "var map = null; ";

            Page.Header.Controls.Add(bingMapsScript);
            Page.Header.Controls.Add(jQueryScript);
            Page.Header.Controls.Add(script);
            Page.Header.Controls.Add(flightTracksScript);
        }

Please note that if you havn’t named your Javascript folder as ‘FlightTracks’, then you will need to adjust here.

Step 7: Define the HTML entry of the map

Bing Maps will take over a defined DIV to turn into a map. Add this line to your custom control (ascx) file:

<div id='myMap' style="position:relative; width:600px; height:400px;"></div>

Follow

Get every new post delivered to your Inbox.