Class: Dcmgr::Models::InstanceSpec
Constant Summary
Constants inherited
from BaseNew
BaseNew::LOCK_TABLES_KEY
Instance Method Summary
collapse
#account
Methods inherited from BaseNew
Proxy, dataset, install_data, install_data_hooks, lock!, unlock!
Instance Method Details
#before_validate ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/dcmgr/models/instance_spec.rb', line 25
def before_validate
default_config =
case self.hypervisor
when HostPool::HYPERVISOR_KVM
{:block_driver=>'virtio', :nic_driver=>'virtio'}
end
self.config = default_config.merge(self.config || {})
super
end
|
#to_hash ⇒ Object
36
37
38
39
|
# File 'lib/dcmgr/models/instance_spec.rb', line 36
def to_hash
super.merge({:config=>self.config, })
end
|