I'm able to create empty volumes just fine, but when I try to specify an image:
service = Fog::Compute.new({ auth stuff here})
v = service.create_volume('test volume','A testing volume created with fog', 5, {imageRef: '851ebad1-4cfe-468f-94a7-08dfc6b2d29d'})
If I hit cinder directly though, it works as expected. For example:
Hitting nova-api's volume extension with a curl reconstruction of the call that fog makes, even with the imageref and bootable flags added, creates an empty volume: curl -s -H "X-Auth-Token: $TOKEN" -X POST -H "Content-Type: application/json"
http://openstack-api.local:8774/v2/b5901343f263457aab3ef432fae3c656/os-volumes -d "{\"volume\":{\"display_name\":\"test volume\",\"display_description\":\"A testing volume created with fog\",\"size\":5,\"imageRef\":\"851ebad1-4cfe-468f-94a7-08dfc6b2d29d\",\"bootable\":true}}"
Hitting cinder-api with curl, and the identical request (except hitting /volumes instead of /os-volumes since I'm no longer using the nova volumes extension), creates a volume from the image as expected: curl -s -H "X-Auth-Token: $TOKEN" -X POST -H "Content-Type: application/json"
http://openstack-api.local:8776/v2/b5901343f263457aab3ef432fae3c656/volumes -d "{\"volume\":{\"display_name\":\"test volume\",\"display_description\":\"A testing volume created with fog\",\"size\":5,\"imageRef\":\"851ebad1-4cfe-468f-94a7-08dfc6b2d29d\",\"bootable\":true}}"
It seems like with Fog, we should be making this request to the cinder endpoint rather than the nova endpoint.
Is this something I'm doing wrong? Should I be doing something else to create a volume from an image in Fog, or is it a bug in Fog?
Any thoughts or input would be helpful.
QH