[Openstack] Can't create image w/ glance.
xu cai
jeffreycai at gmail.com
Mon Jan 4 04:00:09 UTC 2016
hi Tzach
thanks a lot. there is a traceback, please help to check this further. if
you need full logs. please let me know.
stack at ubuntu:~/workspace/devstack/files/images$ dpkg -l | grep glance
rc glance-api
1:2014.1.5-0ubuntu1 all OpenStack
Image Registry and Delivery Service - API
ii glance-common
1:2014.1.5-0ubuntu1 all OpenStack
Image Registry and Delivery Service - Common
rc glance-registry
1:2014.1.5-0ubuntu1 all OpenStack
Image Registry and Delivery Service - Registry
ii python-glance
1:2014.1.5-0ubuntu1 all OpenStack
Image Registry and Delivery Service - Python library
ii python-glanceclient
1:0.12.0-0ubuntu1 all Client
library for Openstack glance server.
stack at ubuntu:~/workspace/devstack/files/images$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
stack at ubuntu:~/workspace/devstack/files/images$
stack at ubuntu:~/workspace/devstack/files/images$ glance --debug image-create
--name test --disk-format qcow2 --container-format bare --file
cirros-0.3.2-x86_64-disk.img
curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H
'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H
'X-Auth-Token: {SHA1}f9d1da2084103a87297efa1fc06d392faa831bc8' -H
'Content-Type: application/octet-stream'
http://192.168.95.10:9292/v2/schemas/image
.....
.....
HTTP/1.1 201 Created
Content-Length: 549
Connection: keep-alive
Location:
http://192.168.95.10:9292/v2/images/206c29ce-3848-4684-8d10-8b9748064bfd
Date: Mon, 04 Jan 2016 03:53:33 GMT
Content-Type: application/json; charset=UTF-8
X-Openstack-Request-Id: req-55bb29f5-a0b8-4d42-a595-d7b0efa970c4
{"status": "queued", "name": "test", "tags": [], "container_format":
"bare", "created_at": "2016-01-04T03:53:33Z", "size": null, "disk_format":
"qcow2", "updated_at": "2016-01-04T03:53:33Z", "visibility": "private",
"self": "/v2/images/206c29ce-3848-4684-8d10-8b9748064bfd", "min_disk": 0,
"protected": false, "id": "206c29ce-3848-4684-8d10-8b9748064bfd", "file":
"/v2/images/206c29ce-3848-4684-8d10-8b9748064bfd/file", "checksum": null,
"owner": "5bf6c2c889c646babb4323ce3f3ea265", "virtual_size": null,
"min_ram": 0, "schema": "/v2/schemas/image"}
curl -g -i -X PUT -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H
'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H
'X-Auth-Token: {SHA1}f9d1da2084103a87297efa1fc06d392faa831bc8' -H
'Content-Type: application/octet-stream'
http://192.168.95.10:9292/v2/images/206c29ce-3848-4684-8d10-8b9748064bfd/file
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2016-01-04T03:53:33Z |
| disk_format | qcow2 |
| id | 206c29ce-3848-4684-8d10-8b9748064bfd |
| min_disk | 0 |
| min_ram | 0 |
| name | test |
| owner | 5bf6c2c889c646babb4323ce3f3ea265 |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated_at | 2016-01-04T03:53:33Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line
605, in main
args.func(client, args)
File
"/usr/local/lib/python2.7/dist-packages/glanceclient/common/utils.py", line
98, in func_wrapper
return func(gc, args)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py",
line 84, in do_image_create
do_image_upload(gc, args)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py",
line 311, in do_image_upload
gc.images.upload(args.id, image_data, args.size)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py",
line 213, in upload
self.http_client.put(url, headers=hdrs, data=body)
File
"/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line
290, in put
return self._request('PUT', url, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line
257, in _request
**kwargs)
File
"/usr/local/lib/python2.7/dist-packages/requests-2.8.1-py2.7.egg/requests/sessions.py",
line 468, in request
resp = self.send(prep, **send_kwargs)
File
"/usr/local/lib/python2.7/dist-packages/requests-2.8.1-py2.7.egg/requests/sessions.py",
line 576, in send
r = adapter.send(request, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/requests-2.8.1-py2.7.egg/requests/adapters.py",
line 376, in send
timeout=timeout
File
"/usr/local/lib/python2.7/dist-packages/requests-2.8.1-py2.7.egg/requests/packages/urllib3/connectionpool.py",
line 559, in urlopen
body=body, headers=headers)
File
"/usr/local/lib/python2.7/dist-packages/requests-2.8.1-py2.7.egg/requests/packages/urllib3/connectionpool.py",
line 353, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python2.7/httplib.py", line 979, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1013, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 839, in _send_output
self.send(message_body)
File "/usr/lib/python2.7/httplib.py", line 811, in send
self.sock.sendall(data)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
TypeError: must be string or buffer, not generator
must be string or buffer, not generator
On Thu, Dec 31, 2015 at 10:55 PM, Tzach Shefi <tshefi at redhat.com> wrote:
> So < filename should also work I've seen this around, yet I too prefer
> using using --file FullPathToImage
>
> Suggest trying with --debug like below:
>
> $ glance --debug image-create --name test --disk-format qcow2
> --container-format bare --file cirros-0.3.2-x86_64-disk.img
>
> To debug things get rid of all the extra stuff:
> Remove --progress - in the past I noticed a few bugs related to it.
> Remove --public - for debugging, you can later edit the image once it's
> uploaded and set to public, this option syntax recently changed on Kilo or
> Liberty I can't remember, don't know what your using.
> Idea is to try to do the most basic upload command and see what happens,
> then start adding optional switches.
>
> On /etc/glance/glance-api.conf set debug=true and restart glance service
> to get extra stuff out to logs.
> Check your Glance logs (/var/log/glance), do you get any error traceback?
>
> Which version of OS/Openstack?
> Which Glance backend, can you share glance-api.conf file?
>
> Tzach
>
>
> On Thu, Dec 31, 2015 at 12:12 PM, Hinds, Luke (Nokia - GB/Bristol) <
> luke.hinds at nokia.com> wrote:
>
>> I think you might be missing a space between < and
>> cirros-0.3.2-x86_64-disk.img
>>
>> Also, I am pretty sure it should be --file IMAGE
>>
>> ________________________________________
>> From: EXT xu cai [jeffreycai at gmail.com]
>> Sent: Thursday, December 31, 2015 7:02 AM
>> To: openstack at lists.openstack.org
>> Subject: [Openstack] Can't create image w/ glance.
>>
>> stack at ubuntu:~/workspace/devstack/files/images$ glance image-create
>> --name test --disk-format qcow2 --container-format bare --visibility public
>> --progress <cirros-0.3.2-x86_64-disk.img
>> +------------------+--------------------------------------+
>> | Property | Value |
>> +------------------+--------------------------------------+
>> | checksum | None |
>> | container_format | bare |
>> | created_at | 2015-12-31T06:55:27Z |
>> | disk_format | qcow2 |
>> | id | 7938704e-74e5-4034-b502-1a0a633ec695 |
>> | min_disk | 0 |
>> | min_ram | 0 |
>> | name | test |
>> | owner | 549133f74d044c47a8efaf37708de53d |
>> | protected | False |
>> | size | None |
>> | status | queued |
>> | tags | [] |
>> | updated_at | 2015-12-31T06:55:27Z |
>> | virtual_size | None |
>> | visibility | public |
>> +------------------+--------------------------------------+
>> must be string or buffer, not generator
>> stack at ubuntu:~/workspace/devstack/files/images$
>> stack at ubuntu:~/workspace/devstack/files/images$ glance image-list
>> +--------------------------------------+------+
>> | ID | Name |
>> +--------------------------------------+------+
>> | 7938704e-74e5-4034-b502-1a0a633ec695 | test |
>> +--------------------------------------+------+
>> stack at ubuntu:~/workspace/devstack/files/images$
>> stack at ubuntu:~/workspace/devstack/files/images$ glance image-show
>> 7938704e-74e5-4034-b502-1a0a633ec695
>> +------------------+--------------------------------------+
>> | Property | Value |
>> +------------------+--------------------------------------+
>> | checksum | d41d8cd98f00b204e9800998ecf8427e |
>> | container_format | bare |
>> | created_at | 2015-12-31T06:55:27Z |
>> | disk_format | qcow2 |
>> | id | 7938704e-74e5-4034-b502-1a0a633ec695 |
>> | min_disk | 0 |
>> | min_ram | 0 |
>> | name | test |
>> | owner | 549133f74d044c47a8efaf37708de53d |
>> | protected | False |
>> | size | 0 |
>> | status | active |
>> | tags | [] |
>> | updated_at | 2015-12-31T06:55:27Z |
>> | virtual_size | None |
>> | visibility | public |
>> +------------------+--------------------------------------+
>> stack at ubuntu:~/workspace/devstack/files/images$ glance --version
>> 1.2.0
>> stack at ubuntu:~/workspace/devstack/files/images$ uname -a
>> Linux ubuntu 3.19.0-33-generic #38~14.04.1-Ubuntu SMP Fri Nov 6 18:17:28
>> UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
>>
>> stack at ubuntu:~/workspace/devstack/files/images$ file
>> cirros-0.3.2-x86_64-disk.img
>> cirros-0.3.2-x86_64-disk.img: QEMU QCOW Image (v2), 41126400 bytes
>>
>> any hint how to resolve this ?
>>
>> regards
>> jeffrey
>> _______________________________________________
>> Mailing list:
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>> Post to : openstack at lists.openstack.org
>> Unsubscribe :
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>>
>
>
>
> --
> *Tzach Shefi*
> Quality Engineer, Redhat OSP
> +972-54-4701080 <callto:+972-52-4534729>
>
--
- jeffrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20160104/d9dca9a8/attachment.html>
More information about the Openstack
mailing list