Module: OpenstackExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/models/openstack_extensions.rb

Instance Method Summary collapse

Instance Method Details

#snapshot_status(uuid) ⇒ Object



12
13
14
# File 'app/models/openstack_extensions.rb', line 12

def snapshot_status uuid
  available_images.find {|i| i.id == uuid}.status
end

#snapshot_vm(uuid, title = nil) ⇒ Object



4
5
6
7
8
9
10
# File 'app/models/openstack_extensions.rb', line 4

def snapshot_vm uuid, title = nil
  vm = find_vm_by_uuid(uuid)
  snapshot = vm.create_image(title)
  return false unless snapshot.data[:body]['image']['id'].present?
  # todo, this should return a volume object
  snapshot[:body]['image']['id']
end