EC2 EBS volume shows "no attachments" but still "in-use". Won't detach or force-detach

0

I have an EC2 EBS volume that won't detach or force-detach

D:\repos> aws ec2 describe-volumes
{
    "Volumes": [
        {
            "AvailabilityZone": "us-east-1b",
            "Attachments": [],
            "Encrypted": false,
            "VolumeType": "standard",
            "VolumeId": "vol-cd8365a4",
            "State": "in-use",
            "SnapshotId": "",
            "CreateTime": "2009-03-17T23:20:21.000Z",
            "Size": 20
        }
    ]
}

I have no instances running in us-east-1b, so it can't be attached to anything. It won't detach or force detach.

If I try to detach it, it says the volume is 'in-use'

D:\repos> aws ec2 delete-volume --volume-id vol-cd8365a4

An error occurred (IncorrectState) when calling the DeleteVolume operation: The volume 'vol-cd8365a4' is 'in-use'
D:\repos>

If I try to force detach it, it says the volume is in the 'available state'

D:\repos> aws ec2 detach-volume --force --volume-id vol-cd8365a4

An error occurred (IncorrectState) when calling the DetachVolume operation: Volume 'vol-cd8365a4' is in the 'available' state.
D:\repos>

Is there anyway to get rid of this? I'm being billed monthly for it.

3 Answers
0
Accepted Answer

I found the answer!

I was doing nothing wrong, and Amazon had a bug. I was able to get someone at Amazon tech support to kick the thing for me and unstick it. Because I don't pay for support, I filed an issue with "billing" as I was being billed for a volime that couldn't be deleted.

EC2 "volumes" really do get stuck and can't be force-detached and the only option is to get technical support from Amazon.

answered a year ago
profile picture
EXPERT
reviewed a month ago
0

Are you able to get more details about the volume using AWS Config? A query something like the below and then looking at the configuration to see if it gives you any additional data?

SELECT
  resourceId,  resourceName,  resourceType,  tags,  configuration
WHERE
  resourceType = 'AWS::EC2::Volume'
  and resourceId = 'vol-cd8365a4'
answered a year ago
  • Thanks for the idea. It didn't give me any more information. Shows as "in-use" with no attachements

      "aggregator": "none",
      "expression": "SELECT  resourceId,  resourceName,  resourceType,  tags,  configurationWHERE  resourceType = 'AWS::EC2::Volume'  and resourceId = 'vol-cd8365a4'",
      "creationTime": "Fri Apr 28 2023 12:46:15 GMT-0700 (Pacific Daylight Time)",
      "count": 1,
      "results": [
        {
          "resourceId": "vol-cd8365a4",
          "configuration": {
            "volumeType": "standard",
            "attachments": [],
            "snapshotId": "",
            "availabilityZone": "us-east-1b",
            "tags": [],
            "encrypted": false,
            "size": 20,
            "createTime": "2009-03-17T23:20:21.000Z",
            "volumeId": "vol-cd8365a4",
            "state": {
              "value": "in-use"
            },
            "multiAttachEnabled": false
          },
          "tags": [],
          "resourceType": "AWS::EC2::Volume"
        }
      ]
    } ```
    
0

Just a thought, is your account's "home" region in your config/env settings the same region as the volume is in (us-east-1)? If it isn't then maybe append --region us-east-1 to the command.

If you think this is superfluous then I agree, as Resource IDs should be globally unique. But it's surely worth a try.

profile picture
EXPERT
Steve_M
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions