DeleteVolumeCommand

Deletes the specified storage volume that you previously created using the CreateCachediSCSIVolume or CreateStorediSCSIVolume API. This operation is only supported in the cached volume and stored volume types. For stored volume gateways, the local disk that was configured as the storage volume is not deleted. You can reuse the local disk to create another storage volume.

Before you delete a volume, make sure there are no iSCSI connections to the volume you are deleting. You should also make sure there is no snapshot in progress. You can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query snapshots on the volume you are deleting and check the snapshot status. For more information, go to DescribeSnapshots  in the Amazon Elastic Compute Cloud API Reference.

In the request, you must provide the Amazon Resource Name (ARN) of the storage volume you want to delete.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { StorageGatewayClient, DeleteVolumeCommand } from "@aws-sdk/client-storage-gateway"; // ES Modules import
// const { StorageGatewayClient, DeleteVolumeCommand } = require("@aws-sdk/client-storage-gateway"); // CommonJS import
const client = new StorageGatewayClient(config);
const input = { // DeleteVolumeInput
  VolumeARN: "STRING_VALUE", // required
};
const command = new DeleteVolumeCommand(input);
const response = await client.send(command);
// { // DeleteVolumeOutput
//   VolumeARN: "STRING_VALUE",
// };

Example Usage

 Loading code editorLoading code editor

DeleteVolumeCommand Input

See DeleteVolumeCommandInput for more details

Parameter
Type
Description
VolumeARN
Required
string | undefined

The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to return a list of gateway volumes.

DeleteVolumeCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
VolumeARN
string | undefined

The Amazon Resource Name (ARN) of the storage volume that was deleted. It is the same ARN you provided in the request.

Throws

Name
Fault
Details
InternalServerError
server

An internal server error has occurred during the request. For more information, see the error and message fields.

InvalidGatewayRequestException
client

An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

StorageGatewayServiceException
Base exception class for all service exceptions from StorageGateway service.