rightscale-cookbooks / ephemeral_lvm

Configures available ephemeral devices on a cloud server
http://community.opscode.com/cookbooks/ephemeral_lvm
Other
13 stars 16 forks source link

ephemeral_lvm cookbook

Cookbook Release Build Status

This cookbook will identify the ephemeral devices available on the instance based on Ohai data. If no ephemeral devices are found, it will gracefully exit with a log message. If ephemeral devices are found, they will be setup to use LVM and a logical volume will be created, formatted, and mounted. If multiple ephemeral devices are found (e.g. m1.large on EC2 has 2 ephemeral devices with 420 GB each), they will be striped to create the LVM.

Github Repository: https://github.com/rightscale-cookbooks/ephemeral_lvm

Requirements

Usage

Place the ephemeral_lvm::default in the runlist and the ephemeral devices will be setup.

Notes on detection of ephemeral devices on newer AWS EC2 instance types

With the following instances, EBS volumes are exposed as NVMe block devices: c5, c5d, i3.metal, m5, and m5d. The device names are /dev/nvme0n1, /dev/nvme1n1, and so on. The device names that you specify in a block device mapping are renamed using NVMe device names (/dev/nvme[0-26]n1). https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html

This also affects ephemeral SSD devices that are always attached and for which the mapping isn't present in metadata. The current cookbook version tries to find all NVMe devices that aren't mounted.

Note 1) Instance type i3 is a special case which allows you to map the ephemeral SSDs although there's a naming mismatch /dev/sdb vs. /dev/nvme0n1. In this case you shouldn't "map" the ephemeral volumes when starting the instance as they are always attached and will only be detected if mapping is not present.

Note 2) To keep things simple if you map additional EBS volumes to the instance types mentioned above the cookbook won't make a distinction between ephemeral devices and EBS volumes and will include all in the logical volume.

Attributes

Recipes

default

This recipe sets up available ephemeral devices to be an LVM device, formats it, and mounts it.

Author

Author:: RightScale, Inc. (cookbooks@rightscale.com)