You can configure a virtual machine to use VMware Tools to run scripts before or after virtual machine power operations.

Scripts run only before or after "soft" power operations. For example, if you power off a virtual machine, as opposed to shutting down the guest operating system, the configured script does not run.

In addition to setting these options, you must also configure the scripts in the VMware Tools interface. See VMware Tools Help for more information.

Power off the virtual machine before editing the VMware Tools options.

Required privilege: Virtual machine.Configuration.Settings

1

Select a virtual machine.

In the virtual machines and templates inventory tree, select a group of virtual machines and select a virtual machine from the list on the right.

Search for a virtual machine and select it from the search results list.

2

In the VM Hardware panel, click Edit Settings.

3

Click VM Options.

4

Click the VMware Tools triangle to expand the VMware Tools options.

5

Select when to run scripts.

Select After powering on to run a script after powering on the virtual machine.

Select After resuming to run a script when the virtual machine resumes after being suspended.

Select Before suspending to run a script before suspending the virtual machine.

Select Before shutting down Guest to run a script before shutting down the guest operating system.

6

Click OK.