Module: FogExtensions::Libvirt::Server

Defined in:
lib/fog_extensions/libvirt/server.rb

Instance Method Summary collapse

Instance Method Details

#memoryObject

Libvirt expect units in KB, while we use bytes


14
15
16
# File 'lib/fog_extensions/libvirt/server.rb', line 14

def memory
  attributes[:memory_size].to_i * 1024
end

#memory=(mem) ⇒ Object


18
19
20
# File 'lib/fog_extensions/libvirt/server.rb', line 18

def memory= mem
  attributes[:memory_size] = mem.to_i / 1024 if mem
end

#nics_attributes=(attrs) ⇒ Object


9
# File 'lib/fog_extensions/libvirt/server.rb', line 9

def nics_attributes=(attrs); end

#resetObject


22
23
24
25
# File 'lib/fog_extensions/libvirt/server.rb', line 22

def reset
  poweroff
  start
end

#to_sObject


5
6
7
# File 'lib/fog_extensions/libvirt/server.rb', line 5

def to_s
  name
end

#volumes_attributes=(attrs) ⇒ Object


11
# File 'lib/fog_extensions/libvirt/server.rb', line 11

def volumes_attributes=(attrs); end