Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Might be leaving orphaned EBS volumes #30

Closed
coderanger opened this issue Jan 5, 2014 · 9 comments
Closed

Might be leaving orphaned EBS volumes #30

coderanger opened this issue Jan 5, 2014 · 9 comments
Labels

Comments

@coderanger
Copy link
Contributor

I ended up with 51 unattached volumes after a day of testing.

@sethvargo
Copy link
Contributor

@coderanger I'm not super familiar with the EC2 API/gem. Do you know if there's something special we need to do to also destroy the EBS volumes?

@ghost ghost assigned sethvargo Jan 19, 2014
@JeanMertz
Copy link

@sethvargo @coderanger I am not exactly familiar with the correct syntaxes, but this is what I define in my vagrant-aws config to make sure EBS's are destroyed after termination:

block_device_mapping  = [
  {
    'DeviceName' => '/dev/sda',
    'Ebs.VolumeSize' => 100,
    'Ebs.DeleteOnTermination' => true
  }
]

Hope this helps.

@sethvargo sethvargo removed their assignment Mar 17, 2014
@fnichol
Copy link
Contributor

fnichol commented Mar 17, 2014

@JeanMertz would that config go into the server create call in fog? Thanks!

@JeanMertz
Copy link

@fnichol see: https://groups.google.com/forum/#!topic/ruby-fog/EhAPWxsXsCY

In short:

@compute.servers.create(
  flavor_id: 'm1.small',
  image_id: 'ami-83e4bcea',
  block_device_mapping: [{
    'DeviceName' => '/dev/sda1',
    'Ebs.VolumeSize' => 20,
    'Ebs.DeleteOnTermination' => true
  }]
)

@fnichol
Copy link
Contributor

fnichol commented Mar 19, 2014

@JeanMertz I think that's what I needed, thank you :)

@JigarJoshi
Copy link
Contributor

@fnichol ran into exact same issue with at little higher scale, this is quick fix #45 as @JeanMertz provided

@JigarJoshi
Copy link
Contributor

can we merge it ?

@sethvargo
Copy link
Contributor

Fixed in a18c88a

@akuzminsky
Copy link

The bug still exists

$ chef gem list | grep -e ec2 -e kitchen
...
kitchen-ec2 (3.2.0)
...
test-kitchen (2.3.3)
---
driver:
  name: ec2
  iam_profile_name: kitchen-test

After kitchen test the volume didn't get destroyed.

Screenshot 2020-04-25 22 57 22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants