Skip Menu |

This queue is for tickets about the Net-Amazon-EC2 CPAN distribution.

Report information
The Basics
Id: 113851
Status: resolved
Priority: 0/
Queue: Net-Amazon-EC2

People
Owner: Nobody in particular
Requestors: oneill [...] oinc.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Unable to call run_instances with BlockDeviceMapping parameters
Date: Sun, 17 Apr 2016 21:02:46 -0400
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Brian O'Neill <oneill [...] oinc.net>
I am trying to create an instance which has available two ephemeral instance stores, but I can't figure out how to do it. My code is currently: my $newinstance = $ec2->run_instances( MinCount => 1, MaxCount => 1, ImageId => $ami, KeyName => $keyname, SecurityGroupId => \@securitygroupids, UserData => $userdata, InstanceType => $instancetype, #Placement.AvailabilityZone => $avzone, SubnetId => $subnetid, PrivateIpAddress => $newsimip, BlockDeviceMapping.VirtualName => ['ephemeral0','ephemeral1'], BlockDeviceMapping.DeviceName => ['/dev/sdd','/dev/sde'], ); But when I run it, I get the error: The following parameter was passed in the call to Net::Amazon::EC2::run_instances but was not listed in the validation options: BlockDeviceMappingVirtualName I can see in the code that it is supposed to take the VirtualName and DeviceName attributes, and turn them in to BlockDeviceMapping.1.VirtualName BlockDeviceMapping.1.DeviceName etc., but it does not appear like it is doing that. I'm also wondering of the API may have changed - it currently describes the parameter as: BlockDeviceMapping.N The block device mapping. Type: BlockDeviceMapping list Required: No
On Sun Apr 17 21:03:01 2016, oneill@oinc.net wrote: Show quoted text
> I am trying to create an instance which has available two ephemeral > instance stores, but I can't figure out how to do it.
What version of the library are you using?
Subject: Re: [rt.cpan.org #113851] Unable to call run_instances with BlockDeviceMapping parameters
Date: Mon, 18 Apr 2016 12:51:29 -0400
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Brian O'Neill <oneill [...] oinc.net>
0.31 On 4/18/2016 12:46 PM, Mark Allen via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=113851 > > > On Sun Apr 17 21:03:01 2016, oneill@oinc.net wrote:
>> I am trying to create an instance which has available two ephemeral >> instance stores, but I can't figure out how to do it.
> > What version of the library are you using? >
On Sun Apr 17 21:03:01 2016, oneill@oinc.net wrote: Show quoted text
> BlockDeviceMapping.VirtualName => ['ephemeral0','ephemeral1'], > BlockDeviceMapping.DeviceName => ['/dev/sdd','/dev/sde'],
These two hash keys *MUST* be quoted on the left hand side, otherwise perl will treat them as bare words and nothing works. I sat down and wrote a test case for this tonight. https://gist.github.com/mrallen1/96ffed55630217f75def4f9d19aa5732 Without quotes, the test case gives: prove -lv t/05_rt113851.t t/05_rt113851.t .. Bareword "BlockDeviceMapping" not allowed while "strict subs" in use at t/05_rt113851.t line 35. Bareword "BlockDeviceMapping" not allowed while "strict subs" in use at t/05_rt113851.t line 35. Execution of t/05_rt113851.t aborted due to compilation errors. With quotes, things are serialized as expected and a request is sent to EC2. Please let me know if adding single (or double) quotes to your hash keys fixes your problem. Thanks.
Subject: Re: [rt.cpan.org #113851] Unable to call run_instances with BlockDeviceMapping parameters
Date: Thu, 21 Apr 2016 09:48:34 -0400
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Brian O'Neill <oneill [...] oinc.net>
This definitely worked by single quoting the names on the left hand side...thanks! On 4/19/2016 1:01 AM, Mark Allen via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=113851 > > > On Sun Apr 17 21:03:01 2016, oneill@oinc.net wrote:
>> BlockDeviceMapping.VirtualName => ['ephemeral0','ephemeral1'], >> BlockDeviceMapping.DeviceName => ['/dev/sdd','/dev/sde'],
> > These two hash keys *MUST* be quoted on the left hand side, otherwise perl will treat them as bare words and nothing works. > > I sat down and wrote a test case for this tonight. https://gist.github.com/mrallen1/96ffed55630217f75def4f9d19aa5732 > > Without quotes, the test case gives: > > prove -lv t/05_rt113851.t > t/05_rt113851.t .. Bareword "BlockDeviceMapping" not allowed while "strict subs" in use at t/05_rt113851.t line 35. > Bareword "BlockDeviceMapping" not allowed while "strict subs" in use at t/05_rt113851.t line 35. > Execution of t/05_rt113851.t aborted due to compilation errors. > > With quotes, things are serialized as expected and a request is sent to EC2. > > Please let me know if adding single (or double) quotes to your hash keys fixes your problem. > > Thanks. >
On Thu Apr 21 09:48:54 2016, oneill@oinc.net wrote: Show quoted text
> This definitely worked by single quoting the names on the left hand > side...thanks!
Cool! Closing this ticket.