NAME

VM::EC2::BlockDevice - Object describing how to construct an EC2 block device when launching an image

SYNOPSIS

use VM::EC2;

$ec2        = VM::EC2->new(...);
$image      = $ec2->describe_images(-image_id=>'ami-123456');
my @devices = $image->blockDeviceMapping;
for my $d (@devices) {
  my $virtual_device = $d->deviceName;
  my $snapshot_id    = $d->snapshotId;
  my $volume_size    = $d->volumeSize;
  my $delete         = $d->deleteOnTermination;
}

DESCRIPTION

This object represents an Amazon block device associated with an AMI. The information in it is used to create a new volume when the AMI is launched. The object is returned by VM::EC2->describe_images().

Please see VM::EC2::Generic for methods shared by all VM::EC2 objects.

METHODS

These object methods are supported:

deviceName  -- name of the device, such as /dev/sda1
virtualName -- virtual device name, such as "ephemeral0"
noDevice    -- true if no device associated
ebs         -- parameters used to automatically set up Amazon EBS
               volumes when an instance is booted. This returns
               a VM::EC2::BlockDevice::EBS object.

For your convenience, a number of the ebs() object's methods are passed through:

snapshotId  -- ID of the snapshot used to create this EBS when an
               instance is launched from this image.
volumeSize  -- Size of the EBS volume (in gigs).
deleteOnTermination -- Whether this EBS will be deleted when the
               instance terminates.

STRING OVERLOADING

When used in a string context, this object will be interpolated as:

deviceName=snapshotId:volumeSize:deleteOnTermination

e.g.

/dev/sdg=snap-12345:20:true

This happens to be the same syntax used to specify block device mappings in run_instances(). See VM::EC2.

SEE ALSO

VM::EC2 VM::EC2::Generic VM::EC2::BlockDevice VM::EC2::BlockDevice::Attachment VM::EC2::BlockDevice::EBS VM::EC2::Volume

AUTHOR

Lincoln Stein <lincoln.stein@gmail.com>.

Copyright (c) 2011 Ontario Institute for Cancer Research

This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.