php-opencloud / openstack

PHP SDK for OpenStack clouds
Apache License 2.0
221 stars 148 forks source link

Documentation bug for createVolume method #344

Open palaueb opened 2 years ago

palaueb commented 2 years ago

I have found a small bug into documentation about creation of volumes: https://php-opencloudopenstack.readthedocs.io/en/latest/services/block-storage/v2/volumes.html#create-from-image

It uses sourceVolumeId, but it's not the correct attribute, in this case you need to use imageId:

$volume = $service->createVolume([
        'description'    => 'Volume for new server'
        'size'           => 10,
        'name'           => 'delete_me_volume',
        'imageId'        => $imageId
    ]);

Thanks for this awesome work!