++ed by:

3 PAUSE users
2 non-PAUSE users.

Lincoln D. Stein
and 1 contributors


VM::EC2::BlockDevice::Mapping::EBS - Object describing an EBS volume that has been mapped onto an Amazon EC2 instance


  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;


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;


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.




VM::EC2 VM::EC2::Generic VM::EC2::Snapshot VM::EC2::BlockDevice VM::EC2::BlockDevice::Attachment


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.