class PackerFiles::Core::Hypervisor

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.

Attributes

acpi_enabled[RW]

Is ACPI enabled?

cpu_count[RW]

CPU count

cpu_execution_cap[RW]

CPU Execution Cap

cpu_hot_plug[RW]

Enable CPU Hot plug?

cpu_speed[RW]

CPU Speed

custom[R]

Custom object which can be used for whatever purpose it suits the caller

guest_balloon_size[RW]

Guest memory balloon size

hw_nested_pages[RW]

Should nested paging for guest be enabled

hw_virt_enabled[RW]

Should H/w Virtualization for Guest be enabled

pae_enabled[RW]

Should PAE (Processor Address Extensions) enabled?

ram_size[RW]

RAM Size

unrestricted_guest_mode[RW]

Should the guest run in unrestricted mode

use_efi[RW]

Should EFI firmware be used instead of bios

use_large_pages[RW]

Should Hypervisor use large pages for this guest

video_3d_acceleration[RW]

Should 3d acceleration be enabled for Video

video_ram_size[RW]

Video ram size

Public Class Methods

doc_file() click to toggle source

Documentation for this class

# File lib/PackerFiles/Core/Hypervisor.rb, line 63
def self.doc_file
   PackerFiles.DirPath('Core/example/Hypervisor.txt').first
end
new() { |self| ... } click to toggle source

Constructor initializes some sane values for various parameters.

# 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

Public Instance Methods

Custom(&block) click to toggle source

The Custom object is filled with whatever is the result of the block

# File lib/PackerFiles/Core/Hypervisor.rb, line 88
def Custom(&block)
   @custom = block.call(self)
end