[SRU] nova resize doesn't resize(extend) rbd disk files when using rbd disk backend

Bug #1369465 reported by Yaguang Tang
104
This bug affects 15 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Nicolas Simonds
Liberty
Fix Released
Medium
Tony Breeds
Ubuntu Cloud Archive
Fix Released
Medium
Unassigned
Liberty
Fix Released
Medium
Edward Hope-Morley
nova (Ubuntu)
Fix Released
Medium
Unassigned
Wily
Won't Fix
Medium
Edward Hope-Morley

Bug Description

[Impact]

  Instance resize does not work if the target host has a cached copy of
  the root disk. The resize will silently fail but be displayed as
  successful in Nova.

[Test Case]

  1 deploy nova-compute with RBDImageBackend enabled
  2 boot an instance from a QCOW2 image (to guarantee it gets downloaded for reformat prior to re-upload to ceph)
  3 nova resize using flavor with larger root disk
  4 wait for instance resize migration to complete
  5 verify root disk actually resized by checking /proc/partitions in vm
  6 do nova resize-confirm
  7 repeat steps 3-6

[Regression Potential]

 * None

== original description below ==

tested with nova trunk commit eb860c2f219b79e4f4c5984415ee433145197570

Configured Nova to use rbd disk backend

nova.conf

[libvirt]
images_type=rbd

instances booted successfully and instance disks are in rbd pools, when perform a nova resize to an existing instance, memory and CPU changed to be new flavors but instance disks size doesn't change

Sean Dague (sdague)
tags: added: ceph
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Ante Karamatić (ivoks)
tags: added: cts
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Jon Bernard (jbernard) wrote :

I believe the ceph job failure is different, in that case the original image is deleted and libvirt fails to open the disk as a result during the resize test. But this could be related, I'm not sure. I'll take this bug and see if I can come up with something.

Changed in nova:
assignee: nobody → Jon Bernard (jbernard)
Revision history for this message
Nick Jones (yankcrime) wrote :

Seeing the same issue here on Icehouse with the recommended patches [1] applied. There's no failure per se - the resize operation completes successfully and the new details are listed against the instance - but the underlying block device doesn't appear to be changed at all.

[1] https://github.com/angdraug/nova/tree/rbd-ephemeral-clone-stable-icehouse

Revision history for this message
Daniel Speichert (dasp) wrote :

I don't see this happen in Juno stable, upstream nova version.

Revision history for this message
Matt Jarvis (matt-jarvis) wrote :

What do you mean by upstream nova version ? We're running Juno and this still happens.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: Jon Bernard (jbernard) → Nicolas Simonds (nicolas.simonds)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Matt Riedemann (mriedem)
tags: added: vole
tags: added: volue
removed: vole
tags: added: volumes
removed: volue
Revision history for this message
Liang Chen (cbjchen) wrote : Re: nova resize doesn't resize(extend) rbd disk files when using rbd disk backend

Hi,

I just came across the same problem and took a look at the code. Below is some of my findings.

1. disk_info is not passed to finish_migration, thus no disk resize operation is even attempted.
At https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L6036, network type isn't considered a valid disk type and migrate_disk_and_power_off uses this code to load the disk info that will be eventually feeded to finish_migration to determine if a disk resize is required, https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L6401 .

2. resizing rbd backed disk is not supported

Even if disk_info is successfully passed to finish_migration, the _disk_resize function invoked at https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L6404 doesn't support rbd backed disk. All it does at the end is a qemu-img resize call - https://github.com/openstack/nova/blob/master/nova/virt/disk/api.py#L190.

Hope it helps.

Thank,
Liang

Revision history for this message
Nicolas Simonds (nicolas.simonds) wrote :

On point #1, the root cause is that the imagebackend code currently relies on the create_image() method to resize the image as well, and in the Ceph-backed case, it will gleefully do nothing (and claim victory) if the image already exists. Splitting the create and resize operations into two discrete methods takes care of that, and is handled in the patch set https://review.openstack.org/187857

On point #2, you are absolutely correct, there is no actual support on the backend for this, and it's amazing to me that it was released in this state. The support is added in patch set https://review.openstack.org/187395

Thanks,

Liang Chen (cbjchen)
tags: added: sts
tags: added: liberty-rc-potential
Changed in nova:
assignee: Nicolas Simonds (nicolas.simonds) → Dan Smith (danms)
Changed in nova:
assignee: Dan Smith (danms) → Nicolas Simonds (nicolas.simonds)
Revision history for this message
Michael Still (mikal) wrote :

Given this bug was present in Juno, is it really reasonable to block a Liberty release until this is fixed?

Revision history for this message
Matt Riedemann (mriedem) wrote :

Sounds like this isn't a regression, just a thing that's never worked properly, so yeah, removing the liberty-rc-potential tag.

tags: removed: liberty-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/228504

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/228505

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit c56bbc61f44529042ae9126a9a0b62affe0276d0
Author: Nicolas Simonds <email address hidden>
Date: Tue Jun 2 14:59:42 2015 -0700

    libvirt: Split out resize_image logic from create_image

    Rather than rely on the dubiously-named create_image() method to
    handle resizing existing images, let the imagebackend caching layer
    figure out if the resize needs to be done, and call resize_image()
    to do the work when appropriate.

    Partial-Bug: 1369465
    Change-Id: I28ba1970317f3d5691d05283796d4345ff38a804

Changed in nova:
milestone: none → liberty-rc2
milestone: liberty-rc2 → none
milestone: none → liberty-rc2
Changed in nova:
milestone: liberty-rc2 → none
tags: added: liberty-rc-potential
Revision history for this message
John Garbutt (johngarbutt) wrote : Re: nova resize doesn't resize(extend) rbd disk files when using rbd disk backend

removed from RC2, its too late to get this merged now, and I would rather have both patches, or neither merged.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/liberty)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/228505
Reason: Abandoning since the master change hasn't been approved, please restore and re-propose once that happens if you still need this for stable/liberty.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/228504
Reason: This is merged on master but is a dependency for another backport that is not merged on master, and to backport that change to stable/liberty it needs to be approved on master first. And when backporting the changes to stable/liberty, they should be squashed (IMO), or at least be approved together so we don't land something that is unnecessary without the other change.

Matt Riedemann (mriedem)
tags: removed: liberty-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 29476a67d4d4ff7eedd97f589422d47015111448
Author: Nicolas Simonds <email address hidden>
Date: Mon Jun 1 13:58:37 2015 -0700

    libvirt: Fix/implement revert-resize for RBD-backed images

    * Makes a snapshot of Ceph-backed roots prior to resize
    * Rolls back to snapshot on revert
    * Destroys resize snapshots on image cleanup

    Closes-Bug: 1369465
    Closes-Bug: 1314526
    Change-Id: I328d2c41696a9c0f090f822a51ea42fac83f62ec

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: nova resize doesn't resize(extend) rbd disk files when using rbd disk backend

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nova (Ubuntu):
status: New → Confirmed
Revision history for this message
Andy Jeffries (8-andy) wrote :

Any chance of a backport to Kilo for this fix?

tags: added: kilo-backport-potential liberty-backport-potential
Changed in nova:
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/liberty)

Reviewed: https://review.openstack.org/228505
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=eb1f67c4374fd8210829deac8e49d6f3df6cae4b
Submitter: Jenkins
Branch: stable/liberty

commit eb1f67c4374fd8210829deac8e49d6f3df6cae4b
Author: Nicolas Simonds <email address hidden>
Date: Mon Jun 1 13:58:37 2015 -0700

    libvirt: Fix/implement revert-resize for RBD-backed images

    * Makes a snapshot of Ceph-backed roots prior to resize
    * Rolls back to snapshot on revert
    * Destroys resize snapshots on image cleanup

    Conflicts:
        nova/tests/unit/virt/libvirt/test_driver.py

    because (I70215fb25ef25422786b96d33c91d8f1d4760a23) isn't on liberty

    (cherry picked from commit 29476a67d4d4ff7eedd97f589422d47015111448)

    Closes-Bug: 1369465
    Closes-Bug: 1314526
    Change-Id: I328d2c41696a9c0f090f822a51ea42fac83f62ec

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 13.0.0.0b3

This issue was fixed in the openstack/nova 13.0.0.0b3 development milestone.

Matt Riedemann (mriedem)
tags: added: in-stable-liberty
removed: kilo-backport-potential liberty-backport-potential
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 12.0.2

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/294599

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/kilo)

Change abandoned by Liang Chen (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/294599

Liang Chen (cbjchen)
Changed in nova (Ubuntu):
assignee: nobody → Liang Chen (cbjchen)
Liang Chen (cbjchen)
description: updated
tags: added: sts-sru
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "wily-liberty debian patch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
Changed in nova (Ubuntu):
importance: Undecided → Medium
Liang Chen (cbjchen)
Changed in nova (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Matt Jarvis (matt-jarvis) wrote :

This is still affecting us, any chance of a kilo backport ?

Revision history for this message
Liang Chen (cbjchen) wrote :

Matt,
I made debian patch for wily-liberty. But the patch depends on many other commits that kilo doesn't have, and I would be too risky to backport them all to kilo. So I am not going propose a kilo backport. Sorry for the inconvenience.

Thanks,
Liang

Changed in nova (Ubuntu):
assignee: Liang Chen (cbjchen) → Edward Hope-Morley (hopem)
status: In Progress → New
assignee: Edward Hope-Morley (hopem) → nobody
status: New → Fix Released
summary: - nova resize doesn't resize(extend) rbd disk files when using rbd disk
- backend
+ [SRU] nova resize doesn't resize(extend) rbd disk files when using rbd
+ disk backend
tags: removed: cts
Revision history for this message
Edward Hope-Morley (hopem) wrote :

This fix already exists in the released Ubuntu package of Liberty nova for both wily-updates and the Trusty/Liberty Ubuntu Cloud Archive so I am going to abandon the SRU.

summary: - [SRU] nova resize doesn't resize(extend) rbd disk files when using rbd
- disk backend
+ nova resize doesn't resize(extend) rbd disk files when using rbd disk
+ backend
tags: removed: sts-sru
Changed in cloud-archive:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/334074

Revision history for this message
Edward Hope-Morley (hopem) wrote : Re: nova resize doesn't resize(extend) rbd disk files when using rbd disk backend

For clarity, there are two patches associated with this bug. One of them was backported to stable/liberty but the other was not so I am going to re-add the backport-potential tag in reference to https://review.openstack.org/334074. Both of these patches are needed to get resizes working properly in Liberty.

tags: added: liberty-backport-potential
removed: in-stable-liberty
Changed in nova (Ubuntu Wily):
status: New → Triaged
Changed in cloud-archive:
importance: Undecided → Medium
Changed in nova (Ubuntu Wily):
importance: Undecided → Medium
Revision history for this message
Edward Hope-Morley (hopem) wrote :

Resubmitting sru as per above.

description: updated
summary: - nova resize doesn't resize(extend) rbd disk files when using rbd disk
- backend
+ [sru] nova resize doesn't resize(extend) rbd disk files when using rbd
+ disk backend
Changed in nova (Ubuntu Wily):
assignee: nobody → Edward Hope-Morley (hopem)
summary: - [sru] nova resize doesn't resize(extend) rbd disk files when using rbd
+ [SRU] nova resize doesn't resize(extend) rbd disk files when using rbd
disk backend
tags: added: sts-sru
Changed in nova (Ubuntu Wily):
status: Triaged → In Progress
Changed in nova (Ubuntu Wily):
status: In Progress → Won't Fix
Revision history for this message
Edward Hope-Morley (hopem) wrote :
Revision history for this message
Ryan Beisner (1chb1n) wrote : Please test proposed package

Hello Yaguang, or anyone else affected,

Accepted nova into liberty-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:liberty-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-liberty-needed to verification-liberty-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-liberty-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-liberty-needed
Revision history for this message
Edward Hope-Morley (hopem) wrote :

Ran test sequence on Trusty with proposed Liberty UCA and I no longer see the original problem.

tags: added: verification-liberty-done
removed: verification-liberty-needed
Revision history for this message
James Page (james-page) wrote : Update Released

The verification of the Stable Release Update for nova has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
James Page (james-page) wrote :

This bug was fixed in the package nova - 2:12.0.4-0ubuntu1~cloud1
---------------

 nova (2:12.0.4-0ubuntu1~cloud1) trusty-liberty; urgency=medium
 .
   * Backport fix for image resize bug (LP: #1369465)
     - d/p/libvirt-Split-out-resize_image-logic-from-create_ima.patch

Revision history for this message
Jorge Niedbalski (niedbalski) wrote :

The latest patch for Liberty d/p/libvirt-Split-out-resize_image-logic-from-create_ima.patch introduced this regression https://bugs.launchpad.net/nova/+bug/1608934

As a side note, Please note that this patch is not currently integrated in upstream/liberty.

Revision history for this message
Edward Hope-Morley (hopem) wrote :

Hi Jorge, I am unable to reproduce the issue described in bug 1608934. I have tried it with both Trusty Liberty and Trusty Mitaka (which has the same version as Xenial) i.e. boot a vm using a flavor that has a root and ephemeral disk, and the vm boots us just fine. For clarity I have tried with (default) qcow2 imagebackend as well as the raw and rbd imagebackends without any problems at all. Could you please describe the sequence that you have used to trigger your problem and provide some logs?

As a side note, the patch backported here already exists in Mitaka and beyond so if it really does introduce a regression then we should first check if there is a fix from upstream that we can backport to fix this issue and if not then we should propose it ourselves otherwise we are fixing one version but leaving the next broken.

Revision history for this message
Edmund Rhudy (erhudy) wrote :

Jorge is reporting it on my behalf; the error occurs for me with images_type=lvm. images_type=rbd is fine.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/liberty)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/334074
Reason: This doesn't look appropriate for stable/liberty at this point, and it's stale anyway so I'm going to abandon it.

Louis Bouchard (louis)
tags: removed: sts-sru
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.