Class: VagrantPlugins::HYPERKIT::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::HYPERKIT::Config
- Defined in:
- lib/vagrant-hyperkit/config.rb
Instance Attribute Summary collapse
-
#cpus ⇒ Fixnum
The number of CPUs to give the VM.
-
#kernel_command ⇒ String
The kernel command to initialize the machine The default command assumes that the instalation is done directly on the disk and not using a lvm.
-
#mac ⇒ String
The mac address of the VM.
-
#memory ⇒ String
The amount of memory to give the VM.
-
#uuid ⇒ String
The uuid of the VM.
-
#xhyve_binary ⇒ String
The path to the xhyve binary if you don’t want to use the one bundled with xhyve-ruby.
Instance Method Summary collapse
-
#finalize! ⇒ Object
——————————————————————- Internal methods.
-
#initialize(region_specific = false) ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize(region_specific = false) ⇒ Config
Returns a new instance of Config.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vagrant-hyperkit/config.rb', line 47 def initialize(region_specific=false) @cpus = UNSET_VALUE @memory = UNSET_VALUE @xhyve_binary = UNSET_VALUE @mac = UNSET_VALUE @uuid = UNSET_VALUE @kernel_command = UNSET_VALUE # Internal state (prefix with __ so they aren't automatically # merged) @__compiled_region_configs = {} @__finalized = false @__region_config = {} @__region_specific = region_specific end |
Instance Attribute Details
#cpus ⇒ Fixnum
The number of CPUs to give the VM
12 13 14 |
# File 'lib/vagrant-hyperkit/config.rb', line 12 def cpus @cpus end |
#kernel_command ⇒ String
The kernel command to initialize the machine The default command assumes that the instalation is done directly on the disk and not using a lvm. For example, by default, Centos intallation uses LVM. Moreover, it might be interesting to add new kernel options.
45 46 47 |
# File 'lib/vagrant-hyperkit/config.rb', line 45 def kernel_command @kernel_command end |
#mac ⇒ String
The mac address of the VM
33 34 35 |
# File 'lib/vagrant-hyperkit/config.rb', line 33 def mac @mac end |
#memory ⇒ String
The amount of memory to give the VM
This can just be a simple integer for memory in MB or you can use the suffixed style, eg. 2G for two Gigabytes
21 22 23 |
# File 'lib/vagrant-hyperkit/config.rb', line 21 def memory @memory end |
#uuid ⇒ String
The uuid of the VM
38 39 40 |
# File 'lib/vagrant-hyperkit/config.rb', line 38 def uuid @uuid end |
#xhyve_binary ⇒ String
The path to the xhyve binary if you don’t want to use the one bundled with xhyve-ruby
28 29 30 |
# File 'lib/vagrant-hyperkit/config.rb', line 28 def xhyve_binary @xhyve_binary end |
Instance Method Details
#finalize! ⇒ Object
Internal methods.
67 68 69 70 71 72 73 74 75 |
# File 'lib/vagrant-hyperkit/config.rb', line 67 def finalize! @cpus = 1 if @cpus == UNSET_VALUE @memory = 1024 if @memory == UNSET_VALUE @xhyve_binary = nil if @xhyve_binary == UNSET_VALUE @kernel_command = %Q{"earlyprintk=serial console=ttyS0 root=/dev/vda1 ro"} if @kernel_command == UNSET_VALUE # Mark that we finalized @__finalized = true end |
#validate(machine) ⇒ Object
77 78 79 80 |
# File 'lib/vagrant-hyperkit/config.rb', line 77 def validate(machine) errors = _detected_errors { "XHYVE Provider" => errors } end |