[ create a new paste ] login | about

Link: http://codepad.org/GW4bZ3nQ    [ raw code | fork ]

PHP, pasted on Nov 29:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

$keypair = $compute->createKeypair([
    'name'      => uniqid(), 
    'publicKey' => $stringOfPubKey,
]);


$options = [
    'name'            => uniqid('foobar'),
    'imageId'         => $imageId,
    'flavorId'        => $flavorId,
    'security_groups' => ['name' => 'default'],
    // Keypair is not added..
    'key_name'        => $keypair->name,
];

$compute->createServer($options);

// It all works, except for adding the KeyPair. What's wrong?


Create a new paste based on this one


Comments: