[libvirt] disk.config.rescue is not used when rescuing an instance

Bug #1597669 reported by Lee Yarwood on 2016-06-30
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Lee Yarwood
Newton
Medium
Lee Yarwood

Bug Description

Description
===========

I931421ea688641e2ceb212c6dc099639c53433f2 introduced a callback to _create_configdrive from _create_domain that recreates the config disk of an instance during a rescue.

However neither the original or this recreated config disk are used by the instance during the resulting rescue.

Steps to reproduce
==================

$ nova boot --image cirros-0.3.4-x86_64-uec --flavor 1 test-config-rescue
[..]
$ nova rescue test-config-rescue
[..]
$ nova list
+--------------------------------------+--------------------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------------------+--------+------------+-------------+------------------+
| 5ef76bd4-4e4f-46dd-88f6-dcd212e54802 | test-config-rescue | RESCUE | - | Running | private=10.0.0.2 |
+--------------------------------------+--------------------+--------+------------+-------------+------------------+
$ ll ../data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/
total 28556
-rw-------. 1 qemu qemu 16939 Jun 30 04:39 console.log
-rw-r--r--. 1 qemu qemu 10682368 Jun 30 04:39 disk
-rw-rw-r--. 1 qemu qemu 432128 Jun 30 04:38 disk.config
-rw-rw-r--. 1 stack libvirtd 432128 Jun 30 04:39 disk.config.rescue
-rw-r--r--. 1 stack libvirtd 534 Jun 30 04:39 disk.info
-rw-r--r--. 1 qemu qemu 197120 Jun 30 04:39 disk.rescue
-rw-rw-r--. 1 qemu qemu 4979632 Jun 30 04:38 kernel
-rw-rw-r--. 1 qemu qemu 4979632 Jun 30 04:39 kernel.rescue
-rw-rw-r--. 1 stack libvirtd 3146 Jun 30 04:39 libvirt.xml
-rw-rw-r--. 1 qemu qemu 3740163 Jun 30 04:38 ramdisk
-rw-rw-r--. 1 qemu qemu 3740163 Jun 30 04:39 ramdisk.rescue
-rw-rw-r--. 1 stack libvirtd 4569 Jun 30 04:39 unrescue.xml
$ grep config ../data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/libvirt.xml
      <nova:name>test-config-rescue</nova:name>
$ sudo virsh domblklist 5ef76bd4-4e4f-46dd-88f6-dcd212e54802
Target Source
------------------------------------------------
vda /opt/stack/data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/disk.rescue
vdb /opt/stack/data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/disk

$ nova unrescue test-config-rescue
$ nova list
+--------------------------------------+--------------------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------------------+--------+------------+-------------+------------------+
| 5ef76bd4-4e4f-46dd-88f6-dcd212e54802 | test-config-rescue | ACTIVE | - | Running | private=10.0.0.2 |
+--------------------------------------+--------------------+--------+------------+-------------+------------------+
$ ll ../data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/
total 19604
-rw-------. 1 qemu qemu 20403 Jun 30 04:48 console.log
-rw-r--r--. 1 qemu qemu 10878976 Jun 30 04:47 disk
-rw-rw-r--. 1 qemu qemu 432128 Jun 30 04:38 disk.config
-rw-r--r--. 1 stack libvirtd 534 Jun 30 04:39 disk.info
-rw-rw-r--. 1 qemu qemu 4979632 Jun 30 04:38 kernel
-rw-rw-r--. 1 stack libvirtd 4569 Jun 30 04:47 libvirt.xml
-rw-rw-r--. 1 qemu qemu 3740163 Jun 30 04:38 ramdisk
$ grep config ../data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/libvirt.xml
      <nova:name>test-config-rescue</nova:name>
      <source file='/opt/stack/data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/disk.config'/>
$ sudo virsh domblklist 5ef76bd4-4e4f-46dd-88f6-dcd212e54802
Target Source
------------------------------------------------
vda /opt/stack/data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/disk
hdd /opt/stack/data/nova/instances/5ef76bd4-4e4f-46dd-88f6-dcd212e54802/disk.config

Expected result
===============
disk.config.rescue attached to the rescued instance.

Actual result
=============
No config disks are attached to the rescued instance. Only the rescue disk and original root disk are attached.

Environment
===========
1. Exact version of OpenStack you are running. See the following
   list for all releases: http://docs.openstack.org/releases/

   $ pwd
   /opt/stack/nova
   $ git rev-parse HEAD
   23153952a979c93a414705744b0f8ba4bde18f75

2. Which hypervisor did you use?
   libvirt + kvm

2. Which storage type did you use?
   (For example: Ceph, LVM, GPFS, ...)
   What's the version of that?
   N/A

3. Which networking type did you use?
   (For example: nova-network, Neutron with OpenVSwitch, ...)
   N/A

Logs & Configs
==============

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

Changed in nova:
assignee: nobody → Lee Yarwood (lyarwood)
status: New → In Progress
Matt Riedemann (mriedem) on 2016-06-30
Changed in nova:
importance: Undecided → High
tags: added: libvirt newton-rc-potential
Matthew Booth (mbooth-9) wrote :

I've updated the test change this relies on.

Reviewed: https://review.openstack.org/335966
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d9c1d8b2cb2350b2c66c1001071f4d460eda62e5
Submitter: Jenkins
Branch: master

commit d9c1d8b2cb2350b2c66c1001071f4d460eda62e5
Author: Matthew Booth <email address hidden>
Date: Thu Jun 30 12:31:44 2016 +0100

    libvirt: Rewrite test_rescue and test_rescue_config_drive

    This rewrite was primarily motivated by bug 1597669. We were testing
    that we were creating disks, but not that they were being added to the
    resulting domain.

    Related-bug: #1597669
    Change-Id: Ibe739b1811bdacad08a7fc499d26e4bed834eec9

Matt Riedemann (mriedem) wrote :

The wording on this bug really makes it sound like a regression in newton, which it's not, it's really just a latent bug and the callback change doesn't really have anything to do with it.

tags: added: newton-backport-potential
removed: newton-rc-potential

Reviewed: https://review.openstack.org/335884
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8795b206247fe2ca57f32c437d72c51492637649
Submitter: Jenkins
Branch: master

commit 8795b206247fe2ca57f32c437d72c51492637649
Author: Lee Yarwood <email address hidden>
Date: Thu Jun 30 10:22:28 2016 +0100

    libvirt: Use the recreated disk.config.rescue during a rescue

    I931421ea introduced a callback to _create_configdrive from
    _create_domain during a rescue that recreates the config disk of an
    instance with an additional .rescue suffix. However due to a latent bug
    neither the original or this recreated config disk are mapped to the
    instance during the resulting rescue.

    To correct this disk.config.rescue is now added to the disk_mapping for
    the instance if a config disk is required during a rescue.

    Closes-bug: #1597669
    Change-Id: I46cebd0612f50ff7373f677c4a002d444a877972

Changed in nova:
status: In Progress → Fix Released
Matt Riedemann (mriedem) on 2016-09-29
Changed in nova:
importance: High → Medium

This issue was fixed in the openstack/nova 15.0.0.0b1 development milestone.

Reviewed: https://review.openstack.org/379041
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=528430d78159a3ec6a6f3d76237c944b8384ed7c
Submitter: Jenkins
Branch: stable/newton

commit 528430d78159a3ec6a6f3d76237c944b8384ed7c
Author: Lee Yarwood <email address hidden>
Date: Thu Jun 30 10:22:28 2016 +0100

    libvirt: Use the recreated disk.config.rescue during a rescue

    I931421ea introduced a callback to _create_configdrive from
    _create_domain during a rescue that recreates the config disk of an
    instance with an additional .rescue suffix. However due to a latent bug
    neither the original or this recreated config disk are mapped to the
    instance during the resulting rescue.

    To correct this disk.config.rescue is now added to the disk_mapping for
    the instance if a config disk is required during a rescue.

    Closes-bug: #1597669
    Change-Id: I46cebd0612f50ff7373f677c4a002d444a877972
    (cherry picked from commit 8795b206247fe2ca57f32c437d72c51492637649)

This issue was fixed in the openstack/nova 14.0.3 release.

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

Other bug subscribers