<?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?