How to recover Hyper-V Virtual Machine manually

Document Sample
How to recover Hyper-V Virtual Machine manually Powered By Docstoc
					How to recover Hyper-V Virtual Machine manually (unsupported ways...)

My remark: The following methods do not restore the memory state and the unsaved data of the virtual
machines.


Method 1:
Easy enough, you create a new VM choose the option “attach a virtual hard disk latter” or “Use an existing virtual
hard disk” and then map the VM to the disk used before by the other “missing” VM, of course, you can copy the
disk to the new VM folder to keep all files together.

Nah….. I need the VM configuration, those configurations were critical to my tests and I don’t have the
configuration paper with me.




Method 2:

                                                       First go to the “missing VM folder\virtual Machines\” and
                                                       take note of the file {GUID}.xml (In this scenario is the
                                                       71DB1869-534A-4B0B-B2B8-B89170FC0EF0.xml).




Now open the Hyper-V mmc and create a new VM with
the same name, and point the new VM to the same
drive/folder where the “missing VM” is at.




                                                       Choose the option “attach a virtual hard disk latter” and
                                                       do a next, next, thing until you finish the VM creation
                                                       process.
                                                     Now go to the VM folder and under “Virtual Machines”
                                                     folder you have 2 GUIds.xml, the original 71DB1869-
                                                     534A-4B0B-B2B8-B89170FC0EF0.xml (that you take
                                                     note in the first step) and the new (in this scenario)
                                                     E5D8FBFC-4E01-4D48-AE95-1CF1630E2C24.xml that
                                                     refers to the new VM (Note: The GUIDs that you have,
                                                     will differ from these).




                                      The next step is to copy everything that is inside of the old 71DB1869-
                                      534A-4B0B-B2B8-B89170FC0EF0.xml to the new E5D8FBFC-4E01-
                                      4D48-AE95-1CF1630E2C24.xml, yes, everything… Basically you’re
                                      replacing the contents of the new {GUID}.xml with data from the old
                                      one. Save the file with the same name in the same place replacing the
                                      existing one.




Next step, open the E5D8FBFC-4E01-4D48-
AE95-1CF1630E2C24.xml, and the replace
everything that has the 71DB1869-534A-
4B0B-B2B8-B89170FC0EF0 with E5D8FBFC-
4E01-4D48-AE95-1CF1630E2C24. Save the
file replacing the existing one.
                                                            Next step, copy the files that are inside the
                                                            “F:\VM01\Virtual Machines\71DB1869-534A-4B0B-
                                                            B2B8-B89170FC0EF0” to “F:\VM01\Virtual
                                                            Machines\E5D8FBFC-4E01-4D48-AE95-
                                                            1CF1630E2C24”, you must also rename the files (.bin
                                                            and .vsv) that are inside that folder to match the new
                                                            GUID.



                                                           If you have snapshots, then you also need to rename
                                                           some files and folders inside Snapshots folder. Open
                                                           “VM01\Snapshots” folder. Rename the folder
                                                           “VM01\Snapshots \71DB1869-534A-4B0B-B2B8-
                                                           B89170FC0EF0” to “VM01\Snapshots\E5D8FBFC-
                                                           4E01-4D48-AE95-1CF1630E2C24”. Then open the
                                                           “VM01\Snapshots\{GUIDofTheSnapshot}” and
                                                           rename the files inside that folder (.bin and .vsv) to
                                                           match the GUID of the new VM (If you have multiple
snapshots, you have to repeat the same process to each one).
Now, open “VM01\Snapshots\{GUIDofTheSnapshot}.xml” and replace the values with “71DB1869-534A-4B0B-
B2B8-B89170FC0EF0” with the new VM GUID “E5D8FBFC-4E01-4D48-AE95-1CF1630E2C24”.
(If you have multiple snapshots, you have to repeat the same process to each one).

Now is time to allow access to the Service SID access to all files in VM01, from cmdline type:

icacls F:\VM01\ /T /grant "NT VIRTUAL MACHINE\E5D8FBFC-4E01-4D48-AE95-
1CF1630E2C24":(F)

The last step is to manually create a symbolic link and grant the proper permissions to each individual snapshot
that has a {GUID}.xml inside the VM01\snapshots folder (in this case there’re 2 snapshots).

mklink "C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\324E6E76-77EC-4671-9E25-
3D4B5D3133BA.xml" "F:\VM01\Snapshots\324E6E76-77EC-4671-9E25-3D4B5D3133BA.xml"

mklink "C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\D6EC4773-75A6-49E7-84D2-
3B619D1D450C.xml" "F:\VM01\Snapshots\D6EC4773-75A6-49E7-84D2-3B619D1D450C.xml"

Now give access permissions to the new VM Service SID access.

icacls C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\324E6E76-77EC-4671-9E25-
3D4B5D3133BA.xml /grant "NT VIRTUAL MACHINE\E5D8FBFC-4E01-4D48-AE95-1CF1630E2C24":(F)
/L

icacls C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\D6EC4773-75A6-49E7-84D2-
3B619D1D450C.xml /grant "NT VIRTUAL MACHINE\E5D8FBFC-4E01-4D48-AE95-1CF1630E2C24":(F)
/L

Go to the settings of the VM01 and assign the proper Network switch.
Start VM01 and you’re DONE!!!!
Are you NUTS!!!! That’s too much work for a VM recovery!!!! And if I had 20 VMs to recover, that process will
take the entire month…


Method 3:
This method is simpler, we’ll re-assign the “missing” Symbolic links and give permissions to the Service SID.

Using mklink, create the Symbolic link under "C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines"

mklink "C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\71DB1869-534A-4B0B-
B2B8-B89170FC0EF0.xml" "F:\VM01\Virtual Machines\71DB1869-534A-4B0B-B2B8-
B89170FC0EF0.xml"

Now give access permissions to the service SID to this Symbolic link.

icacls "C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\71DB1869-534A-4B0B-
B2B8-B89170FC0EF0.xml" /grant "NT VIRTUAL MACHINE\71DB1869-534A-4B0B-B2B8-
B89170FC0EF0":(F) /L

Then you need to give access permissions to the Service SID to all files in VM01

icacls F:\VM01\ /T /grant "NT VIRTUAL MACHINE\71DB1869-534A-4B0B-B2B8-
B89170FC0EF0":(F)

Since VM01 has also Snapshots, we need to create the correspondent symbolic link and give the necessary
permissions to the files (This process must be done to each snapshot).

mklink "C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\324E6E76-77EC-4671-9E25-
3D4B5D3133BA.xml" "F:\VM01\Snapshots\71DB1869-534A-4B0B-B2B8-B89170FC0EF0.xml"

mklink "C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\D6EC4773-75A6-49E7-84D2-
3B619D1D450C.xml" "F:\VM01\Snapshots\71DB1869-534A-4B0B-B2B8-B89170FC0EF0.xml"

Now, assign the permissions:

icacls C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\324E6E76-77EC-4671-9E25-
3D4B5D3133BA.xml /grant "NT VIRTUAL MACHINE\71DB1869-534A-4B0B-B2B8-B89170FC0EF0":(F)
/L

icacls C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\D6EC4773-75A6-49E7-84D2-
3B619D1D450C.xml /grant "NT VIRTUAL MACHINE\71DB1869-534A-4B0B-B2B8-B89170FC0EF0":(F)
/L

Go to the settings of the VM01 and assign the proper Network switch.
Start VM01 and you’re DONE!!!!
Enjoy.


My remarks: this method will not work if the virtual machine is moved to a new host.

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:20
posted:10/15/2011
language:English
pages:4
chenleihor chenleihor
About