nested virtualization

This commit is contained in:
dima
2013-05-06 19:47:53 +02:00
parent 2eb772b6ce
commit c1c360f2cb
4 changed files with 15 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ module VagrantPlugins
# Gather some info about domain
@name = env[:domain_name]
@cpus = config.cpus
@nested = config.nested
@memory_size = config.memory*1024
# TODO get type from driver config option

View File

@@ -25,6 +25,7 @@ module VagrantPlugins
# Domain specific settings used while creating new domain.
attr_accessor :memory
attr_accessor :cpus
attr_accessor :nested
def initialize
@driver = UNSET_VALUE
@@ -37,6 +38,7 @@ module VagrantPlugins
# Domain specific settings.
@memory = UNSET_VALUE
@cpus = UNSET_VALUE
@nested = UNSET_VALUE
end
def finalize!
@@ -50,6 +52,7 @@ module VagrantPlugins
# Domain specific settings.
@memory = 512 if @memory == UNSET_VALUE
@cpus = 1 if @cpus == UNSET_VALUE
@nested = false if @nested == UNSET_VALUE
end
def validate(machine)

View File

@@ -2,6 +2,14 @@
<name><%= @name %></name>
<memory><%= @memory_size %></memory>
<vcpu><%= @cpus %></vcpu>
<% if @nested %>
<cpu match='exact'>
<model>core2duo</model>
<feature policy='require' name='vmx'/>
</cpu>
<% end %>
<os>
<type arch='x86_64'>hvm</type>
<boot dev='hd'/>