[Turn] Windows Server 2012 RC of Hyper-V 3.0 PowerShell Commands Explanation (02)

Source Address: http: //www.powershellfans.com/ p = 1231?

========================================================================

To undertake the back, from the last time I was in Hyper-V core noun virtual machine (VM) to start, and lead us quickly and looked under the virtual machine snapshot (VMSnapshot) related commands. Today we are going to continue to look at the terms VM is part of the command.

Today is the first to introduce part of the verb to C beginning Compare-VM command, that is, the article said, I could not look at what they were at the beginning of the command. Of course, after reading help, "Compares a virtual machine and a virtual machine host for compatibility, returning a compatibility report.", You should be able to understand the role of this command, the original is a virtual machine and a virtual machine host Compare, then generate compatibility reports. Here in my test environment, in order to enjoy the elegance under System Center 2012, the installation of another test machine is Windows Server 2008 R2, when you run the command generates the appropriate error:

image

This shows that the current Compare-VM RC version does not support Hyper-V 2.0, here I am also curious about is how a compatibility report, and then use Windows to go, re-install Windows Server 2012 RC on another machine. Then the results obtained were as follows:

image

Here we need to note, before you run the Compare-VM, or need to use a graphical interface to enable the Enable-VMMigration Migration feature of Hyper-V, and to enable Migration feature, Hyper-V host must join a domain environment. My approach is the Hyper-V host to join the domain controller virtual machine hosted on this host.

The next is to introduce Import-VM and Export-VM This set of commands, it is obvious these two commands are used to import and export virtual machines. In addition to routine tests, rapid distribution of cattle outside the configured virtual machine environment, in Windows Server Server 2012, the cloned domain controller will also use the Export-VM and Import-VM command.

Export-VM is relatively simple, as long as the specified name and path to the virtual machine, when you need to import the parameter combinations.

image

Import-VM parameter combination of (to be exact parameter set), is divided into a total of three. The first is to use a compatibility report. The second parameter is relatively small, but there is a critical parameter Register, the role of the parameter is registered according to the path corresponding virtual machine provided in Hyper-V, instead of copying the virtual machine to the default folder. Note that the specified path, be sure to use the virtual machine's configuration file (.xml file format). Meanwhile, the configuration file will be exclusive Hyper-V, that is, when you delete the virtual machine, the configuration file will be deleted. Once so introduced into the virtual machine, it will be appropriate depending on the file folder of the folder by the virtual machine, the virtual machine rather than export folder.

image

The third parameter set is relatively complex, but the effect is the opposite execution coincided with the second key parameter is GenerateNewID and Copy, other parameters are optional parameters can be specified on demand, is the effect after the implementation of the virtual machine files It is copied to the corresponding default folder.

image

Therefore, the third set of parameters is what we correct method should be used when a virtual machine template distribution experiment, and when 08R2, there may be some friends are export and import interface is too confusing, then I believe this will be clear.

If we look at the content of what I said, feeling a little ambiguous words, the easiest way is not a new installation of the operating system of the virtual machine, and then executed just said import and export operations. Because the virtual machine does not install any operating system, disk file size is at a minimum, to facilitate the rapid results of our validation command.

The introduction to Compare-VM, Import-VM and the Export-VM is to this end, please look forward to the next presentation.

Note: This article is described in development of a product.

(End update)

Reproduced in: https: //www.cnblogs.com/licheng/archive/2013/02/25/2931599.html

Guess you like

Origin blog.csdn.net/weixin_34184158/article/details/92628028