Recovering Hyper-V virtual machines that have disappeared

Posted in Technology with tags , , , , , , , on August 24, 2010 by coolcomputerguy

This may sound strange but to anyone who has used Microsoft Hyper-V for server virtualization for any length of time knows, it is something you have either confirmed to be true or you believe you are losing your mind.

In test environments, disappearing virtual machines may have been attributed to not stopping at Starbucks that morning, assumed hallucinations due to lack of sleep from the all night server maintenance from the night before or simply doubt in the busy world of IT that the missing machine had actually been created in the first place or possibly accidentally been deleted somewhere in the fray.

In some cases, when the affected virtual machine is heavily relied upon for day-to-day business and it suddenly just isn’t there, this problem is confirmed and we start hunting for solutions.

For those that are not sure they saw correctly, I am here to confirm for you that Hyper-V Virtual Machines can and do disappear.  They sometimes disappear right before your very wary sleep deprived eyes as you stare unbelievingly at your Hyper-V Management Console, straining to find that virtual machine you spent 2 weeks setting up and not finding it in the list of available machines.

What happened to it?

Well, simply, the XML configuration file for that machine has most likely become corrupt which makes the Hyper-V management service unable to process it causing the machine to not appear in the Hyper-V console.

Now don’t just go and start deleting files and copying things around.  Hyper-V uses an amusingly complicated series of GUIDs cross linked in multiple XML files and similarly named folders in a particular hierarchy to keep all the virtual machines, their hard disks and their snapshots in sync.  One wrong move here and you will lose a snapshot or possibly the entire virtual machine.  This can also be recovered if you have the virtual disk files but that is research for another article.

Back to our corrupt XML file.  The solution to this problem is really very simple.  Find the XML configuration file for the virtual machine that just disappeared, make a backup copy of it and then open it in Internet Explorer.  You should notice if you scroll down through the file that IE cannot render the entire XML file.  This is due to some malformed XML that Hyper-V has randomly inserted into your file as a bonus just to give you more gray hair and raise your blood pressure a bit if it wasnt high enough already.

If you open your XML file in Visual Studio or some other IDE that marks up XML, you can see the malformed XML and with a little bit of examination and care, determine what needs to be fixed.  I have provided an example of one of my corrupt files below.  If you look carefully, you will see that there are two </configuration> tags at the end of the file and just after the first one, it appears that some of the information from just above it was mangled just a bit and then repeated resulting in some bad XML and a second end </configuration> tag.  I removed everything after the first </configuration> tag, saved the file, restarted my Hyper-V Management Service, and my virtual machine reappeared in my Hyper-V management console.

I have seen other examples of this where the XML file contained control characters or symbols which will cause the same problem.  Removing those characters and restoring the proper XML format usually fixes the problem.

So, when it appears that all is lost, it is actually a very simple fix.  Special thanks to Microsoft for giving me a heart attack and hopefully they can tighten this up in a future build.

Good Luck.

Example of the Malformed XML at the end of the configuration file.  The text in Red is the extra repeated xml.

<stopped_at_host_shutdown type=”bool”>False</stopped_at_host_shutdown>
</settings>
</configuration>l”>False</stopped_at_host_shutdown>
</settings>
</configuration>

The end of the XML file should look like this:

<stopped_at_host_shutdown type=”bool”>False</stopped_at_host_shutdown>
</settings>
</configuration>

To Stop and Restart the Hyper-V Virtual Machine Management Service from a command line, run the following two commands:

Net stop “Hyper-V Virtual Machine Management”
Net start “Hyper-V Virtual Machine Management”

Obama administration giving tax rebates for golf carts

Posted in Politics with tags , , , , , , , , , , , on October 28, 2009 by coolcomputerguy

Watching GMA (Good Morning America) on ABC this morning, as terrible as that program is, I was stuck there as I am home with my kids and wife who are sick, HOPEFULLY NOT WITH THE PANDEMIC SWINE FLU, which is another topic in itself.  Anyhow, they did a story on this Obama administration stimulus package where people can get up to $5,500 toward the purchase of a golf cart, which can cost between $8,000 and $10,000.  Some golf cart businesses are offering deals where a consumer can purchase a golf cart and then lease it back to them so they end up making $2000 by the end of the lease term, including the lease payments and the government credit.

What a deal! 

You would think George W would have thought of this, being that he is a white guy who plays golf, but NO, leave it to the current genius administration to come up with this one.  Did you hear about why the cash for clunkers program didnt include older cars being that the auto parts lobbyists threatened lawsuits.  Oh, sorry, so many idiotic stories, I cant stay focused.  Back to the golf cart story.

The worst part, Diane Sawyer and company chuckled at the story.  One person said, I never thought of buying one of these but with this kind of deal, how could I pass it up.  I guess I cant blame the guy for taking advantage of the governments stupidity in this down economy but then again, ITS OUR TAX MONEY!!  I would much rather spend that money on defense or on protective gear for our troops than so Billy Bob can drive a golf cart down to the Jiffy store when he needs cigarettes.  Oh, but dont worry, Billy Bob doesnt have insurance for his lung cancer caused by his 2 pack a day habit and lack of excercise from riding everywhere in a golf cart but the new health care plan we will be funding for him soon will cover him.  Whew, but I digress yet again. 

Back to the main story.  It gets even better.  The plan calls these high-tech golf carts, LSV’s or Low Speed Vehicles.  Good thing.  Then no one will realize that they are actually buying a GOLF CART!

I could continue to write about this chain of government policies to illustrate the longest active streak of blatant stupidity on record but I would be here for months and I need to finish this and get back to work so I can fund the next round of idiotic incentives.  Maybe there will be a government assisted Viagra program, or a cash for unwanted kids program next.  Hey, I never thought I would see things as stupid as I am seeing today so I am not sure where it will end.  Anything you can think of at this point, no matter how absurd it may sound, is obviously not far out of reach for this administration. 
 
For reference, I posted the actual wall street journal article below along with the link.  Since links to things like this on the internet have been known to disappear lately.  That though, is a whole other story.
 
From the Wall Street Journal – 10/17/2009
 
Cash for Clubbers
Congress’s fabulous golf cart stimulus
 
We thought cash for clunkers was the ultimate waste of taxpayer money, but as usual we were too optimistic. Thanks to the federal tax credit to buy high-mileage cars that was part of President Obama’s stimulus plan, Uncle Sam is now paying Americans to buy that great necessity of modern life, the golf cart.
The federal credit provides from $4,200 to $5,500 for the purchase of an electric vehicle, and when it is combined with similar incentive plans in many states the tax credits can pay for nearly the entire cost of a golf cart. Even in states that don’t have their own tax rebate plans, the federal credit is generous enough to pay for half or even two-thirds of the average sticker price of a cart, which is typically in the range of $8,000 to $10,000. “The purchase of some models could be absolutely free,” Roger Gaddis of Ada Electric Cars in Oklahoma said earlier this year. “Is that about the coolest thing you’ve ever heard?”

The golf-cart boom has followed an IRS ruling that golf carts qualify for the electric-car credit as long as they are also road worthy. These qualifying golf carts are essentially the same as normal golf carts save for adding some safety features, such as side and rearview mirrors and three-point seat belts. They typically can go 15 to 25 miles per hour.

In South Carolina, sales of these carts have been soaring as dealerships alert customers to Uncle Sam’s giveaway. “The Golf Cart Man” in the Villages of Lady Lake, Florida is running a banner online ad that declares: “GET A FREE GOLF CART. Or make $2,000 doing absolutely nothing!”

Golf Cart Man is referring to his offer in which you can buy the cart for $8,000, get a $5,300 tax credit off your 2009 income tax, lease it back for $100 a month for 27 months, at which point Golf Cart Man will buy back the cart for $2,000. “This means you own a free Golf Cart or made $2,000 cash doing absolutely nothing!!!” You can’t blame a guy for exploiting loopholes that Congress offers.

The IRS has also ruled that there’s no limit to how many electric cars an individual can buy, so some enterprising profiteers are stocking up on multiple carts while the federal credit lasts, in order to resell them at a profit later. We should note that some states, such as Oklahoma, have caught on to the giveaway and are debating whether to cancel or limit their state credits. But in Congress they’re still on the driving range.

This golf-cart fiasco perfectly illustrates tax policy in the age of Obama, when politicians dole out credits and loopholes for everything from plug-in cars to fuel-efficient appliances, home insulation and vitamins. Democrats then insist that to pay for these absurdities they have no choice but to raise tax rates on other things—like work and investment—that aren’t politically in vogue. If this keeps up, it’ll soon make more sense to retire and play golf than work for living.

Windows 2008 R2 – Upgrading Hyper-V Snapshots

Posted in Technology with tags , , , , , , , , , on August 28, 2009 by coolcomputerguy

If you have been using Microsoft Hyper-V with Windows 2008 Server like I have, you will probably want to upgrade your Windows 2008 servers to the R2 version which was released recently.  This upgrade seems to go very smoothly when run, although it does take about 2 hours.  When complete, your Windows 2008 server which was very Vista like before, will now be more like Windows 7 which is a definate improvement.

There are some things you should know about your existing Hyper-V machines and snapshots before and after upgrading. 

1) You have to shut down all your Hyper-V machines before upgrading or the install will stop.

2) If you have “saved state” on any of the Hyper-V machines, you will need to discard it because the saved states from Windows 2008 R1 Hyper-V are not compatible with Windows 2008 R2 Hyper-V.

3) Microsoft states that since snapshots use the saved state feature, that all snapshots will not work after upgrading to R2 except for the one that was last running when you shut down your virutal machine because that one will be updated during the upgrade process.

How can you update all these machine snapshots you have so painstakingly created?

Microsoft offers 2 suggestions for updating your Hyper-V virtual machines and their snapshots to be compatiable with Windows 2008 R2 Hyper-V. 

First, you can export all of your Hyper-V machines, then install Windows 2008 R2, then re-import them and they will be converted to work in the new format.  Since I do not have unlimited amounts of extra disk space to export many gigabytes of virtual machines off to, I opted for the 2nd option they suggest which is to convert each snapshot in the virtual machine after upgrading to R2.  This is where things went off track a bit. 

There is a kbase article published by Microsoft (KB957256) http://support.microsoft.com/kb/957256/ which discusses the update methods.  Method 2, updating each snapshot after upgrading to R2, starts out by saying you should right click on the snapshot you want to apply, select Take Snapshot and Apply, and that will take a snapshot of the currently applied snapshot and that the new snapshot will be compatible with R2.  This is not 100% accurate and not alltogether helpful or clear. 

First of all, you cannot select Take Snapshot and Apply from the right click menu because the option isnt there.  You must select the Apply option, then when prompted(if you didnt turn off the sticky prompt option) whether you want to just Apply or Take Snapshot and Apply, you can select it there.  Regardless, this wont work to upgrade your snapshot anyway unless you just happen to right click on the snapshot of the machines current state.  What will occur is that a snapshot will be taken at the point your virtual machine is currently running, then the snapshot you right clicked will be applied.  Keep in mind, the one you just right clicked hasn’t been updated yet, so after its applied, the machine will end up in a saved state and will not start.  Microsoft then mentions to delete the saved state, and then the machine will start which is true, but, this isnt the end of the process as they state.  You must then snapshot the running machine and discard the old snapshot to complete the process.  So, after a few minutes of messing around with this nonsense, I figured out the proper procedure and documented it below.  Microsoft was close, but not 100% accurate when documenting this one.  This is how you update each snapshot:

1) Apply the snapshot you want to convert.

2) Try to start the machine. (It will fail and end up with  saved state)

3) Delete the saved state and start the machine.  This time it should start up.

4) Confirm the running machine is in the state it should be for that snapshot and then create a new snapshot.**

5) Delete the old snapshot.

Continue this process with each snapshot you have until they are all converted. 

Microsoft then recommneds taking a snapshot of the final running machine.  Of course, only do this if you want a new snapshot of the currently running machine.

** Microsoft also mentions in the article that you should update the Integration Services (virtual machine extensions).  This will have to be done for each converted snapshot, then each would have to be re-snapshotted, but I have not done this yet because the machines appear to run fine using the old Integration Services so I will jump off that bridge when I come to it.

iPhone 3.0.1 update released – patches SMS vulnerability

Posted in iPhone with tags , , , , , , on August 3, 2009 by coolcomputerguy

In response to the hack publicized at the Black Hat security conference last week, http://mashable.com/2009/07/30/iphoneocalypse/, Apple released the 3.0.1 update on Friday July 31st 2009.   I applied the update without issue and I have not noticed anything different in the operating system.  The guys from the Black Hat conference were causing a panic on the boards last week as users cried out, how can Apple not fix this problem ASAP.  Apple was quiet as the news about this vulnerability spread but then  responded within 1 of the flaws official announcement at Black Hat with a security update that closes the hole.  I don’t know about you, but they can stay silent all they want if they are going to fix issues that quickly.  Kudos to Apple. 

As for the Black Hat guys, I honestly think some of them are irresponsible.  Sure they notified Apple of the vulnerability and gave them a couple weeks to respond before they demonstrated it at the conference.  However, I still feel their behavior is irresponsible.  I checked into hacking laws and while it is not illegal to announce how to hack a device, it is illegal to actually hack the device.  I dont know about you, but this seems odd to me.  Announcing how the vulnerabilty can be used is just as bad as actually using it. 

