settingsLogin | Registersettings

[Openstack] Can't create image w/ glance.

0 votes

stack@ubuntu:~/workspace/devstack/files/images$ glance image-create --name
test --disk-format qcow2 --container-format bare --visibility public
--progress <cirros-0.3.2-x8664-disk.img
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container
format | bare |
| createdat | 2015-12-31T06:55:27Z |
| disk
format | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| mindisk | 0 |
| min
ram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updatedat | 2015-12-31T06:55:27Z |
| virtual
size | None |
| visibility | public |
+------------------+--------------------------------------+
must be string or buffer, not generator
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-list
+--------------------------------------+------+
| ID | Name |
+--------------------------------------+------+
| 7938704e-74e5-4034-b502-1a0a633ec695 | test |
+--------------------------------------+------+
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-show
7938704e-74e5-4034-b502-1a0a633ec695
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| containerformat | bare |
| created
at | 2015-12-31T06:55:27Z |
| diskformat | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| min
disk | 0 |
| minram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | 0 |
| status | active |
| tags | [] |
| updated
at | 2015-12-31T06:55:27Z |
| virtualsize | None |
| visibility | public |
+------------------+--------------------------------------+
stack@ubuntu:~/workspace/devstack/files/images$ glance --version
1.2.0
stack@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 x8664 x8664 GNU/Linux

stack@ubuntu:~/workspace/devstack/files/images$ file
cirros-0.3.2-x8664-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@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
asked Dec 31, 2015 in openstack by xu_cai (160 points)  

3 Responses

0 votes

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@gmail.com]
Sent: Thursday, December 31, 2015 7:02 AM
To: openstack@lists.openstack.org
Subject: [Openstack] Can't create image w/ glance.

stack@ubuntu:~/workspace/devstack/files/images$ glance image-create --name test --disk-format qcow2 --container-format bare --visibility public --progress <cirros-0.3.2-x8664-disk.img
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container
format | bare |
| createdat | 2015-12-31T06:55:27Z |
| disk
format | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| mindisk | 0 |
| min
ram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updatedat | 2015-12-31T06:55:27Z |
| virtual
size | None |
| visibility | public |
+------------------+--------------------------------------+
must be string or buffer, not generator
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-list
+--------------------------------------+------+
| ID | Name |
+--------------------------------------+------+
| 7938704e-74e5-4034-b502-1a0a633ec695 | test |
+--------------------------------------+------+
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-show 7938704e-74e5-4034-b502-1a0a633ec695
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| containerformat | bare |
| created
at | 2015-12-31T06:55:27Z |
| diskformat | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| min
disk | 0 |
| minram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | 0 |
| status | active |
| tags | [] |
| updated
at | 2015-12-31T06:55:27Z |
| virtualsize | None |
| visibility | public |
+------------------+--------------------------------------+
stack@ubuntu:~/workspace/devstack/files/images$ glance --version
1.2.0
stack@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 x8664 x8664 GNU/Linux

stack@ubuntu:~/workspace/devstack/files/images$ file cirros-0.3.2-x8664-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@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
responded Dec 31, 2015 by Hinds,_Luke_(Nokia_- (380 points)  
0 votes

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@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@gmail.com]
Sent: Thursday, December 31, 2015 7:02 AM
To: openstack@lists.openstack.org
Subject: [Openstack] Can't create image w/ glance.

stack@ubuntu:~/workspace/devstack/files/images$ glance image-create
--name test --disk-format qcow2 --container-format bare --visibility public
--progress <cirros-0.3.2-x8664-disk.img
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container
format | bare |
| createdat | 2015-12-31T06:55:27Z |
| disk
format | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| mindisk | 0 |
| min
ram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updatedat | 2015-12-31T06:55:27Z |
| virtual
size | None |
| visibility | public |
+------------------+--------------------------------------+
must be string or buffer, not generator
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-list
+--------------------------------------+------+
| ID | Name |
+--------------------------------------+------+
| 7938704e-74e5-4034-b502-1a0a633ec695 | test |
+--------------------------------------+------+
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-show
7938704e-74e5-4034-b502-1a0a633ec695
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| containerformat | bare |
| created
at | 2015-12-31T06:55:27Z |
| diskformat | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| min
disk | 0 |
| minram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | 0 |
| status | active |
| tags | [] |
| updated
at | 2015-12-31T06:55:27Z |
| virtualsize | None |
| visibility | public |
+------------------+--------------------------------------+
stack@ubuntu:~/workspace/devstack/files/images$ glance --version
1.2.0
stack@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 x8664 x8664 GNU/Linux

