VM::EC2::BlockDevice::Mapping::EBS - Object describing an EBS volume that has been mapped onto an Amazon
Contents
Description
This object is used to describe an Amazon EBS volume that is mapped onto an EC2 block device. It is
returned by VM::EC2->describe_instances().
It is easy to confuse this with VM::EC2::BlockDevice::EBS, which describes the parameters needed to
create the EBS volume when an image is launched. This class is instead used to describe an active mapping
between an instance's block device and the underlying EBS volume.
Because all the methods in this class are passed through to VM::EC2::BlockDeviceMapping, it is somewhat
simpler to call them directly on the BlockDeviceMapping object:
my $instance = $ec2->describe_instances(-instance_id=>'i-123456');
my @devices = $instance->blockDeviceMapping;
for my $d (@devices) {
$volume_id = $d->volumeId;
$status = $d->status;
$atime = $d->attachmentTime;
$delete = $d->delete;
$volume = $d->volume;
}
Methods
The following object methods are supported:
volumeId -- ID of the volume.
status -- One of "attaching", "attached", "detaching", "detached"
attachTime -- Time this volume was attached
deleteOnTermination -- Whether the volume will be deleted when its attached
instance is deleted. Note that this returns the perl
0/1 booleans rather than "false"/"true" strings.
In addition, the following convenience method is supported:
$vol=$ebs->volume
This returns the VM::EC2::Volume object that corresponds to this EBS. The volume will provide additional
information, such as availabilit zone.
Name
VM::EC2::BlockDevice::Mapping::EBS - Object describing an EBS volume that has been mapped onto an Amazon
EC2 instance
See Also
VM::EC2 VM::EC2::Generic VM::EC2::Snapshot VM::EC2::BlockDevice VM::EC2::BlockDevice::Attachment
String Overloading
NONE
Synopsis
use VM::EC2;
my $instance = $ec2->describe_instances(-instance_id=>'i-123456');
my @devices = $instance->blockDeviceMapping;
for my $d (@devices) {
my $ebs = $d->ebs;
$volume_id = $ebs->volumeId;
$status = $ebs->status;
$atime = $ebs->attachmentTime;
$delete = $ebs->delete;
$volume = $ebs->volume;
}
