Category Archives: Virtualisation

Connect Cloud Services to Virtual Machines in Windows Azure

Chris Padgett, the App Dev practice lead for Kloud Victoria has a great post on the Kloud blog on how you can connect a website running on Azure PaaS with a database running on Azure IaaS.

Recommend you to take a read:

http://blog.kloud.com.au/2013/06/02/connecting-cloud-services-with-virtual-machines-in-windows-azure/

Clean Backups Using Windows Server Backup and EBS Snapshots

One of the powerful features of AWS is the ability to snapshot any EBS volume you have operating. The challenge when utilising Windows 2008 R2 is that NTFS doesn’t support point-in-time snapshotting which can result in an inconsistent EBS snapshot. You can still create a snapshot but it may be that one or more file that was mid-change may not be accurate (or usable) in the resulting snapshot.

How to solve

The answer, it turns out, is fairly easy (if a little convoluted) – Windows Server Backup PLUS EBS snapshots.

In order for this to work you will need:

1. Windows Server Backup installed on your Instance (this does not require a reboot on install).

2. An appropriately sized EBS volume to support your intended backup (see the Technet arcticle on how to work out your allowance – remember you can always create a new volume later if you get the size wrong!)

3. Windows Task Scheduler (who needs Quartz or cron ;)).

4. Some Powershell Foo.

Volume Shadow Copy using the new EBS Volume

Once you have created your new EBS volume and attached it to the Instance you want to backup, open up Windows Server Backup and select what you want to backup (full, partial, custom – to be honest you shouldn’t need to do a “bare metal” backup….)  Note that Windows Server Backup will delete *everything* on the target EBS volume and it will no longer show up in Windows Explorer – it will still be attached and show up in Disk Manager, but you can’t copy files to or from it.

The benefit of Windows Server Backup is that it will utilise Windows Volume Shadow Copy Service (VSS)  resulting in a clean copy of files – even those in-flight at the time of backup.  This gets around the inability to “freeze” NTFS at runtime.

Set your schedule and save the backup.

Snapshot the backup volume

Now you have a nice clean static copy of the filesystem you can go ahead and create an EBS snapshot.  The best way I found to schedule this was to use some Powershell magic written by the guys over at messors.com.  I slightly modified the Daily Snapshot Powershell to snapshot a pre-defined Instance and Volume by calling the CreateSnapshotForInstance function that takes an Instance and Volume identifier.  The great thing with this script setup is it auto-manages the expiry of old snapshots so my S3 usage doesn’t just keep on growing.

I invoke this Powershell on the success of the initial Windows Server Backup scheduled task by using the Task Scheduling – see this post at Binary Royale on how to do this (they send an email – I use the same approach to do a snapshot instead).

The great thing about the Powershell is that it will send you an email once completed – I have also setup mail notifications at completion of the Windows Server Backup (success, failure, disk full) so I can know when / if the backup fails at an early stage.  Note that in Windows Server 2008 R2 you can send an email right in Windows Task Scheduler – on AWS you’ll need to have an IIS smart host up and running to support this though – see my earlier post on how to set up a IIS SES relay host.

Summary

The benefit of this approach is a consistent state for your backup contents as well as an easy way to do a controlled restore at a later date (“create volume from snapshot” in the AWS management console and then attach to an Instance).  Additionally you achieve a reasonably reliable backup for not much more than the cost of EBS I/O and S3 I/O and storage costs.

Hope you find this useful.

Tagged , , , ,

Fix Windows 8 and Hyper-V Virtual Switch Problems

Wow, that hurts!

One reason I decided to jump onto the Windows 8 bandwagon was that I finally had access to a native VM environment that supports 64 bit operating systems.  Unfortunately, though, I’ve just burnt a couple of hours trying to figure out how to get Hyper-V and Windows 8 to play nicely with one another at a networking level.

My problem presented itself as loss of IP network connectivity which meant my host didn’t have any form of network access.

A quick look around online suggests a few people have had problems as well that sound way, way worse than mine (re-install the host OS, really?!)

The Solution(s)

This may not work for everyone… I’m running a Lenovo T420s that has the out-of-the-box Windows 8 drivers for all its components as Lenovo haven’t moved past beta with their drivers as yet.

Network adapters are: wired: Intel 82579LM Gigabit; wireless: Lenovo 11b/g/n Wireless LAN PCI Express.

I have this approach working for the wired and wireless connections in my machine – the fix is slightly different for each connection type, so here they are.

Wired

1. Create Your virtual switch and change no defaults (apart from the Name if you like).  This is how it looks:

How your wired Virtual Switch should look.

After you apply this your underlying physical connection will cease working.

2. Open up Control Panel > Network and Internet > Network Connections.

You will find that you now have “Ethernet” and “vEthernet (Your Switch Name)” connections.

3. Right click on “Ethernet” and click “Properties”.  Under the Networking Tab select all items in the “This connection uses the following items” and then click “OK”.

Windows will now give you a nice warning about items being disabled (such as IPv4, etc).  Click “Yes” on this dialog.

At this point you will see the “vEthernet” connection suddenly switch to “Identifying…..” and a few moments later you’ll be connected to your network (if you’re on a Windows domain the domain name will show).

Wireless

This process is slightly different as using a Wireless connection creates a Network Bridge as part of the process of setting up a Virtual Switch.

Do the above steps but select your wireless network connection instead this time.

When you are finished you will see two new items in your Network Connections: “vEthernet (Your Wireless Switch Name)” and “Network Bridge”.

Right click on the “Network Bridge” and click “Properties”. Under the Networking Tab select all items in the “This connection uses the following items” and then click “OK”.

Windows will now give you a nice warning about items being disabled (such as IPv4, etc).  Click “Yes” on this dialog.

As with the Wired connection above you should now see your “vEthernet” (wireless) connection switch to “Identifying…” followed shortly by a working network connection.

That’s it – simple – no reinstalling or driver updates are any other shenaningans.

Enjoy your Windows 8 – x64 Hyper V environment!

BTW – you shouldn’t need to jump through all these hoops to get this working and I’m not sure why these problems happen – I was very close to switching back to VirtualBox but thought I’d have one last go.  I’m hoping a future update from Microsoft will resolve these sorts of problems.

Update

I have had a few issues with Wireless – primarily I think due to roaming between different types of wireless networks – my initial setup was on a Windows domain and when I tried to connect wirelessly on my home network (running via a Cisco home business device) I couldn’t get a connection.  After a few days working on wired I’ve just switched back to wireless and it’s all working well (surprisingly).  So… you’re mileage may vary for wireless setups.  Let me know your experiences and I’m happy to add links to useful blogs or fixes for these sorts of issues.

I find that if wireless isn’t working that you need to disable your Wireless Virtual Switch on Windows 8 and re-enable it and you should find that the connection comes back to life.

Update 2 – Windows 8.1

I’ve been lucky enough to be running a Windows 8.1 Preview build on the same Lenovo I’ve had problems with in the past and it looks (fingers crossed) like the problem may be resolved. I haven’t got the Hyper-V environment exactly the same as my old Windows 8 build just yet but I do have Hyper-V installed. What I noticed, and perhaps this is the root cause of all the evil, is that the MAC address is being changed when I pop another VM up (currently a Windows Phone 8 emulator which uses Hyper-V) and in many environments that can cause a problem. Will keep you posted!

Tagged , , , ,