PowerCLI Stop-VApp -Force

Nov 8, 2014 • Jonathan Frappier

So day to day I help maintain a bunch of vApps that run, but are also disposable. When we are finished with them I just want them gone. I am working on a PowerCLI script to help automate this process and saw the Stop-VApp cmdlet. Comparing that to the Stop-VM cmdlet there was no -kill switch in Stop-VApp so I wasn’t sure how to just “pull the plug” - after all I don’t care about the vApp at this point.

Turns out the -Force switch will take care of “pulling the plug” and not gracefully shutting down each guest OS. The documentation was a bit misleading to me for that switch. So, just a quick and dirty post - need to kill a vApp:

Now that we have finished building the template for our ESXi hosts used in our home lab setup, it’s time to start cloning. The process is not all that different from cloning the Windows virtual machine we did earlier, so a quick overview:

In VMware Workstation, right click on your ESXi template virtual machine (if you've been following along it should be vxprt-esxi-tmp) >> Manage >> Clone

Follow through the wizard, selecting Clone from "An existing snapshot..." and "Create a linked clone"

Name your VM accordingly and place it in the desired folder/drive. I will name my ESXi virtual machines vxprt-esxi## so my first will be vxprt-esxi01

Once the clone finishes, close the wizard, move the VM into your desired folder (if you are using folders) and power it on

After a few moments, our ESXi virtual machine will be powered on. Once it is clone, my preference is to give my ESXi hosts static IP addresses. Before doing that, log into your Domain Controller, open DNS manager and create A records for each of the ESXi virtual machines you plan to create by right clicking on the forward lookup zone for your domain and selecting New Host (A or AAA)… My IP scheme will be:

So now we’ve got two ESXi hosts and our domain controller running in the home lab, it’s almost time to setup vCenter however, in a real world scenario you would need a way to get vCenter onto the ESXi hosts (because of course you are virtualizing vCenter). Up until now what we have done through the DCUI would have been at a keyboard and mouse or virtual KVM (such as Cisco UCS or HP iLO) and we cannot create virtual machines via the DCUI. So, what tools are available to manage our ESXi hosts to start creating virtual machines?