From 765494a2bf51a41b17a3e328f030fb70853bb5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brala?= Date: Wed, 15 Mar 2017 18:09:18 +0100 Subject: [PATCH] Add configuration to HyperV config --- plugins/providers/hyperv/config.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/plugins/providers/hyperv/config.rb b/plugins/providers/hyperv/config.rb index 1726bd45f..ea11a52cd 100644 --- a/plugins/providers/hyperv/config.rb +++ b/plugins/providers/hyperv/config.rb @@ -14,6 +14,7 @@ module VagrantPlugins attr_accessor :differencing_disk # Create differencing disk instead of cloning whole VHD [Boolean] attr_accessor :auto_start_action #action on automatic start of VM. Values: Nothing, StartIfRunning, Start attr_accessor :auto_stop_action #action on automatic stop of VM. Values: ShutDown, TurnOff, Save + attr_accessor :vm_integration_service # Options for VMServiceIntegration def initialize @ip_address_timeout = UNSET_VALUE @@ -21,11 +22,19 @@ module VagrantPlugins @maxmemory = UNSET_VALUE @cpus = UNSET_VALUE @vmname = UNSET_VALUE - @vlan_id = UNSET_VALUE - @mac = UNSET_VALUE + @vlan_id = UNSET_VALUE + @mac = UNSET_VALUE @differencing_disk = UNSET_VALUE @auto_start_action = UNSET_VALUE @auto_stop_action = UNSET_VALUE + @vm_integration_service = { + guest_service_interface: UNSET_VALUE, + heartbeat: UNSET_VALUE, + key_value_pair_exchange: UNSET_VALUE, + shutdown: UNSET_VALUE, + vss: UNSET_VALUE, + time_synchronization: UNSET_VALUE + } end def finalize! @@ -41,12 +50,16 @@ module VagrantPlugins @differencing_disk = false if @differencing_disk == UNSET_VALUE @auto_start_action = nil if @auto_start_action == UNSET_VALUE @auto_stop_action = nil if @auto_stop_action == UNSET_VALUE + + @vm_integration_service.each { |key, value| + @vm_integration_service[key] = nil if value == UNSET_VALUE + } end def validate(machine) errors = _detected_errors - { "Hyper-V" => errors } + {"Hyper-V" => errors} end end end