Sha256: 11979c512656be30f0461f65a21573bd0570dab13827b958a28e31c0198ba115

Contents?: true

Size: 1.73 KB

Versions: 8

Compression:

Stored size: 1.73 KB

Contents

require "vagrant"

module VagrantPlugins
  module HyperV
    class Config < Vagrant.plugin("2", :config)

      attr_accessor :ip_address_timeout # Time to wait for an IP address when booting, in seconds @return [Integer]
      attr_accessor :memory #  Memory size in mb @return [Integer]
      attr_accessor :maxmemory # Maximal memory size in mb enables dynamical memory allocation @return [Integer]
      attr_accessor :cpus # Number of cpu's @return [Integer]
      attr_accessor :vmname # Name that will be shoen in Hyperv Manager @return [String]
      attr_accessor :vlan_id # VLAN ID for network interface for the virtual machine. @return [Integer]
      attr_accessor :mac # MAC address for network interface for the virtual machine. @return [String]
      attr_accessor :differencing_disk # Create differencing disk instead of cloning whole VHD [Boolean]

      def initialize
        @ip_address_timeout = UNSET_VALUE
        @memory = UNSET_VALUE
        @maxmemory = UNSET_VALUE
        @cpus = UNSET_VALUE
        @vmname = UNSET_VALUE
        @vlan_id  = UNSET_VALUE
        @mac  = UNSET_VALUE
        @differencing_disk = UNSET_VALUE
      end

      def finalize!
        if @ip_address_timeout == UNSET_VALUE
          @ip_address_timeout = 120
        end
        @memory = nil if @memory == UNSET_VALUE
        @maxmemory = nil if @maxmemory == UNSET_VALUE
        @cpus = nil if @cpus == UNSET_VALUE
        @vmname = nil if @vmname == UNSET_VALUE
        @vlan_id = nil if @vlan_id == UNSET_VALUE
        @mac = nil if @mac == UNSET_VALUE
        @differencing_disk = false if @differencing_disk == UNSET_VALUE
      end

      def validate(machine)
        errors = _detected_errors

        { "Hyper-V" => errors }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/hyperv/config.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/hyperv/config.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/hyperv/config.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/hyperv/config.rb
vagrant-unbundled-1.8.5.2 plugins/providers/hyperv/config.rb
vagrant-unbundled-1.8.5.1 plugins/providers/hyperv/config.rb
vagrant-unbundled-1.8.4.2 plugins/providers/hyperv/config.rb
vagrant-unbundled-1.8.4.1 plugins/providers/hyperv/config.rb