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

delete_on_termination=true attribute on new volume is not set on create #1737

Closed
gregburek opened this issue Apr 4, 2013 · 8 comments
Closed

Comments

@gregburek
Copy link
Contributor

I am using a config hash to create a new EBS volume and attach it to an existing server like so:

      new_ebs_config = {
                        'availability_zone'     => 'us-east-1d,
                        'size'                  => 20,
                        'device'                => "/dev/sdj",
                        'delete_on_termination' => true,
                        'type' => 'standard'
                        'server' => instance_id
      }
      new_volume = @ec2.volumes.create(new_ebs_config)

The delete_on_termination attribute is not being set on this new volume after it has been attached to the server. I have been using

          @ec2.modify_instance_attribute(
            @instance_id, {
              'BlockDeviceMapping.1.DeviceName'              => config['device'],
              'BlockDeviceMapping.1.Ebs.DeleteOnTermination' => config['delete_on_termination'].to_s
            }
          )

It would be nice to have it set after attach is called if server is part of the passed in config.

@geemus
Copy link
Member

geemus commented Apr 5, 2013

@gregburek - makes sense, I'd be happy to help you work on a pull request for it.

@karmi
Copy link

karmi commented Oct 4, 2013

@geemus Seems like the bug is still present. Should I research it a bit and prepare a PR? We're bitten by this in the Elasticsearch Chef cookbook as linked by @abstrctn.

@geemus
Copy link
Member

geemus commented Oct 4, 2013

@karmi sounds great!

@karmi
Copy link

karmi commented Oct 5, 2013

@geemus Looked around a bit:

  • Seems like the proper approach would be to add some logic á la if @server and @delete_on_termination to the save or the attach method in aws/models/compute/volume.rb, which would use modify_instance_attribute as outlined above by @gregburek.
  • Couple of the tests are failing when I run FOG_MOCK=yes bundle exec shindont (output)
  • Are there any unit tests I might add the coverage for this addition?
  • Should I add integration tests to volume_tests.rb?

@geemus
Copy link
Member

geemus commented Oct 7, 2013

I think that sounds reasonable. You may want to ensure you have an up-to-date checkout as we don't seem to be seeing those test failures on travis. Adding some tests would be great, integration with volume_tests would probably be sufficient. @gregburek - any further thoughts?

@gregburek
Copy link
Contributor Author

This all sounds good to me! +1

@plribeiro3000
Copy link
Member

@karmi You already have 2 issues related to this one: sous-chefs/elasticsearch#146 and sous-chefs/elasticsearch#172 . Do you need some help to make this fix hit master?

@plribeiro3000
Copy link
Member

closed in favor of fog/fog-aws#6

@fog fog locked and limited conversation to collaborators Jan 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants