org.jclouds.openstack.nova.v2_0.extensions
Interface VolumeAttachmentApi


@Beta
public interface VolumeAttachmentApi

Provides access to the OpenStack Compute (Nova) Volume Attachments Extension API. This API strictly handles attaching Volumes to Servers. To create and manage Volumes you need to use one of the following APIs: 1. The Cinder API If your OpenStack deployment is Folsom or later and it supports the Cinder block storage service, use this API.

See Also:
2. The nova-volume API If your OpenStack deployment is Essex or earlier and it supports the nova-volume extension, use this API., VolumeApi

Method Summary
 VolumeAttachment attachVolumeToServerAsDevice(String volumeId, String serverId, String device)
          Attach a Volume to a Server.
 boolean detachVolumeFromServer(String volumeId, String serverId)
          Detach a Volume from a server.
 VolumeAttachment getAttachmentForVolumeOnServer(String volumeId, String serverId)
          Get a specific Volume Attachment for a Volume and Server.
 com.google.common.collect.FluentIterable<VolumeAttachment> listAttachmentsOnServer(String serverId)
          List Volume Attachments for a given Server.
 

Method Detail

listAttachmentsOnServer

@Named(value="volumeAttachment:list")
com.google.common.collect.FluentIterable<VolumeAttachment> listAttachmentsOnServer(String serverId)
List Volume Attachments for a given Server.

Parameters:
serverId - The ID of the Server
Returns:
All VolumeAttachments for the Server

getAttachmentForVolumeOnServer

@Named(value="volumeAttachment:get")
@Nullable
VolumeAttachment getAttachmentForVolumeOnServer(String volumeId,
                                                               String serverId)
Get a specific Volume Attachment for a Volume and Server.

Parameters:
volumeId - The ID of the Volume
serverId - The ID of the Server
Returns:
The Volume Attachment.

attachVolumeToServerAsDevice

@Named(value="volumeAttachment:attach")
VolumeAttachment attachVolumeToServerAsDevice(String volumeId,
                                                    String serverId,
                                                    String device)
Attach a Volume to a Server. Note: If you are using KVM as your hypervisor then the actual device name in the Server will be different than the one specified. When the Server sees a new device, it picks the next available name (which in most cases is /dev/vdc) and the disk shows up there on the Server.

Parameters:
serverId - The ID of the Server
volumeId - The ID of the Volume
device - The name of the device this Volume will be identified as in the Server (e.g. /dev/vdc)
Returns:
The Volume Attachment.

detachVolumeFromServer

@Named(value="volumeAttachment:detach")
boolean detachVolumeFromServer(String volumeId,
                                     String serverId)
Detach a Volume from a server. Note: Make sure you've unmounted the volume first. Failure to do so could result in failure or data loss.

Parameters:
volumeId - The ID of the Volume
serverId - The ID of the Server
Returns:
true if successful


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.