Class: VagrantPlugins::ProviderBhyve::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::ProviderBhyve::Config
- Defined in:
- lib/vagrant-bhyve/config.rb
Instance Attribute Summary collapse
-
#cdroms ⇒ Object
Returns the value of attribute cdroms.
-
#cpus ⇒ Object
Specify the number of virtual CPUs.
-
#disks ⇒ Object
Addition storage.
-
#hostbridge ⇒ Object
Returns the value of attribute hostbridge.
-
#lpc ⇒ Object
Specify console device which will be attached to the VM.
-
#memory ⇒ Object
Specify the size of guest physical memory.
-
#pcis ⇒ Object
Specify virtual devices will be attached to bhyve’s emulated PCI bus.
Instance Method Summary collapse
- #_handle_cdrom_storage(options = {}) ⇒ Object
- #_handle_disk_storage(options = {}) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #storage(options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vagrant-bhyve/config.rb', line 29 def initialize @cpus = UNSET_VALUE @memory = UNSET_VALUE @pcis = UNSET_VALUE @lpc = UNSET_VALUE @hostbridge = UNSET_VALUE @disks = [] @cdroms = [] #@grub_config_file = '' #@grub_run_partition = '' #@grub_run_dir = '' end |
Instance Attribute Details
#cdroms ⇒ Object
Returns the value of attribute cdroms.
27 28 29 |
# File 'lib/vagrant-bhyve/config.rb', line 27 def cdroms @cdroms end |
#cpus ⇒ Object
Specify the number of virtual CPUs.
15 16 17 |
# File 'lib/vagrant-bhyve/config.rb', line 15 def cpus @cpus end |
#disks ⇒ Object
Addition storage
26 27 28 |
# File 'lib/vagrant-bhyve/config.rb', line 26 def disks @disks end |
#hostbridge ⇒ Object
Returns the value of attribute hostbridge.
24 25 26 |
# File 'lib/vagrant-bhyve/config.rb', line 24 def hostbridge @hostbridge end |
#lpc ⇒ Object
Specify console device which will be attached to the VM
23 24 25 |
# File 'lib/vagrant-bhyve/config.rb', line 23 def lpc @lpc end |
#memory ⇒ Object
Specify the size of guest physical memory.
17 18 19 |
# File 'lib/vagrant-bhyve/config.rb', line 17 def memory @memory end |
#pcis ⇒ Object
Specify virtual devices will be attached to bhyve’s emulated PCI bus. Network interface and disk will both attched as this kind of devices.
21 22 23 |
# File 'lib/vagrant-bhyve/config.rb', line 21 def pcis @pcis end |
Instance Method Details
#_handle_cdrom_storage(options = {}) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/vagrant-bhyve/config.rb', line 57 def _handle_cdrom_storage(={}) = { path: nil, name: nil, size: "20G", format: "raw", }.merge() disk = { path: [:path], size: [:size], } @disks << disk end |
#_handle_disk_storage(options = {}) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/vagrant-bhyve/config.rb', line 50 def _handle_disk_storage(={}) cdrom = { path: [:path] } @cdroms << cdrom end |
#storage(options = {}) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/vagrant-bhyve/config.rb', line 42 def storage(={}) if [:device] == :cdrom _handle_cdrom_storage() elsif [:device] == :disk _handle_disk_storage() end end |