elasticsearch/cookbook-elasticsearch — pull request #74 by nixme (2013-03-01 06:36:27+00:00)
Title: EBS Device Name

*This is related to #60*

Some kernels attach EBS devices to `/dev/xvd*` instead of `/dev/sd*`. The data recipe expects the device name to reflect the OS for formatting (which makes sense), but the EBS API always uses /dev/sd* (i.e. attaching a volume with the /dev/xvd* name throws a `/dev/xvda2 is not a valid EBS device name` error).

This change allows a databag to explicitly declare what EBS will use for the device name via `ebs.device`. For example:

```json
{
"/dev/xvda2": {
"file_system": "ext3",
...
"ebs": {
"device": "/dev/sda2",
"size": 200,
"type": "io1",
"iops": 1000
}
}
}
```

Not only does this fix the hanging issue from #60, but successive chef-client runs don't attempt to recreate the volume because the API name doesn't match.

Also includes a Chef 11.4 fix when enumerating EBS volumes. For whatever reason, the databag attribute arrays are immutable and the `initialize_dup` in `reject` preserved immutability causing an exception when truncating members.