Moving to Windows 8, we started by configuring and testing our app on a VM then deploying it to a new machine.

Development Environment Upgrade - V to P

Our walk-through of using a Virtual Machine to deploy to a Physical Machine

We decided to move from Windows 7 onto Windows 8, so we could have a local development environment that more closely matches our services web tier which at this point in time is running on Windows Server 2012, the gain from Windows 8 in this case is access to IIS 8.0 and therefore WebSockets.

Picnic Developer Windows 8

Usually we get a new machine, and we just manually install a fresh copy of the OS, up until now this has been Windows 7. But this time around we had a desire to have a full development environment also in a Virtual Machine. Because we didn't have a suitable spare physical machine, we decided we would begin with a Virtual Machine, get that all set up and running, then prepare that and deploy it to the new physical machine. This is classified as a High Touch approach to environment deployment. But because we're a small team/company, this high touch approach is fine for us, especially since we don't often deploy new machines.

First things first, set up the VM ...

Development Environment

Making use of the free tool Oracle VM VirtualBox, it was a matter of just installing the OS, then getting stuck into configuring all the specific tools / frameworks that are required to run our application.

Picnic Dev on VM Box

So after a few hours, of downloading latest applications, installing VS, and all the other supporting tools, and some tweaking the environment was configured ready for development and working well.

So once the VM was ready, the next step is...

Sysprep

Sysprep prepares a computer for disk imaging or delivery to a customer by configuring the computer to create a new computer security identifier (SID) when the computer is restarted. In addition, Sysprep cleans up user- and computer-specific settings and data that must not be copied to a destination computer. For more information heck out the how it works on technet along with more detailed info.

If you know what you're doing just go to c:\windows\system32\sysprep and run it.

This is a very important step before deploying to a physical / another machine, there are some caveats related to Windows 8 and App Store updates, but because we didn't update any apps, or install any new ones we (so far) didn't have a problem.

Now we're ready to...

Deploy the Virtual Machine to Physical Hardware (V to P)

There's a lot of information out there, but I didn't find anything that laid things out as simply as I wanted, this is why we're sharing our experience with this for those that are looking for a simple approach.

Minor Issues

We selected a .VHD file type for the VM, and then realised later that Ghost only supported it's own format and VMDK files. But this was a very simple matter of converting the VHD to VMDK using the WinImage tool. This did have another repercussion, the boot partition (MBR) fell off of the VMDK file in the process.

Convert to VMDK

Symantec Ghost

We had access to Ghost here, and for the kind of deployment approach we are taking it was very easy to use. Going in to this process I didn't think it would help out, but as you will soon see turned out very well.

The only feature of Ghost we required in this case was a boot image, which was easily created onto a USB key, via;

> Tools > Boot Wizard > Windows PE > Standard Ghost Boot Disk > {follow wizard steps}

Ghost Wizard for Boot Disk

Deployment

The physical machine has 2 drives, an SSD for the OS and another spinning rust drive, we simply put the VMDK file on that other drive (by disconnecting it from another machine), this allowed for a faster deployment as it was all local within the machine.

Ghost copy in progress

Ghost got us 98% of the way there easily. With the 2nd minor issue of the MBR not being part of the VMDK file. Once the Ghost process copied the contents of the VMDK file onto the primary disk, we rebooted with only that drive connected, and got to a well known failure screen from the Windows Boot Manager.

Boot Mgr Failed

Having seen that screen at least 50 times, and having it usually fixed by simply using the 'Automatic Repair' wizard from a Windows installation media, that was the first step.

And...

Yes! it worked, that's why Ghost got us 98% there, and then Windows 8 installation media helped with the last bit.

Win 8 Auto Repair

Conclusion

This process worked, and was a lot easier than I expected. Seeing how hands on it was we appreciate that it doesn't scale. Because it's only 1 image we have to manage, we won't have any major issues about keeping this image up to date in terms of patches, so it's easier to deploy again next time.

Process Summary

  1. Using Oracle VM VirtualBox create, install OS, and prepare. (~ quite a while)
  2. Convert your VHD file to VMDK. (If you don't have a VMDK file) (~ 5 minutes)
  3. Set up a Ghost (or equivalent) boot disk (~ 5 minutes)
  4. Deliver VMDK file to target machine (~ 10 minutes)
  5. Boot from Ghost (or equivalent) boot disk and deploy the image. (~ 15 minutes)
  6. Repair the MBR (if your VMDK file does not have a suitable one). (~ 3 minutes)
  7. Done.

Because this is a High Touch approach, eventually for us it'll become a time sink, so we'll be looking to take advantage of Chef in the same way we do for our production deployments on AWS. But if you exclude the machine set up, this deployment tool less than 45 minutes, shorter if it's repeated and an existing HD with image is used.

Nick Josevski
Posted by: Nick Josevski  
Last revised: 13 Jun, 2013 12:18 AM
 

Comments

No comments yet. Be the first!

blog comments powered by Disqus