VMware {code} Community
sjc84
Contributor
Contributor

Using CustomField values to manage VMs

Hi,

I'm using the VI Perl Toolkit and trying to write a script which starts VMs up based on a custom priority order.

I've got the initial script which queries the VM to check its power state and turn it on if required. The bit I can't get is returning the Startup Sequence I've defined in VC.

Can anyone help?

Steve

0 Kudos
2 Replies
hrobinson
VMware Employee
VMware Employee

The VM Startup Sequence is not found in the CustomField but stored in the AutoStart Manager object (http://pubs.vmware.com/vi301/sdk/ReferenceGuide/vim.host.AutoStartManager.Config.html).

I've provided a sample script that prints the Startup Sequence for all hosts.

Usage:

autostart.pl --server

0 Kudos
sjc84
Contributor
Contributor

Thanks for the info on that one.

Will that cover multiple hosts? The environment I'm working in has multple hosts participating in HA & DRS within a series of clusters. As such we can't know for sure where a VM is when we try to start it.

0 Kudos