Skip to content

Latest commit

 

History

History
128 lines (101 loc) · 2.68 KB

HyperVState.adoc

File metadata and controls

128 lines (101 loc) · 2.68 KB

DSC Resource 'HyperVState'

HyperVState contains DSC resources to control state parameters of Hyper-V virtual machines.

It can be used to switch the default parameters of the HyperV configuration at the end of the DSC configuration. So you can create all VM definitions at the beginning, install Windows Updates, make some necessary reboots and safely start these VMs at last step in the DSC configuration after all critical actions are done.

Source

DSC Resource

Documentation

Table 1. Attributes of category 'HyperVState'
Parameter Attribute DataType Description Allowed Values

VMMachines

Hashtable[]

Set of virtual machines

Only Generation 2 machines are supported!

Table 2. Attributes of category 'HyperVState/VMMachines'
Parameter Attribute DataType Description Allowed Values

Name

Key

String

The desired VM name.

State

String

State of the VM.

  • Running

  • Paused

  • Off

AutomaticStartAction

String

Specifies the action the virtual machine is to take upon start.

  • Nothing

  • StartIfRunning

  • Start

AutomaticStartDelay

Int32

Specifies the number of seconds by which the virtual machine’s start should be delayed.

AutomaticStopAction

String

Specifies the action the virtual machine is to take when the virtual machine host shuts down.

  • TurnOff

  • Save

  • ShutDown

Example
HyperVState:
  VMMachines:
    - Name: XXXADC
      State: Running
      AutomaticStartAction: Start
      AutomaticStartDelay: 30
      AutomaticStopAction: Shutdown

    - Name: XXXAPP
      State: Running
      AutomaticStartDelay: 60
      AutomaticStopAction: Save
Recommended Lookup Options in Datum.yml (Excerpt)
lookup_options:

  HyperVState:
    merge_hash: deep
  HyperVState\VMMachines:
    merge_hash_array: UniqueKeyValTuples
    merge_options:
      tuple_keys:
        - Name