If you loaned your car to a friend you knew was drunk and he killed someone, you would be charged with manslaughter.   If you are irresponsible enough to announce and demonstrate how to hack a device or a particular piece of software, you are just as guilty of hacking as the hacker who exploits it.

Update – iPhone users guide is now in the iPhone

Posted in iPhone with tags , , on August 3, 2009 by coolcomputerguy

I believe this may have been added in OS 3.0 but I am not exactly sure because I just noticed it today.  If you open your Safari browser and click the Bookmarks button at the bottom (it looks like an open book), you will find two new bookmarks at the bottom of the list.  One is to the iPhone User Guide and one is to iPhone Web Applications.

Obama’s cash for clunkers program – Your tax dollars at work.

Posted in Politics with tags , , , , , , on August 3, 2009 by coolcomputerguy

So, how do you like your new car?  What new car you say?  Well, you just helped buy one.  Oh, there’s another… and another… and another.  You are buying cars all over the country right now.  You are helping numerous people all over the country buy new cars through the Cash for Clunkers program.  Just another awesome government program funded by you and I.   I believe I heard in the news yesterday the program was asking for another $2 billion in funding to continue.  Ah, money well spent.

Obama health care plan scares me

Posted in Politics with tags , , on August 3, 2009 by coolcomputerguy

I can’t hold back anymore.  This health care plan scares the crap out of me.  Our health care system already has problems that we need to try and resolve.  Completely changing the system is just going to be trading the devil we know for the devil we don’t.  Obama keeps talking about how great this is going to be.  Does anyone know anyone who has lived in Canada?  I do.  They have told me stories of it taking 3 months to get a doctors appointment.  I have heard of relatives cancer getting worse while waiting for the next test appointment.  There are also specialty doctors they can go to and pay out of pocket to be seen sooner.  I don’t know about you, but I can call my doctor early in the morning and be seen that afternoon or the next morning.  I also know that people who have no insurance can go to the emergency room and receive care for free paid for by our tax dollars.  So who doesn’t have health care coverage under the current plan?  It seems to me that we should focus on trying to fix a few of the issues our current system has instead of replacing it with a new system that will have numerous new issues to deal with.

iPhone How to guide

Posted in iPhone with tags , , , on June 25, 2009 by coolcomputerguy

For those looking for a users guide for iPhone, Apple has created a very nice how to guide with examples of how to do common tasks.

http://www.apple.com/iphone/how-to/#basics.introduction

Surprisingly iPhone 3Gs activation was easy. Restore – not so much.

Posted in iPhone with tags , , , , , , , , , on June 19, 2009 by coolcomputerguy

I was sure that the server would lock up and that my AT&T account would be somehow locked between being switched from my old iPhone sim card and my new iPhone 3Gs sim card but I was pleasantly surprised.  The activation process took about a minute to complete, my old iPhone is no longer working, my new iPhone 3Gs is working, and all appears ok.  I did run into a couple minor problems when restoring the backup of my old iPhone to the new iPhone 3Gs.  I have listed the issues I had below. 

The passwords for all my email accounts were not in my backup which was  a major pain.  I had to recall about 10 pop3 email account passwords that I havent had to remember in about a year.  I had to go reset one of them to get it to work. 

It appears as though the outgoing SMTP settings for all my pop email accounts have been cleared so I will need to reconfigure those.

I had to call AT&T to reset my voicemail password because I didnt know it.

I had to reset my voicemail greeting when I set up my voicemail on my new phone.

My exchange email account for work would not sync up even after re-entering the password.  The only way I could get it to work was to delete the account and re-add it.

My Favorites list showed only phone numbers after the restore.  I had to delete them and re-add them from my contact list to resolve that.

Other than these things, my phone is working fine now.

After many shenanigans with UPS, my iPhone 3Gs is here

Posted in iPhone with tags , , , , on June 19, 2009 by coolcomputerguy

Today at 9:30am, UPS delivered my new iPhone 3Gs right on schedule.  I am amazed that Apple got them to hold it until the 19th but even more amazed that they had to ask UPS to slow down the shipment because they were running ahead of schedule.  Many times in my life I have had packages from FedEx show up a day early but I have NEVER had a UPS package show up early.  I thought the iPhone would be the first thing I ever received early via UPS but Apple made sure that didn’t happen.  Well, off to activate and sync my iPhone for the first time.  Hope the Apple servers are ready for all these activations!

Follow

Get every new post delivered to your Inbox.