Reputation: 7412
Following glance command to add image is failing
glance add name="CirrOS 0.3.1" disk-format=qcow2 container-format=bare is-public=true < cirros-0.3.1-x86_64-disk.img
and the error recieved
Uploading image 'CirrOS 0.3.1'
=============================================================[100%] 5.68M/s, ETA 0h 0m 0s
Failed to add image. Got error:
Data supplied was not valid.
Details: 400 Bad Request
The server could not comply with the request since it is either malformed or otherwise incorrect.
Failed to activate image. Got error: Data supplied was not valid. Details: 400 Bad Request The server could not comply with the request since it is either malformed or otherwise incorrect. Failed to update image metadata. Got error: Data supplied was not valid. Details: Invalid disk format 'None' for image.
Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.
Not sure which argument went wrong any help appreciated
this is my file
ubuntu@ubuntu:~/images$ file cirros-0.3.1-x86_64-disk.img
cirros-0.3.1-x86_64-disk.img: QEMU QCOW Image (v2), 41126400 bytes
Upvotes: 0
Views: 962
Reputation: 87074
One of these options should work:
The command argument names should use underscores (_
) instead of dashes (-
):
glance add name="CirrOS 0.3.1" disk_format=qcow2 container_format=bare is_public=true < cirros-0.3.1-x86_64-disk.img
Alternatively it might be that the command arguments need to be prefixed with --
:
glance add --name="CirrOS 0.3.1" --disk-format=qcow2 --container-format=bare --is-public=true < cirros-0.3.1-x86_64-disk.img
Upvotes: 2