Class: Fog::Compute::OpenNebula::Server

Inherits:
Server
  • Object
show all
Defined in:
lib/fog/opennebula/models/compute/server.rb

Instance Method Summary collapse

Instance Method Details

#console_outputObject



93
94
95
96
# File 'lib/fog/opennebula/models/compute/server.rb', line 93

def console_output
  requires :id
  service.get_vnc_console(id, "vnc", onevm_object)
end

#destroyObject



78
79
80
# File 'lib/fog/opennebula/models/compute/server.rb', line 78

def destroy
  service.vm_destroy(id)
end

#private_ip_addressObject



46
47
48
# File 'lib/fog/opennebula/models/compute/server.rb', line 46

def private_ip_address
  ip
end

#public_ip_addressObject



50
51
52
# File 'lib/fog/opennebula/models/compute/server.rb', line 50

def public_ip_address
  ip
end

#ready?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/fog/opennebula/models/compute/server.rb', line 82

def ready?
  (status == 3) 
end

#resumeObject



74
75
76
# File 'lib/fog/opennebula/models/compute/server.rb', line 74

def resume
  service.vm_resume(id)
end

#saveObject



24
25
26
# File 'lib/fog/opennebula/models/compute/server.rb', line 24

def save
  merge_attributes(service.vm_allocate(attributes))
end

#startObject



58
59
60
61
62
63
# File 'lib/fog/opennebula/models/compute/server.rb', line 58

def start
  if status == 4
    service.vm_resume(id)
  end
  true
end

#stopObject



65
66
67
68
# File 'lib/fog/opennebula/models/compute/server.rb', line 65

def stop
  Fog::Logger.warning("stop VM: ID:#{id}")
  service.vm_stop(id)
end

#suspendObject



70
71
72
# File 'lib/fog/opennebula/models/compute/server.rb', line 70

def suspend
  service.vm_suspend(id)
end

#template_idObject

only for integration in foreman needed by formbuilder should be handled by foreman and not by fog



89
90
91
# File 'lib/fog/opennebula/models/compute/server.rb', line 89

def template_id
  ""
end

#vm_ip_addressObject



42
43
44
# File 'lib/fog/opennebula/models/compute/server.rb', line 42

def vm_ip_address
  ip
end

#vm_mac_addressObject



54
55
56
# File 'lib/fog/opennebula/models/compute/server.rb', line 54

def vm_mac_address
  mac
end

#vminterfacesObject

only for integration in foreman needed by formbuilder should be handled by foreman and not by fog



31
32
33
# File 'lib/fog/opennebula/models/compute/server.rb', line 31

def vminterfaces
  []
end

#vminterfaces_attributes=(attributes) ⇒ Object

only for integration in foreman needed by formbuilder should be handled by foreman and not from by fog



38
39
40
# File 'lib/fog/opennebula/models/compute/server.rb', line 38

def vminterfaces_attributes=(attributes)
  true
end