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

Make sure that already attached EBS volume is registered in the node data #298

Open
maxnasonov opened this issue Jun 9, 2017 · 3 comments

Comments

@maxnasonov
Copy link

Cookbook version

6.1.1

Chef-client version

12.5.1

Steps to Reproduce:

  1. Attach EBS volume manually or delete existing node data for the volume
  2. Trigger attach action on aws_ebs_volume resource

Expected Result:

The volume is registered as a node attribute

Actual Result:

The volume is not registered as a node attribute

@tas50
Copy link
Contributor

tas50 commented Jun 9, 2017

I ran into this the other day. It's breaking the detach action right now.

@tas50 tas50 added the Type: Bug label Jun 9, 2017
@tas50
Copy link
Contributor

tas50 commented Jun 16, 2017

The real solution here is not to use the node to save state. That's an inherently flawed method of storing ec2 state. I'm noodling on either using tags to store this same data in ec2 or relying on an ohai plugin for ebs volume information.

@glasschef
Copy link

Similarly, if the ebs volume gets deleted by other means (like the console, for example), the old volume id is still saved in node data and will fail when trying to create a new volume:

 ---------------------
    # In /var/chef/cache/cookbooks/ebstest/recipes/default.rb

      7: aws_ebs_volume 'standard_ebs_vol_with_tags' do
      8:   size 1
      9:   device '/dev/sdk'
     10:   tags('Environment' => 'test_kitchen')
     11:   delete_on_termination true
     12:   action [:create, :attach]
     13: end
[2018-08-28T23:05:03+00:00] FATAL: Aws::EC2::Errors::InvalidVolumeNotFound: aws_ebs_volume[standard_ebs_vol_with_tags] (ebstest::default line 7) had an error: Aws::EC2::Errors::InvalidVolumeNotFound: The volume 'vol-0a4707b0c00a7ce18' does not exist.
 "aws": {
      "ebs_volume": {
        "standard_ebs_vol_with_tags": {
          "volume_id": "vol-0a4707b0c00a7ce18"
        }
      }

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

No branches or pull requests

4 participants