ZF-9644: Not all instances are returned by describe()

Description

When trying to call ->describe() with two instance IDs in an array, I only get info of 1 instance in the response, despite the fact that the response XML from EC2 contains both instances I've asked for. Both instances are up and running.

The code I'm using:


$info = $instance->describe(
   array('i-16cd7c61', 'i-14cd7c63')
);

var_dump($info, $instance->getHttpClient()->getLastResponse()->getBody());

and the output:


array(1) {
  ["instances"]=>
  array(1) {
    [0]=>
    array(17) {
      ["reservationId"]=>
      string(10) "r-304dec47"
      ["ownerId"]=>
      string(12) "--deleted--"
      ["groupSet"]=>
      array(1) {
        [0]=>
        string(9) "zs-node01"
      }
      ["instanceId"]=>
      string(10) "i-14cd7c63"
      ["imageId"]=>
      string(12) "ami-d78ea5a3"
      ["instanceState"]=>
      array(2) {
        ["code"]=>
        string(2) "16"
        ["name"]=>
        string(7) "running"
      }
      ["privateDnsName"]=>
      string(43) "ip-10-224-98-212.eu-west-1.compute.internal"
      ["dnsName"]=>
      string(48) "ec2-79-125-61-48.eu-west-1.compute.amazonaws.com"
      ["keyName"]=>
      string(7) "pokus01"
      ["productCode"]=>
      string(0) ""
      ["instanceType"]=>
      string(8) "m1.small"
      ["launchTime"]=>
      string(24) "2010-04-09T19:27:04.000Z"
      ["availabilityZone"]=>
      string(10) "eu-west-1b"
      ["kernelId"]=>
      string(12) "aki-02486376"
      ["ramediskId"]=>
      string(0) ""
      ["amiLaunchIndex"]=>
      string(1) "1"
      ["monitoringState"]=>
      string(8) "disabled"
    }
  }
}
string(3475) "<?xml version="1.0"?>
fc2b5bd3-a59e-437b-b4a1-4824e129f926r-304dec47--deleted--zs-node01i-16cd7c61ami-d78ea5a316
                        runningip-10-228-99-116.eu-west-1.compute.internalec2-79-125-55-74.eu-west-1.compute.amazonaws.compokus010m1.small2010-04-09T19:27:04.000Zeu-west-1baki-02486376ari-fa4d668edisabledi-14cd7c63ami-d78ea5a316
                        runningip-10-224-98-212.eu-west-1.compute.internalec2-79-125-61-48.eu-west-1.compute.amazonaws.compokus011m1.small2010-04-09T19:27:04.000Zeu-west-1baki-02486376ari-fa4d668edisabled"

Note how the dumped array only shows one instance, but the XML contains both.

Comments

Attached is a dead-simple patch against rev. 21805 which seems to solve the problem, at least for my use case. Not sure it's the right way.

Fixed in r22046