Alexander’s Blog

October 11, 2011

Difference Between Hyper-V Saved State and a Snapshot

by @ 10:54 am. Filed under Virtualization, Windows 2008

When working with Microsoft Hyper-V, it is helpful to understand the difference between the Saved State and a Snapshot. Here is a brief explanation of both.

Snapshot

A snapshot can be taken whether the virtual machine (VM) is running or not. It is a point in time of the state of a VM. You can revert back to a previous point in time whenever there is a need. For example, if you plan to install a service pack, you can take a snapshot before you install the service pack and if things go wrong, you can revert to the point in time before you installed the service pack. It is similar to the System Restore concept in Microsoft operating systems. A snapshot consists of three components:

  1. A single xml file for the VM configuration. This includes all the settings that you configured for the VM, such as memory, number of processors, description of the VM, etc.
  2. A memory save state file.
  3. A difference disk, which is a file that ends with the extension .avhd. There will be a separate .avhd file for each snapshot.

Saved State

A Saved state is a point in time of a running VM, however, unlike a Snapshot, a Saved state can only take place on a VM that is running. Also, a Saved state can be restored only once (as long as you have not applied a Snapshot since the system state was saved). This is different than Snapshot because a Snapshot can be restored multiple times. In fact, you can go back and forth between different Snapshots to the exact point in time when the Snapshots were taken.

Taking a Snapshot

To take a Snapshot, simply right-click a VM in the Hyper-V console and select Snapshot. The VM may be running or shutdown. You may also delete a Snapshot, whether the VM is running or not.

Saving the State

To save the system state, right-click the VM while it is running and select Save. Your VM will appear to be shutdown. To resume, you simply right-click the Saved VM and select Start.

As great as Snapshots are, keep in mind that according to Microsoft if you have more than three Snapshots for a VM, you may experience performance degradation. However, the degradation will depend on the amount of RAM and processors that are available and how you have configured the system resources.


Copyright ©2011 Zubair Alexander. All rights reserved.

October 5, 2011

Free Windows Server 2008 R2 Evaluation Virtual Images for Hyper-V

by @ 7:31 am. Filed under Virtualization, Windows 2008

A lot of my students ask me if they can get a copy of the Hyper-V virtual image that they use in class to do labs. The answer to that question is no. Microsoft does not allow training centers to distribute those images because of licensing requirements. However, Microsoft was kind enough to allow people to download a free 180-day evaluation version of Windows Server 2008 R2 Enterprise as well as Windows Server 2008 Server Core edition.

The evaluation period is 180-days (6 months), which is a long time to evaluate and experiment with the product. This is perfect for developers, testers, trainers, and students.

You can download the images here.

July 5, 2011

How to Increase Virtual Machine Disk Space in VMware ESXi 4.1

by @ 8:48 am. Filed under Articles, Tips & Tricks, Virtualization, Windows 2008

If you are running VMware ESXi 4.1 you can increase the size of the virtual machine (VM) relatively easily once you know how. But if you have any snapshots, it can be a pain. Keep in mind that increasing the size of the VM is different than increasing the size of the disk partition on the host computer.

Let’s use the following scenario as an example. Your ESXi server’s hard disk is 1TB in size and you have a VM running a Windows Server 2008 R2 guest operating system that has two drives, a 30GB drive C and a 20GB drive D. After a few months you realize that you have installed a lot of programs and your VM hard disk is running out of space. Over the last few months you have taken a dozen snapshots. You go to the vSphere Client utility and select the VM. You select Edit Settings and select the hard disk that is running out of disk space but the option to expand the disk is grayed out. This is likely if the VM has snapshots. You must power off the VM and then delete the snapshots before you can expand the disks.

Once that is take care of, you need to edit the VM’s settings. Here are the steps.

