Installation guide

www.vmware.com
54
VMware ESX Server Administration Guide
where hard, soft or trysoft specifies the behavior of the power operation
<powerop_mode>. If <powerop_mode> is not specified, the default behavior is soft.
For more information, see the VMware Scripting API User’s Manual.
Executing Commands When ESX Server Requests the Guest Service to Halt or
Reboot a Virtual Machine
In a Linux guest, you can have the guest service execute specific commands when
ESX Server asks it to halt or reboot the virtual machine’s guest operating system. If you
use nonstandard utilities or want to do additional things before shutting down or
rebooting the guest operating system, you can override the default commands the
guest service executes by modifying the /etc/vmware/dualconf.vm startup
script in the guest to start the guest service with the following command line options:
/etc/vmware/vmware-guestd --halt-command <command>
where <command> is the command to execute when ESX Server asks the guest
service to halt the guest operating system
/etc/vmware/vmware-guestd --reboot-command <command>
where <command> is the command to execute when ESX Server asks the guest
service to reboot the guest operating system
Passing a String from the Service Console to the Guest Operating System
With ESX Server and knowledge of a scripting language like Perl or NetShell (in a
Windows 2000 guest operating system), you can pass a string from your virtual
machine’s configuration file to the guest operating system when you use the
configuration file to launch a virtual machine. This string is known as machine.id.
The content of the string you pass to the guest operating system is up to you.
For additional details and sample scripts, including information on passing messages
both ways between the service console and a guest, see the VMware Scripting API
documentation at www.vmware.com/support/developer/scripting-API/doc/
Scripting_API.pdf.
You should use this feature only if you have a good understanding of a scripting
language and know how to modify system startup scripts.
Example of Passing a String from the Service Console to the Guest
If you use multiple configuration files that point to the same virtual disk, each
configuration file can contain its own unique machine.id line.
<config_file_1>.vmx contains:
scsi0:1.present = TRUE
scsi0:1.name = "my_common_virtual_hard_drive.dsk"