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

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

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

Hello everyone, today we take a detailed look at Windows Server 2012 RC in Hyper-V 3.0 which provides PowerShell commands to facilitate our management. Last article I have a friend who criticize the official taste too, then we will return to this technology, but I remind you that some things under consideration please, do not really come to regret later that day.

Before details of specific commands, to remind you about. Increasing the Update-Help command in Windows PowerShell 3.0, you can execute the command help to get the latest information at any time. At present each product group in the Windows help documentation departments are to be updated. Of course, there is help departments module not in place yet, but please be patient.

image

Then or the old rules, the number of check under Hyper-V PowerShell 3.0 command, (Get-Command -Module Hyper-V) .Count what you can get, and finally get the number is 164. Well, people do not madness Wasted not, do I put these commands are written down? Of course not, I then again, one thing to know what objects you are ready to operate, what the corresponding English word, and the rest of the Tab key to PowerShell finished up. If you really can back down, I think you're great, but it really is not necessary.

image

今天要和大家看的就是Hyper-V中的核心对象,虚拟机(VM)。接下来就让我看看具体有哪些动词和VM搭配。名词很多,有些大家很熟悉,比如 New,Get,Remove;有些很好理解,别如Checkpoint,Import,Export;有些则第一眼看上去有点迷茫,比如 Compare,Measure。没关系。这正是我要去解答,无论各位是否接触过Hyper-V 2.0,本系列文章还是会做一个全景式覆盖。同时这里正好提一点,有些我认为简单的命令就不在单独用文字列出了,我还是希望大家多敲敲键盘,培养下和 PowerShell的感情。

image

首当其冲的是Checkpoint-VM,命令本身很好理解,就是给虚拟机做快照。该命令的语法如下:

SYNTAX
    Checkpoint-VM [-Name] <String[]> [[-SnapshotName] <String>] [-AsJob [<SwitchParameter>]] [-ComputerName
    <String[]>] [-Passthru [<SwitchParameter>]] [<CommonParameters>]

    Checkpoint-VM [-VM] <VirtualMachine[]> [[-SnapshotName] <String>] [-AsJob [<SwitchParameter>]] [-Passthru
    [<SwitchParameter>]] [<CommonParameters>]

According to grammar, we can enter the name of multiple virtual machines simultaneously, and then create a snapshot of the virtual machine. While you can use the Get-VM virtual machine object will get piped to Checkpoint-VM to create a snapshot, screenshot here shows a second example.

image

Well, soon you created a snapshot, but how to delete the snapshot of it? I did not see you include similar Remove-Checkpoint commands in the previous list ah. That is because the noun is a snapshot of Snapshot, and the corresponding term in the VM Module prefix, so to manage virtual machine snapshots, we need to use the Export- VMSnapshot, Get-VMSnapshot, Remove-VMSnapshot, Rename-VMSnapshot and Restore - VMSnapshot. As for why not New-VMSnapshot, I'm not sure, ask the next connect.microsoft.com so on, is awaiting answers.

This five cmdlets easiest to understand is the Restore-VMSnapshot, the so-called snapshot rollback in Hyper-V 2.0 is often recommended for use in a test environment. The Get-VMSnapshot is also very easy to understand, to get a snapshot of the object, presumably there to support parameter name entered into the computer, of course, can be passed to Get-VMSnapshot objects Get- VM virtual machine will be then before being passed to Rename-VMSnapshot or Remove -VMSnapshot.

image

Finally, it says, Export-VMSnapshot, was simply export a snapshot.

image

Today's content to this end, may be a bit stream of consciousness, think of what to say what, all of a sudden jump from VMSnapshot noun VM. But in and share my own point of view, if you doubt for one thing, then they get to know it in the shortest possible time, the more profound recollection of the incident.

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

Guess you like

Origin blog.csdn.net/weixin_33671935/article/details/92628022