amazon web services - How to resize Root Disk with runInstance in PHP -


       $cmd = 'runinstances';        $result = $client->$cmd(array(         'imageid' => selectami($_post['dc'], $_post['os']),         'mincount' => 1,         'maxcount' => 1,         'instancetype' => $_post['itype'],         'keyname' => $_post['key'],         'securitygroups' => array($securitygroupname),         'blockdevicemappings' => array(             'devicename' => '/dev/sda1',             array(                 'ebs' => array(                     'snapshotid' => 'snap-2337bd2a',                     'volumesize' => $disksize,                     'deleteontermination' => true,                     'volumetype' => 'gp2',                     'encrypted' => false                 )             )         )        ));  

what wrong this, not work , no error?

your blockdevicemappings part not structured correctly.

you have devicename outside second array structure, should inside.

try this:

$cmd = 'runinstances'; $result = $client->$cmd(array(     'imageid' => selectami($_post['dc'], $_post['os']),     'mincount' => 1,     'maxcount' => 1,     'instancetype' => $_post['itype'],     'keyname' => $_post['key'],     'securitygroups' => array($securitygroupname),     'blockdevicemappings' => array(         array(             'devicename' => '/dev/sda1',             'ebs' => array(                 'snapshotid' => 'snap-2337bd2a',                 'volumesize' => $disksize,                 'deleteontermination' => true,                 'volumetype' => 'gp2',                 'encrypted' => false             )         )     ) )); 

Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -