nixops-aws icon indicating copy to clipboard operation
nixops-aws copied to clipboard

Cannot destroy separate EBS volumes only

Open tewfik-ghariani opened this issue 5 years ago • 1 comments

Once we provision a set of instances and volumes as separate resources, we cannot destroy only the volumes while keeping the instances. ( using --include vol1_data .. )

As it turns out, the volumes may not be deleted since they are stated as attached to the instances.

 06/18/2019 15:41:36 UTC+0000 - operation [destroy] - DEBUG - frontend_data> destroying EBS volume ‘vol-028af3184122146c6’...
 06/18/2019 15:41:36 UTC+0000 - operation [destroy] - DEBUG - data0_data...> destroying EBS volume ‘vol-0822d531365a8a71c’...
 06/18/2019 15:41:37 UTC+0000 - operation [destroy] - INFO - destroying resources of the network: FAILED.
 06/18/2019 15:41:37 UTC+0000 - operation [destroy] - ERROR - Operation FAILED.
 06/18/2019 15:41:37 UTC+0000 - operation [destroy] - ERROR - EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>VolumeInUse</Code><Message>Volume vol-0822d5db5331a71c is currently attached to i-098fbb426495044e8</Message></Error></Errors><RequestID>724863d0-f2de-404a-b86d-19860fdc96cc</RequestID></Response>

Not sure if this is the expected behavior or a minor bug that can be addressed as a nice to have

If it's the latter, we can add a step to unmount and detach the volume before deleting it instead of throwing this error.

tewfik-ghariani avatar Jun 22 '19 09:06 tewfik-ghariani

Can this be moved to nixops-aws?

tewfik-ghariani avatar May 31 '20 15:05 tewfik-ghariani