When attempting to upload a image to OpenStack Glance, the operation fails with a "500 Internal Server Error" response. This issue occurs despite the image creation command appearing to succeed initially.
The following command demonstrates the failed upload attempt:
glance image-create --name "CentOS_7.5_238.110" --file CentOS_7.5_238.110-disk-0.qcow2 --disk-format qcow2 --container-format bare --visibility=public
The command returns a response showing the image metadata, inlcuding an ID and status of "queued", but ultimately fails with:
HTTP 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation.
The returned metadata appears as follows:
| Property | Value | |------------------+--------------------------------------| | checksum | None | | container_format | bare | | created_at | 2023-07-03T06:30:33Z | | disk_format | qcow2 | | id | fc3d619f-2397-44f3-ba73-5f475a752fc5 | | min_disk | 0 | | min_ram | 0 | | name | CentOS_7.5_238.110 | | os_hash_algo | None | | os_hash_value | None | | os_hidden | False | | owner | d660e1d89bca45329cd3bf9f7ef8368b | | protected | False | | size | None | | status | queued | | tags | [] | | updated_at | 2023-07-03T06:30:33Z | | virtual_size | Not available | | visibility | public |
Analyzing the Glance service logs reveals the root cause of the failure:
2023-07-03 14:35:55.631 5212 ERROR glance.api.v2.image_data [req-cbf3085d-bb1d-454d-bbde-22b46e64c95f 444079fb80974ad5a752f1e99a0352cd d660e1d89bca45329cd3bf9f7ef8368b - default default] Failed to upload image data due to internal error: OSError: [Errno 122] Disk quota exceeded
2023-07-03 14:35:55.654 5212 ERROR glance.common.wsgi [req-cbf3085d-bb1d-454d-bbde-22b46e64c95f 444079fb80974ad5a752f1e99a0352cd d660e1d89bca45329cd3bf9f7ef8368b - default default] Caught error: [Errno 122] Disk quota exceeded: OSError: [Errno 122] Disk quota exceeded
The traceback in the logs indicates the error originates from the filesystem storage driver when attempting to write the image data:
File "/usr/lib/python3.6/site-packages/glance_store/_drivers/filesystem.py", line 757, in add
f.write(buf)
OSError: [Errno 5] Input/output error
This error is followed by additional exception handling attempts, ultimately resulting in the disk quota exceeded error being propagated up through the call stack.
The critical error message OSError: [Errno 122] Disk quota exceeded indicates that the filesystem hosting the Glance image store has ensufficient available space to accommodate the uploaded image.
Resolution of this issue requires expanding the storage capacity of the underlying filesystem to ensure adequate space for image uploads.