NOTE: The option to Edit Settings will be grayed out if you are in the middle of deleting a snapshot.

  1. Make sure your ESXi 4.1 server has been backed up.
  2. Start the vSphere Client utility.
  3. Select the VM that’s running out of disk space.
  4. Right click the VM and select Edit Settings.
  5. On the Hardware tab select the virtual hard disk (e.g. Hard disk 1).
  6. On the right hand side, under Disk Provisioning increase the Provisioned Size then click OK. For example, if you have two disks and you want to increase the size for drive C from 30 to 50GB and drive D from 20 to 25GB, increase the size using the up arrow and then click OK.
  7. Restart the VM.
  8. At this point you have increased the size of the disk in VMware but you need to do the same in the operating system. In Windows Server 2008 R2 go to Server Manager, Storage, Disk Management. You will notice unallocated space at the end of the disks.
  9. Right-click drive C and select Extend Volume. Follow the wizard to extend the volume. It should take only a few seconds to run through the wizard. Repeat the steps for drive D.
  10. Your drive size will increase right away and there is no need to reboot the computer.

Troubleshooting VMware Snapshots Issues

If in step 6 you are unable to increase the size of the disk because the provisioning option is grayed out, you need to make sure that you delete all the existing snapshots. VMware snapshots are very different than Hyper-V snapshots. Frankly, they are much more complicated and are meant to be used only temporarily. You heard me right. Unlike Hyper-V snapshots which can be actually useful in the long term because you can keep a bunch of snapshots indefinitely and go back and forth between them without any problem, VMware is not designed to use snapshot for similar purposes. It is meant to be used for 24-28 hours after which you should delete them. If you don’t, you can run into some serious problems. First of all, deleting snapshots takes seconds or a couple of minutes in Hyper-V. In VMware it can take hours. If you have a 30GB VM disk and you have old snapshots that you didn’t delete within a couple of days, it can take anywhere from an hour to several hours to delete each snapshot. And that’s not the bad news. What’s worse is that VMware is infamous for hanging at 95% (or sometimes at 99%) when you delete a snapshot. On my ESXi server it always hangs at 99%. Sometimes if you wait a few hours it may finish the process. Other times you can wait over 12 hours and it will still be stuck at 95% (or 99%). This is a known issue with VMware for some time now. Do an Internet search for “VMware stuck at 95%” and see how many hits you get.

VMware can get stuck not just when you delete the snapshots (a common occurrence) but also when you shutdown or power off the VM. Although this problem is relatively uncommon. To work around this problem, you can either use SSH to connect to your server and restart the Management Agents, or you can go to your VMware server’s console and restart the services. Here are the steps as documented by VMware in this KB article.

Restart Management Agents Using SSH

  1. Logon to the ESXi host as root.
  2. Type service mgmt-vmware restart and press Enter.
  3. Type service vmware-vpxa restart and press Enter.
  4. Type logout and press Enter to disconnect from the ESX host.

Restart Management Agents Using the Console

  1. Connect to the console of your ESXi host.
  2. Press F2 to customize the system.
  3. Login as root.
  4. Using the Up/Down arrows navigate to Restart Management Agents.
  5. Press F11 to restart the services.
  6. When the service has been restarted, press Enter to exit.
  7. Press ESC to logout of the system.

If you are deleting one snapshot at a time you may have to repeat the above step for restarting the Management Agents each time when the snapshot hangs at 95%.

The quicker way to delete the snapshots is to use the Delete All option. Depending on how old the snapshots are, the size of the snapshots can be large and it can take considerable time. If you notice that you have deleted all the snapshots and the provisioning option is still grayed out, this is because the snapshots are not actually deleted, even though there is nothing in the Snapshot Manager. You can browse the Datastore and see all the snapshots. If you run into this issue, try the following tips.

Tip #1

Create a snapshot and then delete it right away. This may delete all the existing snapshots and you will be able to provision the disks.

Tip #2

Power down the VM, create a snapshot and the delete it right away. I have experienced that when the first technique doesn’t work, the second one does.

Moral of the Story

Do not use snapshot in VMware ESXi 4.1 for more than 1-2 days. Use snapshots temporarily, not as a method to backup or to go back and forth between snapshots. If you are a developer, trainer or a tester that needs to use snapshots on a consistent basis then consider switching to Microsoft Hyper-V as a solution. While Hyper-V’s snapshots have their own issues, they are not quite as problematic as in VMware.


Copyright ©2011 Zubair Alexander. All rights reserved.

June 6, 2011

Error: Word experienced an error trying to open the file

by @ 11:08 am. Filed under Microsoft Office, SharePoint, Tips & Tricks, Windows 2008

Have you ever experienced the following error in SharePoint Server 2010 when you try to open a Microsoft Word 2010 file? I have run across this error a few times on Windows Server 2008 R2 computer running SharePoint Server 2010 and Office 2010.

Word experienced an error trying to open the file.

Try these suggestions.

* Check the file permissions for the document or drive.

* Make sure there is sufficient free memory and disk space.

* Open the file with the Text Recovery converter.

Here’s a solution that has worked for me.

  1. Open Word 2010.
  2. Click File, Options, Trust Center, Trust Center Settings.
  3. Select the Protect View option.
  4. Deselect all the Protected View options. You may not have to disable Data Execution Prevention mode. Experiment with the various options until you get the results.
    WARNING! Obviously, depending on your environment and security requirements you may be taking risks when you disable Protected View. Microsoft recommends that you do not change any Trust Center settings. I know, I know! Easy for them to say.

  5. Open Word 2010 file. It should open fine.
  6. I have noticed that once I am able to open the file I can go back and enable the Protected View and it still open the files just fine. Hmmm? I haven’t spent enough time to really research this but just wanted to let you know.

You may also experience this error in other Microsoft Office 2010 applications. Just use the same method to disable Protected View.

May 30, 2011

Turn Windows 7 into a Free Wireless Router

by @ 9:04 am. Filed under Applications, Windows 2008, Windows 7, Wireless/Mobile

You may have seen software that turns your Windows 7 computer into a wireless router. In the past, I have downloaded Connectify software. On paper it looked good but when I installed the free version of Connectify I discovered that I could only use WEP. There was no support for WPA2-PSK as advertised on their homepage. I am guessing they must have a paid version of Connectify that will allow people to use security. Anyone referring to WEP protocol as secure loses credibility right off the bat. WEP does not provide end-to-end security and is not considered secure by most security experts today. If that wasn’t bad, Connectify only allowed me to use a password that was limited to something like 4-12 characters and the password was limited to numbers 0-9 and letters a-f. That’s right, you can only use letters a-f. Bottom line: Do not let your friends and family install the free version of Connectify. It’s security a joke.

Recently I ran across another software, developed by a fellow MVP by the name of Chris Pietschmann. Chris is a Windows Live Platform MVP and his free, virtual router software is available from Microsoft’s CodePlex community site, which is a distribution point for open source software. The Virtual Router software turns any Windows 7 or Windows Server 2008 R2 computer into a WiFi Hotspot using Windows 7′s Wireless Hosted Network (Virtual WiFi) technology. Virtual Router allows you to wirelessly share any Internet connection (LAN, WiFi, Cable Modem, Cellular, or even dial-up modem) with any WiFi device (Laptop, Smart Phone, iPod Touch, iPhone, Android Phone, Zune, Netbook, wireless printer, etc.).

The software, written entirely in C#, does not have the password limitations of Connectify. Another good thing about the Virtual Router is that it is completely free of ads. And the best thing about the Virtual Router is that it defaults to WPA2 for secure wireless connectivity. WPA2 is one of the most, if not the most, secure wireless encryption available today.

The software is currently in its beta version. You can download beta 0.9 here.

Contact E-mail | Terms of Use | Privacy Policy

Copyright ©2010 Zubair Alexander. All rights reserved.

Internal Links

Search Blog

Categories

Archives

May 2012
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  

RSS Feeds

TechGalaxy Visitors

25 queries. 0.418 seconds