Starting and stopping virtual machines
You have created your virtual machine, but it is still powered off. In this section, you will learn how to start, suspend, and stop a virtual machine using PowerCLI.
Starting virtual machines
To start a virtual machine, you can use the Start-VM
cmdlet. This cmdlet has the following syntax:
Start-VM [-RunAsync] [-VM] <VirtualMachine[]> [-Server
<VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
The -VM
parameter is required to start a virtual machine.
In the first example, we will start the virtual machine VM2
using the following command:
PowerCLI C:\> Start-VM -VM VM2
The output of the preceding command is as follows:
Name PowerState Num CPUs MemoryGB ---- ---------- -------- -------- VM2 PoweredOn 2 4.000
To start all of your virtual machines that are powered off, you can pipe the output of the Get-VM
cmdlet to the Where-Object
cmdlet, to filter only those virtual...