XenAPI: failed to create image from volume backed instance with glance v2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Matt Riedemann | ||
Newton |
Fix Committed
|
High
|
Matt Riedemann |
Bug Description
XenServer with dirver XenAPI, it always fails to create image from volume.
Tempest test: tempest.
2016-08-24 08:13:24.636 27347 DEBUG nova.compute.api [req-fd7afac4-
2016-08-24 08:13:25.964 27347 INFO os_vif [req-fd7afac4-
2016-08-24 08:13:25.965 27347 INFO os_vif [req-fd7afac4-
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
2016-08-24 08:13:26.049 27347 ERROR nova.api.
Per my analysis, it should be bug due to it hardcode the disk format as qcow2.
See: https:/
At here, it cleans the disk_format and container_format
Then:
https:/
It will hardcode the disk_format as qcow2 which is not supported by XenAPI.
nova/nova/
def _create_v2(self, context, sent_service_
# Glance v1 allows image activation without setting disk and
# container formats, v2 doesn't. It leads to the dirtiest workaround
# where we have to hardcode this parameters.
if force_activate:
data = ''
if 'disk_format' not in sent_service_
if 'container_format' not in sent_service_
tags: | added: xenserver |
tags: | added: os-vif |
summary: |
- XenAPI: failed to create image from volume + XenAPI: failed to create image from volume backed instance |
Changed in nova: | |
assignee: | nobody → Matt Riedemann (mriedem) |
status: | Confirmed → In Progress |
no longer affects: | glance |
Changed in nova: | |
status: | Fix Released → Confirmed |
Changed in nova: | |
status: | Confirmed → Fix Released |
When create image from instance which is not volume backed, it depends on hypervisor's driver to correct the disk_format (and container_format) at uploading data to image. so there is no problem; /github. com/openstack/ nova/blob/ master/ nova/compute/ api.py# L2545
But for volume backed instance, creating image will take a volume snapshot in volume back-end. In this case, the image is simply a bucket of properties without any image data.
https:/
There is no image data to be uploaded, so there is no chance for hypervisor to correct disk_format. If the hypervisor driver(e.g. XenAPI) doesn't support the default hardcoded disk_format - qcow2, it will cause failures at image creating and booting instance from that image.
On the other side, as the real data is in the volume snapshot. There is no need to process data basing on the image's format. So I think a reasonable solution is to use a common disk_format supported by all hypervisors - e.g. 'raw'.