# How to force EBS volume to detached from EC2? ec2\_vol is not working.

**URL:** <https://forum.ansible.com/t/how-to-force-ebs-volume-to-detached-from-ec2-ec2-vol-is-not-working/24128>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [April 3, 2017, 3:20pm UTC](https://forum.ansible.com/t/how-to-force-ebs-volume-to-detached-from-ec2-ec2-vol-is-not-working/24128 "2017-04-03T15:20:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhavin\_Parmar](https://avatars.discourse-cdn.com/v4/letter/b/7ab992/32.png) [@Bhavin\_Parmar](https://forum.ansible.com/u/Bhavin_Parmar)\
**Post date:** [April 3, 2017, 3:20pm UTC](https://forum.ansible.com/t/how-to-force-ebs-volume-to-detached-from-ec2-ec2-vol-is-not-working/24128/1 "2017-04-03T15:20:40Z")

</div>

I am trying to detach EBS volume:

**— # Ansible role to detach EBS Volume**  
**- name: Detach AWS EBS Volume**  
**ec2\_vol:**  
**aws\_access\_key: ‘{{ AwsAccesskey }}’**  
**aws\_secret\_key: ‘{{ AwsSecretkey }}’**  
**region: ‘{{ region }}’**  
**id: ‘{{ item }}’**  
**instance: None**  
**with\_items: “{{ awsebsid }}”**  
**…**

It is not able to detach EBS volume if it is mounted. Please, can you suggest how to force or detach EBS volume? I understand it is best practice to unmount the volume from OS before detaching but is it compulsory?
