Class: PackerFiles::Core::Hypervisor
- Inherits:
-
Object
- Object
- PackerFiles::Core::Hypervisor
- Defined in:
- lib/PackerFiles/Core/Hypervisor.rb
Overview
The Hypervisor class just abstracts out various settings that are applicable on Hypervisors. It is upto the providers to ensure that the appropriate Packer variables are generated for these settings.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#acpi_enabled ⇒ Object
Is ACPI enabled?.
-
#cpu_count ⇒ Object
CPU count.
-
#cpu_execution_cap ⇒ Object
CPU Execution Cap.
-
#cpu_hot_plug ⇒ Object
Enable CPU Hot plug?.
-
#cpu_speed ⇒ Object
CPU Speed.
-
#custom ⇒ Object
readonly
it suits the caller.
-
#guest_balloon_size ⇒ Object
Guest memory balloon size.
-
#hw_nested_pages ⇒ Object
Should nested paging for guest be enabled.
-
#hw_virt_enabled ⇒ Object
Should H/w Virtualization for Guest be enabled.
-
#pae_enabled ⇒ Object
Should PAE (Processor Address Extensions) enabled?.
-
#ram_size ⇒ Object
RAM Size.
-
#unrestricted_guest_mode ⇒ Object
Should the guest run in unrestricted mode.
-
#use_efi ⇒ Object
Should EFI firmware be used instead of bios.
-
#use_large_pages ⇒ Object
Should Hypervisor use large pages for this guest.
-
#video_3d_acceleration ⇒ Object
Should 3d acceleration be enabled for Video.
-
#video_ram_size ⇒ Object
Video ram size.
Class Method Summary collapse
-
.doc_file ⇒ Object
Documentation for this class.
Instance Method Summary collapse
-
#Custom(&block) ⇒ Object
The Custom object is filled with whatever is the result of the block.
-
#initialize {|_self| ... } ⇒ Hypervisor
constructor
Constructor initializes some sane values for various parameters.
Constructor Details
#initialize {|_self| ... } ⇒ Hypervisor
Constructor initializes some sane values for various parameters.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 68 def initialize @cpu_count = 1 @cpu_speed = '1GHz' @cpu_hot_plug = false @cpu_execution_cap = 100 @ram_size = '1GiB' @video_ram_size = '64MiB' @acpi_enabled = true @pae_enabled = true @hw_virt_enabled = true @use_large_pages = true @unrestricted_guest_mode = false @video_3d_acceleration = false @use_efi = false @guest_balloon_size = '0MiB' @custom = nil yield self if block_given? end |
Instance Attribute Details
#acpi_enabled ⇒ Object
Is ACPI enabled?
32 33 34 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 32 def acpi_enabled @acpi_enabled end |
#cpu_count ⇒ Object
CPU count
14 15 16 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 14 def cpu_count @cpu_count end |
#cpu_execution_cap ⇒ Object
CPU Execution Cap
23 24 25 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 23 def cpu_execution_cap @cpu_execution_cap end |
#cpu_hot_plug ⇒ Object
Enable CPU Hot plug?
20 21 22 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 20 def cpu_hot_plug @cpu_hot_plug end |
#cpu_speed ⇒ Object
CPU Speed
17 18 19 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 17 def cpu_speed @cpu_speed end |
#custom ⇒ Object (readonly)
it suits the caller
60 61 62 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 60 def custom @custom end |
#guest_balloon_size ⇒ Object
Guest memory balloon size
56 57 58 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 56 def guest_balloon_size @guest_balloon_size end |
#hw_nested_pages ⇒ Object
Should nested paging for guest be enabled
41 42 43 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 41 def hw_nested_pages @hw_nested_pages end |
#hw_virt_enabled ⇒ Object
Should H/w Virtualization for Guest be enabled
38 39 40 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 38 def hw_virt_enabled @hw_virt_enabled end |
#pae_enabled ⇒ Object
Should PAE (Processor Address Extensions) enabled?
35 36 37 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 35 def pae_enabled @pae_enabled end |
#ram_size ⇒ Object
RAM Size
26 27 28 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 26 def ram_size @ram_size end |
#unrestricted_guest_mode ⇒ Object
Should the guest run in unrestricted mode
47 48 49 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 47 def unrestricted_guest_mode @unrestricted_guest_mode end |
#use_efi ⇒ Object
Should EFI firmware be used instead of bios
53 54 55 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 53 def use_efi @use_efi end |
#use_large_pages ⇒ Object
Should Hypervisor use large pages for this guest
44 45 46 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 44 def use_large_pages @use_large_pages end |
#video_3d_acceleration ⇒ Object
Should 3d acceleration be enabled for Video
50 51 52 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 50 def video_3d_acceleration @video_3d_acceleration end |
#video_ram_size ⇒ Object
Video ram size
29 30 31 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 29 def video_ram_size @video_ram_size end |
Class Method Details
.doc_file ⇒ Object
Documentation for this class
63 64 65 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 63 def self.doc_file PackerFiles.DirPath('Core/example/Hypervisor.txt').first end |
Instance Method Details
#Custom(&block) ⇒ Object
The Custom object is filled with whatever is the result of the block
88 89 90 |
# File 'lib/PackerFiles/Core/Hypervisor.rb', line 88 def Custom(&block) @custom = block.call(self) end |