DetachVolume
Description
Detaches an Amazon EBS volume from an instance. For more information about Amazon EBS, go to the
Important | |
---|---|
Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to unmount file systems, or otherwise properly release the device from use, can result in lost data and will corrupt the file system. |
Request Parameters
Name | Description | Required |
---|---|---|
|
Type: DetachVolumeType Ancestor: None Children: |
|
|
The ID of the volume. Type: xsd:string Default: None Ancestor: Children: None |
Yes |
|
The ID of the instance. Type: xsd:string Default: None Ancestor: Children: None |
No |
|
The device name. Type: xsd:string Default: None Ancestor: Children: None |
No |
|
Forces detachment if the previous detachment attempt did not occur cleanly (logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures. Type: xsd:boolean Default: None Ancestor: Children: None |
No |
Response Elements
Name | Description |
---|---|
|
Type: DetachVolumeResponseType Ancestor: None Children: |
|
The ID of the request. Type: xsd:string Ancestor: Children: None |
|
The ID of the volume. Type: xsd:string Ancestor: Children: None |
|
The ID of the instance. Type: xsd:string Ancestor: Children: None |
|
The device as it is exposed to the instance. Type: xsd:string Ancestor: Children: None |
|
Attachment state (e.g., Type: xsd:string Ancestor: Children: None |
|
Time stamp when the association was created. Type: xsd:dateTime Ancestor: Children: None |
Examples
Example Request
This example detaches volume vol-4d826724
.
<DetachVolume xmlns="http://ec2.amazonaws.com/doc/2009-08-15/"> <volumeId>vol-4d826724</volumeId> <instanceId>i-6058a509</instanceId> </DetachVolume>
Example Response
<DetachVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2009-08-15/"> <volumeId>vol-4d826724</volumeId> <instanceId>i-6058a509</instanceId> <device>/dev/sdh</device> <status>detaching</status> <attachTime>2008-05-08T11:51:50.000Z</attachTime> </DetachVolumeResponse>