Created
December 29, 2014 18:45
-
-
Save hartsock/af185ac3597f8b4ef295 to your computer and use it in GitHub Desktop.
A snippet from collaboration to develop a spec that you can feed to autoStartManager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testvm = # handwaving | |
spec = host.configManager.autoStartManager.config | |
auto_power_info = vim.host.AutoStartManager.AutoPowerInfo() | |
auto_power_info.key = testvm | |
auto_power_info.startAction = vim.VirtualMachine.PowerState.poweredOn #note use of constant instead of string | |
auto_power_info.startDelay = 60 | |
auto_power_info.startOrder = 1 | |
auto_power_info.stopAction = None # note: the Python constant 'None' not a string | |
auto_power_info.stopDelay = -1 # note the use of numeric value here. | |
spec.powerInfo = [auto_power_info] | |
host.configManager.autoStartManager.ReconfigureAutostart(spec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment