fail to boot an instance because of "rbd import" qcow2 disk

Bug #1816686 reported by Boxiang Zhu on 2019-02-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Boxiang Zhu

Bug Description

Environment
===========
OpenStack: master branch
Ceph: luminous

Steps to reproduce
==================
1. Upload a qcow2 format image to glance such as a test qcow2 image `cirros`.
2. Use command to create a new instance: `openstack server create <server-name> --image <image-name> --flavor <flavor-name> --security-group <security-group-name> --availability-zone nova --network <network-name>`
3. After instance has been spawn successfully, we run command to get the console url: `openstack console url show <server-name>`
4. Open the browser and enter the console url, I see that the instance fails to boot.

Expected result
===============
The instance succeeds to boot.

Actual result
=============
The instance fails to boot.

When importing rbd volume from _base image file, the format of image file is qcow2. When using a qcow2 as root disk, the instance is spawned but fails to boot because data is accessed as raw.
So try to convent the image format when import it into rbd as raw.

Boxiang Zhu (bxzhu-5355) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/638080

Changed in nova:
assignee: nobody → Boxiang Zhu (bxzhu-5355)
status: New → In Progress
Boxiang Zhu (bxzhu-5355) wrote :

The force_raw_images in nova.conf was False so the issue can be reproduced.

Fix proposed to branch: master
Review: https://review.openstack.org/640271

Change abandoned by Boxiang Zhu (zhu.boxiang@99cloud.net) on branch: master
Review: https://review.openstack.org/638080
Reason: I just abandon this patch now. If there is something else to discuss, I will re-open it later. Thanks, @Eric.

Matt Riedemann (mriedem) on 2019-05-04
tags: added: libvirt rbd
tags: added: ceph
removed: rbd

Reviewed: https://review.opendev.org/640271
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6c6ffc0476b56fe0bf822ddcf3c9a2d543912f38
Submitter: Zuul
Branch: master

commit 6c6ffc0476b56fe0bf822ddcf3c9a2d543912f38
Author: zhu.boxiang <zhu.boxiang@99cloud.net>
Date: Fri Mar 1 16:16:31 2019 +0800

    Fix failure to boot instances with qcow2 format images

    Ceph doesn't support QCOW2 for hosting a virtual machine
    disk:

      http://docs.ceph.com/docs/master/rbd/rbd-openstack/

    When we set image_type as rbd and force_raw_images as
    False and we don't launch an instance with boot-from-volume,
    the instance is spawned using qcow2 as root disk but
    fails to boot because data is accessed as raw.

    To fix this, we raise an error and refuse to start
    nova-compute service when force_raw_images and
    image_type are incompatible.
    When we import image into rbd, check the format of cache
    images. If the format is not raw, remove it first and
    fetch it again. It will be raw format now.

    Change-Id: I1aa471e8df69fbb6f5d9aeb35651bd32c7123d78
    Closes-Bug: 1816686

Changed in nova:
status: In Progress → Fix Released

This issue was fixed in the openstack/nova 20.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments