module Ropenstack::Compute::Version2::Extensions::Volumes

Public Instance Methods

attach_volume(id, volume) click to toggle source

Attach a cinder volume to a server, by passing the server id and the volume id.

# File lib/ropenstack/compute/v2/extensions/volumes.rb, line 7
def attach_volume(id, volume) 
  data = { 'volumeAttachment' => { 'volumeId' => volume, 'device' => "/dev/vdb" } }
  return post_request(address("/servers/" + id + "/os-volume_attachments"), data, @token)
end
detach_volume(id, attachment) click to toggle source

Remove a cinder volume from a server, by passing the server id and the attachment id.

# File lib/ropenstack/compute/v2/extensions/volumes.rb, line 16
def detach_volume(id, attachment)
  return delete_request(address("/servers/"+id+"/os-volume_attachments/"+volume), @token)
end