Thank you for visiting the Rackspace Community
The Community is currently in read-only mode. All content is available, but the ability to post new content or topics is not available at this time.

Please contact your support team if you have a question or need assistance for any Rackspace products, services, or articles.

Create server with Bootable Volume

This question is not answered.

Hi friends ,

I was downloaded the SDK for openstack cloud [ php platform ] .

Now I want to create a server [ instance ] in volume base method , use ceph stortage and not local storage , So after calling auth methods I create a volume from image with this method :

$service = $openstackV2->blockStorageV2();

$volume = $service->createVolume([
    'description' => 'test',
    'size'        => 100,
    'name'        => 'test',
    'imageId'     => '1722bcf0-eca8-4acf-8ed9-94c6f6a84e1d',

which ImageId is the default cirros image and is available in my cloud .

every thing is fine and the image has been created and marked as bootable .

So I want to create a server with this volume and I do this :

$instance_details = [
    // Required
    'name'     => 'sinatest',
   'volume'  => 'test',
    'flavorId' => '1',

    // Required if multiple network is defined
    'networks'  => [
       ['uuid' => 'e641d226-a9ed-4f84-925d-a442f466d9d3']

    // Optional
    'metadata' => ['foo' => 'bar'],
    'userData' => base64_encode('echo "Hello World. The time is now $(date -R)!" | tee /root/output.txt')

// Create the server
/**@var OpenStack\Compute\v2\Models\Server $server */
$server = $compute->createServer($instance_details);

but at result it says that :

Fatal error: Uncaught Exception: "imageId" is a required option, but it was not provided ...

Do anyone have idea about this ?

All Replies