Home | Site Map | Cisco How ToNet How To | Wireless |Search | Forums | Services | Donations | Careers | About Us | Contact Us|

Move Virtual Hard disk to different drive

Active Directory, Domain, DNS, WINS, DHCP, SBS, New Releases.

Move Virtual Hard disk to different drive

Postby guest » Mon Jan 31, 2011 4:27 pm

I read thsi article, but can't follow the instruction. Which symbolic links he is talking about?

Moving a Windows Server 2008 Hyper-V virtual machine
Windows Server 2008 Hyper-V stores a list of virtual machines in %systemroot%\ProgramData\Microsoft\Windows\virtualisation\Virtual Machines. In that folder are a set of symbolic links, that are linked to the actual config files for each virtual machine.

To move a virtual machine:

1.Shut down or suspend the virtual machine
2.Delete the symbolic link in the folder mentioned above. The VM will disappear from the Windows Virtualisation Management MMC console (if you have it open). To delete a symbolic link, you can use the del command in a command window
3.Move the virtual machines files (VHD virtual hard disk file, configuration files and so on) to the new location
4.Open the virtual machine's configuration file (e.g. using Notepad.exe) and update any references to physical paths. Typically you'll need to update the location of the virtual hard disk and saved state location. The configuration file is a GUID with an XML extension, such as 0A8D4907-82C6-11DC-8061-02004C4F4F50.xml
5.Create a new symbolic link to the virtual machine's XML configuration file. This can be done using the mklink.exe file (mklink.exe /? for how to create a link to a file)
To make it easier to create the links, you can output the contents of the virtual machines folder using dir and then piping it to a text file (e.g. dir > VMs.txt). Open the text file in notepad.exe, and for each machine will you have an entry like:

14/01/2008 12:22 PM <SYMLINK> 0A8D4907-82C6-11DC-8061-02004C4F4F50.xml [D:\WSVs\SVR03-ISA06-1\Virtual Machines\0A8D4907-82C6-11DC-8061-02004C4F4F50.xml]

It's a simple matter of editing to turn this into:

mklink 0A8D4907-82C6-11DC-8061-02004C4F4F50.xml e:\newLocation\SVR03-ISA06-1\Virtual Machines\0A8D4907-82C6-11DC-8061-02004C4F4F50.xml

Save this as a batch file (.bat) and just doubleclick to create the new link. The VM should then show up in Windows Virtualisation Management MMC console.

EDIT: this technique was tested with Windows Server 2008 RTM and Hyper-V Beta 1. It may not work with subsequent builds of Hyper-V. I will update this post when Hyper-V goes RTM
Tablet and Smartphone Setup Guide

Troubleshooting Vista Wireless
Posts: 10191
Joined: Mon Nov 27, 2006 1:10 pm

Re: Move Vuirtual Hard disk to different drive

Postby chicagotech » Sun May 08, 2011 8:23 am

2. The export method is ok. Just that there is some problem with this VM.

3. Before you export a VM, you must shut down the VM, delete all snapshots, and let the system to merge all snapshots.
Note: It will take much time.

4. If the system needs to merge snapshots, it will require more disk space. Plese assure this.

5. What about other VMs?~ All meet this error?

6. You can also try to reboot the host machine, and use a clean boot of host machine to test:
a. Click Start -> Run
b. Input msconfig and click OK.
c. Click Service Tab and select Hide all Microsoft Services and select Disable All.
Note: Please remember what you disable in step c&d.
d. Click Startup Tab and select Disable All.
e. Click OK and reboot the computer.

7. That error message means that some files are missing. It's possible that you have deleted some snapshots or moved some snapshots manually (not in Hyper-v console).
Have you done this?

8.A similar KB for you:
Error message when you try to export a virtual machine on a Windows Server 2008-based computer that uses Hyper-V: "An error occurred while attempting to export the virtual machine"
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
How to Setup Windows, Network, VPN & Remote Access on http://www.HowToNetworking.com
Site Admin
Posts: 6708
Joined: Mon Nov 27, 2006 1:24 pm
Location: Chicago USA

Return to Windows

Your Ad Here

Who is online

Users browsing this forum: No registered users and 6 guests