Posted On July 5, 2019

AWS-CLI: Detach A Volume

kimconnect 0 comments
blog.KimConnect.com >> Virtualization >> AWS-CLI: Detach A Volume
Check Volume’s Status
PS C:\Windows> aws ec2 describe-volumes --region us-west-1 --volume-ids vol-0a0f16ef5a9d69a29
{
"Volumes": [
{
"Attachments": [
{
"AttachTime": "2019-06-10T04:49:02.000Z",
"Device": "/dev/sda1",
"InstanceId": "i-0c8a54804bdef133a",
"State": "attached",
"VolumeId": "vol-0a0f16ef5a9d69a29",
"DeleteOnTermination": false
}
],
"AvailabilityZone": "us-west-1c",
"CreateTime": "2019-06-10T04:34:51.619Z",
"Encrypted": true,
"Size": 30,
"SnapshotId": "snap-041a3825ebe9c3c33",
"State": "in-use",
"VolumeId": "vol-0a0f16ef5a9d69a29",
"Iops": 100,
"Tags": [
{
"Key": "Name",
"Value": "kimconnect"
}
],
"VolumeType": "gp2"
}
]
}

Since the volume is currently mounted as /dev/sda1 on InstanceID i-0c8a54804bdef133a, it must be unmounted prior to a detachment

Yo detach this...

Now, the force detach command

...

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Remove Virtual Machine Snapshots in VMM

Base Cmdlets: $vmmServer='SOMETHINGHERE' $vmName='VMNAMEHERE' $snapshots=Get-SCVMCheckpoint -vmmserver $vmmServer -vm $(get-scvirtualmachine $vmName) $snapshots|%{Remove-SCVMCheckpoint -VMCheckpoint $_} Automation: #…

Hyper-V: Cloning a Virtual Machine

Update 11/25/2021: There's anther variation of this function at: https://blog.kimconnect.com/powershell-create-hyper-v-guest-vm-from-virtual-disk-vhdx/This function will dynamically detect source…

Azure: TrafficManager

Requirement Create a Traffic Manager profile for KimConnect using the Azure portal. Overview ---------------------------------"Setup Phase"1.…