按照glance命令添加图像失败
glance add name="CirrOS 0.3.1" disk-format=qcow2 container-format=bare is-public=true < cirros-0.3.1-x86_64-disk.img
并收到错误
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'.
不确定哪个参数出错了任何帮助赞赏
这是我的档案
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
答案 0 :(得分:2)
其中一个选项应该有效:
命令参数名称应使用下划线(_
)而不是破折号(-
):
glance add name="CirrOS 0.3.1" disk_format=qcow2 container_format=bare is_public=true < cirros-0.3.1-x86_64-disk.img
或者,可能是命令参数需要以--
为前缀:
glance add --name="CirrOS 0.3.1" --disk-format=qcow2 --container-format=bare --is-public=true < cirros-0.3.1-x86_64-disk.img