網頁

2012年4月15日 星期日

Clone Hyper-V VM with different SID

In the corporative virtualization, we will deploy Microsoft VM to production environment because its cost is less than VMWare product. For realizing Microsoft VM, I will build a lab to test the related status. It includes clone VM mechanism after installing OS and application into physical equipment.

When I finish converting physical machine to virtual machine by Microsoft Vhd2Disk tool and boot it by Hyper-V, I find out that exist the garbage partition “Drive E” because I just want to convert OS partition “Drive C” to VM.
ScreenHunter_25 Apr. 11 17.08

So next action need to find a solution to delete this partition, I think.
I search some solution by Google and find out a tool can help me to finish this target. What’s Tool? That is “VhdResizer”.

It is very simple tool to select source vhd file, assign destination vhd file,Type and new size next to execute it by pressing resize” button. But it is very important that New Size need to large than Min Size, cannot set equal to Min Size.
ScreenHunter_31 Apr. 11 19.36

After Shrinking the garbage partition and creating a new VM to mount new vhd, the partition will add 10 GB unused space.
ScreenHunter_05 Apr. 12 18.02

Now we need to do “Extend Volume” to expand Drive C disk.
ScreenHunter_06 Apr. 12 18.02

So do that we will extend disk partition to full one.
ScreenHunter_10 Apr. 12 18.03

In the moment, this disk will has one partition.
Next action, I need to clone this VM for avoiding duplicated SID so that the original and cloned VM can boot normally at the same time.
How to do it?
I ever try to do as following
(1). Sysprep and Shutdown VM –> Export & Import by Hyper-V Manager
(2). Sysprep and Shutdown VM –> Copy VHD file to another location –> Create new VM and choose this Copy VHD file.
(3). Sysprep and Shutdown VM –> Clone VM by SCVMM 2012
ScreenHunter_58 Apr. 11 20.30
But the result fail and OS always restart repeatedly.
ScreenHunter_02 Apr. 13 16.37
I don’t know how to resolve this problem because I ever try to repair it by Windows 7 source CD. I don’t understand what happen because this method get from Google Search.

Based on this error message to search knowledge by Google, I find out a forum and it said maybe the anti-virus influence this status. Of course, maybe a registry key is larger than 8 KB according to Microsoft KB981542.
ScreenHunter_23 Apr. 14 23.48
I decide to try to uninstall anti-virus software from VM next to do Sysprep and clone VM by SCVMM 2012 manager. If the procedure fail, it is another choice to install Microsoft hotfix.
The result is lucky for me. The Sysprep function can work and OS boot normally.

Finally, how to prove the SID is different between VMs?
To download PsGetsid from Microsoft next to execute & compare it on prompt command of each VM.
ScreenHunter_04 Apr. 12 14.23
So do that you will know whether VM based on different ID can be booted together.

SID before executing SysprepScreenHunter_01 Apr. 13 15.47

SID after executing Sysprep
ScreenHunter_38 Apr. 15 00.30

沒有留言:

張貼留言

Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.