vCloud Director vApp VM stop action

I have been asked by a couple of customers lately why the vCloud Director (vCD) based VMs by default are being Power Off when you Stop a vApp using the vCD UI. This behavior applies to all existing vCD versions including the latest 5.1.2 release. The Power Off action does not perform a VM guest operating system initiated shut down meaning operating system and application consistency is not guaranteed.

The below figure shows the “Stop” action in vCD.
Screen Shot 2013-05-07 at 12.10.14
The below figure shows the default “Stop Action” triggered per VM when you Stop a vApp.
Screen Shot 2013-05-07 at 12.26.29
The below figure shows the vSphere task for the vApp VM when the vCD “Stop Action” is triggered per vApp.
Screen Shot 2013-05-08 at 10.07.29

I do not have an answer to why the “Stop Action” triggers a VM Power Off but i can think of a few things:

  • The Shut Down “Stop Action” requires VMware tools to be installed in the VMs and not all VMs got VMware tools installed.
  • When running typically demo VMs (sometimes applies to e.g. test and lab VMs as well)  they can often be deleted when the demo is finished meaning Power Off is good enough.
  • It is quicker to use the Power Off and speed is one of the key things in a Cloud environment.

If VMware tools is not running in the VM when the “Stop Action” per VM is set to Shut Down and you try to stop the vApp, you’ll get the below vCD error:
Screen Shot 2013-05-08 at 11.18.36Screen Shot 2013-05-08 at 11.18.20
An error will be presented in vSphere according to the below figure:
Screen Shot 2013-05-08 at 10.06.38

To stop a vApp running VMs without VMware tools installed but the VMs “Stop Action” is configured to Shut Down you need use the Force Stop option in vCD:
Screen Shot 2013-05-08 at 11.39.59 Screen Shot 2013-05-08 at 11.40.52

Follow the below procedure to change the default “Stop Action” per VM per vApp and select the Shut Down option, instead of the Power Off, which will trigger a VM guest operating system controlled shut down.

Right click the vApp and select “Properties” -> go to the tab “Starting and Stopping VMs” -> select the “Stop Action” Shut Down for the select (or all) VMs.
Screen Shot 2013-05-07 at 12.23.25

As always, perform any vApp and VM configuration before adding the vApp to the Catalog (creting a vApp Template). The Shut Down configuration per VM is maintained when selecting both “Customize VM settings” and “Make identical copy” during the vApp “Add to catalog” process.

After making the change you’ll see the below vSphere action per VM in the vApp being stopped.
Screen Shot 2013-05-08 at 10.07.49

I usually change the default “Stop Action” per vCD based VM when:

  • The VM runs VMware tools
  • The VM is not deleted as soon as the vApp is stopped. 

Many customers prefer to have the same behavior when stopping a vCD based VM as when stopping a vSphere based VM which is presented in the below figure.
Screen Shot 2013-05-07 at 10.07.19

I have not found either a setting in the UI or a configuration parameter in the vCD database to change the default Power Off VM “Stop Action” to Shut Down a VM when stopping a vApp. This means you need to change the “Stop Action” per vApp VM and/or vApp Template VM.