0

When I create new image using glance does not matter if using cli or gui I am getting returned code 0 and image is created but its size is zero. The behavior is slightly different as from GUI my browser crushes but stil image is created from cli I am getting return code 0.

Command:

openstack image create --file cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public --debug cirros-deb

    +------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | d41d8cd98f00b204e9800998ecf8427e                     |
| container_format | bare                                                 |
| created_at       | 2018-01-20T23:24:47Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/c695bc30-731d-4a4f-ab0f-12eb972d8188/file |
| id               | c695bc30-731d-4a4f-ab0f-12eb972d8188                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-deb                                           |
| owner            | a3460a3b0e8f4d0bbdd25bf790fe504c                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 0                                                    |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-01-20T23:24:47Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+
clean_up CreateImage: 
END return value: 0

I tried with different cirros image and with ubuntu cloud image always behavior is the same. Under /var/lib/glance/images file is created with size 0:

-rw-r-----. 1 glance glance 0 Jan 21 00:24 c695bc30-731d-4a4f-ab0f-12eb972d8188

grep c695bc30-731d-4a4f-ab0f-12eb972d8188 glance/api.log

2018-01-21 00:24:47.915 1894 INFO eventlet.wsgi.server [req-7246cd30-47c4-41a5-b358-c8e5cc0f4e56 8bd3e4905ffb4f698e2476d9080a7d90 a3460a3b0e8f4d0bbdd25bf790fe504c - default default] 172.19.254.50 - - [21/Jan/2018 00:24:47] "PUT /v2/images/c695bc30-731d-4a4f-ab0f-12eb972d8188/file HTTP/1.1" 204 213 0.111323
2018-01-21 00:24:47.931 1894 INFO eventlet.wsgi.server [req-28e0cda2-c9f7-4543-b19a-d59eccffa47e 8bd3e4905ffb4f698e2476d9080a7d90 a3460a3b0e8f4d0bbdd25bf790fe504c - default default] 172.19.254.50 - - [21/Jan/2018 00:24:47] "GET /v2/images/c695bc30-731d-4a4f-ab0f-12eb972d8188 HTTP/1.1" 200 780 0.015399

Any idea what can be wrong?

  • 1
    Is your filesystem out of space? If you run Glance with debugging enabled, do you see any useful information in the logs? Have you also checked the glance registry log? – larsks Jan 21 '18 at 03:47
  • I actually found a solution based on https://ask.openstack.org/en/question/101944/why-does-openstack-image-create-of-cirros-result-in-size-0/?answer=102303#post-id-102303. I found mentioned python script in following location: /usr/lib/python2.7/site-packages/glanceclient/common/http.py. To find it I basically did find / -name http.py – Andrzej Kozlowski Jan 21 '18 at 09:45

1 Answers1

0

Find location of python glance client.

find / -name http.py

vi /usr/lib/python2.7/site-packages/glanceclient/common/http.py

- data = self._chunk_body(data)
+ pass

Referenc: https://bugs.launchpad.net/python-glanceclient/+bug/1666511

https://ask.openstack.org/en/question/101944/why-does-openstack-image-create-of-cirros-result-in-size-0/?answer=102303#post-id-102303