Wednesday 5 May 2010

Blogging from OneNote

Love Microsoft OneNote?

Did you know that you can use OneNote to author and publish to your blog?

In OneNote, go to File > Send To > blog

Enter in your blog provider details (in my case blogger)

Press Publish.


A very short and sweet blog entry, but now you know...

Thursday 1 April 2010

Automated, repeatable and simple: Invoking VMWare Snapshots via MSBuild Tasks for an Automated Daily Deployment

Having worked in various roles across the full spectrum of the development cycle, I find that one of the most frustrating challenges is how do I maintain a repeatable deployment process? Can I be sure that what I deployed into our Integration Server, is the same thing that I deployed into our UAT, and production environments?

In past projects, I have experienced 100+ page installation guides with time consuming manual changes. For one project, we even resourced a full time deployment team just to deploy and maintain our daily builds.

Now let me introduce you to the wonderful world of Virtualization :) In my current role we have access to an ESX/VMWare/VSphere virtualized server environment. How does this help with repeatable deployment you may ask?

Imagine this...
1. Daily Build runs via Team Build:
-> Compiles, Unit Tests etc.
-> Produces MSIs
2. Before deployment:
-> Target Server reverts to (snapshot: base)
-> MSIs are deployed (via the Daily Build)
-> Target Server state is (snapshot: build)
-> Testing is conducted (reverting to states as required)




Tomorrow, this all happens again... You can revert to a previous build, or base build at any given time. Automated, repeatable and simple.

The way that we have chosen to snapshot our servers from the Daily build script is to write some custom MSBuild Tasks which ultimately interact with the target virtual server. VMWare publish a number of APIs that you can use, including a command line tool called VMRun.exe, however with this tool you need to know which physical host the guest is on and the name of the vhd, which for me kind of defeats the purpose of using a central management interface like VSphere.

We chose to use the VMWare vi Server Web Service SDK, which is essentially a web service running on a Tomcat web server. This allows you to manage all of your virtual guests including snapshotting.

The VMWare SDK gives you a .Net solution written in C#, but simply following the build instructions only gets you half way there. [A word of warning: Don't simply add a web reference to the WSDL from your VSphere server. Whilst this may get you something that works, the performance of the generated proxy class is woeful! It took 4min to instantiate the proxy at runtime when I tried this. The SDK actually recognises this as a .Net serialization issue, and supplies a tool to optimize the generated proxy class].

For me, none of the batch files supplied worked out of the box and only seemed to support using VS2003 anyhow. At the end of the day what you need, is to generate your web service proxy class using the Optimization Tool supplied, otherwise it will run like a dog.

To get the VMWare SDK solution to build in VS2008:
1. Download and save the 2 WSDL files from your VSphere web server (afterall this is what you will be interacting with),
2. Run the Optimisation Tool supplied to generate your proxy classes,
3. Add these proxy classes to the solution and update any project references as required.
4. With a bit of commenting out, and removing projects that you will never use, you should be able to build the solution.

The projects that you need for snapshotting are AppUtil, VMSnapshot, and the Credential projects. When you build the VMSnapshot project you should end up with an executable VMSnapshot.exe and 4 assemblies (AppUtil, Credential, and the Proxy and it's serialization class).

VMSnapshot.exe should allow you to run snapshot related commands out of the box.
- list
- create
- revert
- remove

Once you have the command line tool, you can simply write a custom MSBuild Task to wrap around the executable. Add to your daily build and deploy script and enjoy!

Wednesday 24 March 2010

First. Blog. Ever.

Who would have thought... If you had asked me 5 years ago whether I would be blogging, I would have said, 'you've got to be dreaming'. I was one of those people that eagerly learned about every piece of technology that was put in front of me, and often wondered, what kind of people have the time to create webpages about random things that they are doing, or problems that they have solved? Did these people even work!?!? :)

Well here I am; now with close to 10 years experience in the IT arena, ranging from .Net development, high availability web application operations, technical architecture, and more recently as a Lead Architect on an enterprise scale Dynamics CRM implementation using Agile SCRUM and Team System.

Don't worry, this isn't a trumpet blowing blog. Over the past 12 months I have really embraced Dynamics CRM as a rapid business application development platform, or Anything Relationship Management / xRM as the industry prefers. My colleagues laughed when I began talking about 'leveraging the power of dynamics' like he-man summoning the power of greyskull, but is it amazing how much functionality you can rapidly develop without having to write Data Access and UI Layers; you can really focus on meeting business requirements.

With it's many benefits, this platform comes many challenges, particularly when you start to scale up the development team. This blog will aim to talk about the challenges that I face as a technical architect, as well as solutions that my team and I come up with along the way.

Over the following months (and all going well) years, I will be writing a series of articles on my experiences in solving technical problems, mainly around implementing Dynamics CRM and it's various integration options using .Net, SharePoint, BizTalk, SSIS, CISCO Phone Integration, as well as development and deployment challenges, using developer tools such as Team System and operational management aspects.

Well enough waffle; stay tuned.

Dave