Ask Your Question
0

Snapshot failing in a fresh Kilo install

asked 2015-05-24 17:54:09 -0500

rarylson gravatar image

updated 2015-06-09 11:27:15 -0500

I have a fresh OpenStack Kilo installation.

When I try to create a snapshot from the dashboard or from the nova cli, the snapshot isn't being created.

The local snapshot ends with success, but nova get's a "HTTP 400: Invalid disk format 'None' for image" error when trying to upload the image to glance.

The full log follows at the end.

The question is: Why is this error occurring? And how can I solve it?

Update: After some tests, I discovered that Nova uses the Glance API v1 to upload the image. The request done by nova is right and both container_format and bare_format is sent. The request is also complaint with the http://docs.openstack.org/developer/glance/glanceapi.html#using-v1-x (Glance v1 API specification). However, something is going wrong, as we can see at the following curl command to the Glance API:

curl -i -X PUT -H 'X-Auth-Token: MY_TOKEN_HERE' \
    -H 'x-image-meta-property-image_state: available' \
    -H 'x-image-meta-name: rarytest2-snapshot' -H 'x-image-meta-container_format: bare' \
    -H 'User-Agent: python-glanceclient' -H 'X-User-Id: e45cf65e7ae94cd5aa86341c87308657' \
    -H 'x-image-meta-property-image_location: snapshot' -H 'Accept-Encoding: gzip, deflate' \
    -H 'x-glance-registry-purge-props: false' -H 'x-image-meta-property-ramdisk_id: ' \
    -H 'Connection: keep-alive' -H 'x-image-meta-property-kernel_id: ' \
    -H 'X-Service-Catalog: []' \
    -H 'x-image-meta-property-owner_id: 2dd6aa6ee0554c0ea5afce27dc63ff3a' \
    -H 'Accept: */*' -H 'X-Roles: _member_,admin' -H 'x-image-meta-size: 1549991936' \
    -H 'X-Tenant-Id: 2dd6aa6ee0554c0ea5afce27dc63ff3a' -H 'x-image-meta-is_public: False' \
    -H 'X-Identity-Status: Confirmed' -H 'Content-Type: application/octet-stream' \
    -H 'x-image-meta-disk_format: qcow2' \
    http://MY_IP_HERE:9292/v1/images/3b3cdac1-d76c-48f2-8150-0977d8720684

The expected behavior is update disk_format to qcow2 and container_format to bare. However, it doesn't occur.

For some strange reason, if a change the x-image-meta-disk_format and x-image-meta-container_format headers for x-image-meta-disk-format and x-image-meta-container-format (it is, changing underscore by hyphens) it works!

Full log:

2015-05-24 17:50:46.229 2400 INFO nova.compute.manager [req-b6489814-f538-4773-a15d-c1224b5583b7 e45cf65e7ae94cd5aa86341c87308657 2dd6aa6ee0554c0ea5afce27dc63ff3a - - -] [instance: 00652f00-5a32-44ad-8ad6-ac33610236ac] instance snapshotting
[...]
2015-05-24 17:50:58.670 2400 INFO nova.virt.libvirt.driver [req-b6489814-f538-4773-a15d-c1224b5583b7 e45cf65e7ae94cd5aa86341c87308657 2dd6aa6ee0554c0ea5afce27dc63ff3a - - -] [instance: 00652f00-5a32-44ad-8ad6-ac33610236ac] Snapshot extracted, beginning image upload
[...]
2015-05-24 17:51:01.251 2400 ERROR oslo_messaging.rpc.dispatcher [req-b6489814-f538-4773-a15d-c1224b5583b7 e45cf65e7ae94cd5aa86341c87308657 2dd6aa6ee0554c0ea5afce27dc63ff3a - - -] Exception during message handling: <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Invalid disk format 'None' for image.<br /><br />

 </body>
</html> (HTTP 400)
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher     executor_callback))
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher     executor_callback)
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher     result = func(ctxt, **new_args)
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 6791, in snapshot_instance
2015-05-24 17:51:01.251 2400 TRACE oslo_messaging ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-06-09 11:02:43 -0500

rarylson gravatar image

updated 2015-06-09 11:03:58 -0500

Hi,

I discovered that the problem was the combination of using both Nginx and Glance API v1.

In short, the explanation is fount http://stackoverflow.com/questions/22856136/why-underscores-are-forbidden-in-http-header-names (at this thread in Stack Overflow).

Nginx, by default, drops headers with underscores. This is done to:

prevent ambiguities when mapping headers to CGI variables

Reference: http://wiki.nginx.org/Pitfalls#Missing_.28disappearing.29_HTTP_headers (Nginx - Pitfalls - Missing (disappearing) HTTP headers).

However, headers with underscore are specified in the Glance v1 API.

Reference: http://docs.openstack.org/developer/glance/glanceapi.html#retrieve-image-metadata (Glance v1 API - Retrieve image metadata).

I also discovered that headers with underscores http://tools.ietf.org/html/rfc7230#section-3.2 (are completely valid and complaint with the RFC 7230).

The solution add the following line to the nginx config file:

underscores_in_headers on;
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-05-24 17:53:04 -0500

Seen: 316 times

Last updated: Jun 09 '15