stack@ubuntu:~/workspace/devstack/files/images$ file
cirros-0.3.2-x8664-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@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>


Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
responded Dec 31, 2015 by Tzach_Shefi (760 points)   1
0 votes

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@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@ubuntu:~/workspace/devstack/files/images$ cat /etc/lsb-release
DISTRIBID=Ubuntu
DISTRIB
RELEASE=14.04
DISTRIBCODENAME=trusty
DISTRIB
DESCRIPTION="Ubuntu 14.04.3 LTS"
stack@ubuntu:~/workspace/devstack/files/images$
stack@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": [], "containerformat":
"bare", "created
at": "2016-01-04T03:53:33Z", "size": null, "diskformat":
"qcow2", "updated
at": "2016-01-04T03:53:33Z", "visibility": "private",
"self": "/v2/images/206c29ce-3848-4684-8d10-8b9748064bfd", "mindisk": 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 |
| containerformat | bare |
| created
at | 2016-01-04T03:53:33Z |
| diskformat | qcow2 |
| id | 206c29ce-3848-4684-8d10-8b9748064bfd |
| min
disk | 0 |
| minram | 0 |
| name | test |
| owner | 5bf6c2c889c646babb4323ce3f3ea265 |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated
at | 2016-01-04T03:53:33Z |
| virtualsize | 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 doimagecreate
doimageupload(gc, args)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py",
line 311, in doimageupload
gc.images.upload(args.id, imagedata, 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@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@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@gmail.com]
Sent: Thursday, December 31, 2015 7:02 AM
To: openstack@lists.openstack.org
Subject: [Openstack] Can't create image w/ glance.

stack@ubuntu:~/workspace/devstack/files/images$ glance image-create
--name test --disk-format qcow2 --container-format bare --visibility public
--progress <cirros-0.3.2-x8664-disk.img
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container
format | bare |
| createdat | 2015-12-31T06:55:27Z |
| disk
format | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| mindisk | 0 |
| min
ram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updatedat | 2015-12-31T06:55:27Z |
| virtual
size | None |
| visibility | public |
+------------------+--------------------------------------+
must be string or buffer, not generator
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-list
+--------------------------------------+------+
| ID | Name |
+--------------------------------------+------+
| 7938704e-74e5-4034-b502-1a0a633ec695 | test |
+--------------------------------------+------+
stack@ubuntu:~/workspace/devstack/files/images$
stack@ubuntu:~/workspace/devstack/files/images$ glance image-show
7938704e-74e5-4034-b502-1a0a633ec695
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| containerformat | bare |
| created
at | 2015-12-31T06:55:27Z |
| diskformat | qcow2 |
| id | 7938704e-74e5-4034-b502-1a0a633ec695 |
| min
disk | 0 |
| minram | 0 |
| name | test |
| owner | 549133f74d044c47a8efaf37708de53d |
| protected | False |
| size | 0 |
| status | active |
| tags | [] |
| updated
at | 2015-12-31T06:55:27Z |
| virtualsize | None |
| visibility | public |
+------------------+--------------------------------------+
stack@ubuntu:~/workspace/devstack/files/images$ glance --version
1.2.0
stack@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 x8664 x8664 GNU/Linux

stack@ubuntu:~/workspace/devstack/files/images$ file
cirros-0.3.2-x8664-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@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


Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
responded Jan 4, 2016 by xu_cai (160 points)  
...