Class: Tenderloin::Actions::VM::Up
- Inherits:
-
Base
- Object
- Base
- Tenderloin::Actions::VM::Up
show all
- Defined in:
- lib/tenderloin/actions/vm/up.rb
Instance Attribute Summary
Attributes inherited from Base
#run_args, #runner
Instance Method Summary
collapse
Methods inherited from Base
#cleanup, #execute!, #initialize, #rescue
Methods included from Util
#error_and_exit, included, #logger, #wrap_output
Instance Method Details
#after_import ⇒ Object
29
30
31
32
|
# File 'lib/tenderloin/actions/vm/up.rb', line 29
def after_import
persist
setup_uuid_mac
end
|
#persist ⇒ Object
34
35
36
37
|
# File 'lib/tenderloin/actions/vm/up.rb', line 34
def persist
logger.info "Persisting the VM UUID (#{@runner.vm_id})..."
Env.persist_vm(@runner.vm_id)
end
|
#provision_enabled? ⇒ Boolean
55
56
57
|
# File 'lib/tenderloin/actions/vm/up.rb', line 55
def provision_enabled?
Tenderloin.config.provisioning.enabled && !run_args.include?(:no_provision)
end
|
#setup_uuid_mac ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/tenderloin/actions/vm/up.rb', line 39
def setup_uuid_mac
logger.info "Resetting VMX UUID, MAC and Display Name..."
VMXFile.with_vmx_data(@runner.vmx_path) do |data|
data.delete "ethernet0.addressType"
data.delete "uuid.location"
data.delete "uuid.bios"
data.delete "ethernet0.generatedAddress"
data.delete "ethernet1.generatedAddress"
data.delete "ethernet0.generatedAddressOffset"
data.delete "ethernet1.generatedAddressOffset"
data.delete 'displayname'
data['displayName'] = "tenderloin-" + @runner.vm_id
end
end
|