How it works…

In this recipe, we started by creating a volume. Volumes are created from snapshots. If you don't specify a snapshot ID, it uses a blank snapshot, and you get a blank volume.

While volumes are hosted redundantly, they are only hosted in a single AZ, so they must be provisioned in the same AZ the instance is running in. The data on a volume is stored in several places in the AZ to ensure a high level of durability, but they are only made available in a single AZ to ensure consistent low latency performance.

The create-volume command returns a response that includes the newly created volume's VolumeId. We then use this ID in the next step.

It can sometimes take a few seconds for a volume to become available. If you are scripting these commands, use the aws ec2 wait command to wait for the volume to become available.

In step 2, we attached a volume to the instance. When attaching to an instance, you must specify the name of the device that it will be presented to the operating system with. Unfortunately, this doesn't guarantee what the device will appear as. In the case of AWS Linux, /dev/sdf becomes /dev/xvdf.

Device naming is kernel-specific, so if you are using something other than AWS Linux, the device name may be different. See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html for full details.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset