Working with VMware Tools Scripts and Power States

From Virtuatopia
Revision as of 20:19, 9 October 2008 by Neil (Talk | contribs) (VMware Tools Scripts)

Jump to: navigation, search

The power state of a VMware Server virtual machine can be changed either from within the guest operating system itself (for example by initiating the operating system's shutdown command from within the VMware Remote Console) or by using the VI Web Access interface.

In the case of changing the power state from within the VI Web Access interface, a number of configuration options are available in terms of what actually happens when the power state is changed (for example when the VI Web Access power off button is clicked) and also which VMware Tools scripts are triggered within the guest operating system.

In this chapter, the concept of power states and the use and configuration of the VMware Tools scripts will be covered in detail.




Changing Virtual Machine Power State from VI Web Access

When a virtual machine is powered on or off, suspended, resumed or restarted it is said to have undergone a change in power state. The VI Web Access interface provides no less than five locations where the power state of a virtual machine may be changed. The most prominent of these are located in the tool bar which runs along the top of the interface. Toolbar buttons are provided to power on, power off, suspend and restart the virtual machine currently selected from the Inventory panel.

In addition, power state options are listed in the Commands panel of the virtual machine workspace area when a virtual machine is selected from the inventory. Similarly, power state options are listed for the currently selected virtual machine within the Virtual Machines menu option in the menu bar at the top of the VI Web Access interface.

If the host system is selected from the inventory panel and the Virtual Machines tab of the workspace selected, a list of virtual machines appears together with a Commands panel. As each virtual machine is selected from this list, the Commands panel updates with a list of suitable commands, including power state changes, for the selected machine.

Finally, power state change controls are available in the VMware Remote Console of a running virtual machine within the Remote Console->Troubleshoot menu option.


Configuring Virtual Machine Power Options

To configure the power options of a virtual machine, select it from the Inventory panel, click on Configure VM from the Commands panel in the workspace area and choose the Power tab from the resulting dialog.


Configuring Virtual Machine Power Options


As illustrated in the preceding figure, the power state configuration settings are divided into a number of different categories, each of which is detailed below:

Power Controls

The Power Controls section of the configuration panel specifies the action performed when the VI Web Access power off, suspend and restart options are chosen for a virtual machine:

  • Power Off - The Power Off command can be configured to immediately power down the virtual guest (an effect similar to simply removing the power from a physical computer system). The effect is immediate but also poses the risk that data will be lost given that the guest operating system running within the virtual machine is not provided the opportunity to perform a clean shutdown. If VMware Tools have been installed on the guest operating system, the Shut Down Guest option may be selected ensure an orderly shutdown of the guest operating system prior to the removal of "virtual power" to the virtual machine.
  • Suspend - As with the Power Off command, two options are available for suspending virtual machines from within the VI Web Access management interface. If Suspend is selected, the virtual machine will be suspended without triggering the suspend process of the guest operating system (assuming the guest includes such a feature). If VMware Tools have been installed on the guest, the Suspend Guest option will first trigger the guest operating system's suspend mechanism prior to suspending the virtual machine.
  • Reset - The reset option may similarly be configured to reset the virtual machine without regard to the guest operating system or, assuming the prior installation of VMware Tools, using the guest operating system's reboot procedure by selecting Reset or Restart Guest respectively.

VMware Tools Scripts

The previous section described how the guest operating system running within a VMware Server virtual machine may be cleanly shutdown, restarted or suspended through the installation on VMware Tools on the guest.