Backup snapshot does not work without creating a temp volume

Bug #1575886 reported by Xing Yang
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Xing Yang

Bug Description

Attach snapshot will not work if backup service is running on a different node that the volume service is running.

Xing Yang (xing-yang)
Changed in cinder:
assignee: nobody → Xing Yang (xing-yang)
milestone: none → newton-1
importance: Undecided → High
status: New → In Progress
Xing Yang (xing-yang)
tags: added: backup-service
Revision history for this message
Xing Yang (xing-yang) wrote :

Actually backup snapshot without creating a temp volume is broken even on the local backup node.

Revision history for this message
Scott DAngelo (scott-dangelo) wrote :

Xing, does this mean that backup of snapshot is always broken? If so, can we change the subject of this bug to reflect this, i.e.
"Attach snapshot does not work without creating a temp volume"
?

Revision history for this message
Xing Yang (xing-yang) wrote :

Scott,

Good suggestion. I'll change the subject. Thanks.

summary: - Attach snapshot does not work on remote backup node
+ Backup snapshot does not work without creating a temp volume
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
milestone: newton-1 → newton-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/321943
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=763dd8cdc5c48b7771d081dcd8b9e37a8f6c0a71
Submitter: Jenkins
Branch: master

commit 763dd8cdc5c48b7771d081dcd8b9e37a8f6c0a71
Author: xing-yang <email address hidden>
Date: Sun May 15 08:08:21 2016 -0400

    Fix backup using temp snapshot code path

    - Non-disruptive backup using a temp snapshot works in Liberty
    but was broken in Mitaka.
    - Backup a snapshot directly without creating a temp volume
    worked when the feature was first added in Mitaka but was broken
    later in Mitaka.

    This patch provides a fix as follows:
    1. It checks an existing config option backup_use_same_host.
       By default, this option is False.
    2. When the backup service starts, it checks the above option. If
       the option is True, the backup service will find volume manager
       on the current node and get volume backends.
    3. If the option is True and backup_use_temp_snapshot returns True,
       volume service returns the snapshot to the backup service in
       get_backup_device and backup will be performed using the snapshot.
       Otherwise, the volume will be returned as the backup device and
       the backup will be performed using the volume.

    This fix is a Mitaka backport candidate. After this is merged,
    we will provide a more complete fix which allows backup using
    temp snapshot to happen on a remote node as well and we will
    also clean up the code to get volume backends on the backup node.

    The unit test test_backup_volume_inuse_temp_snapshot in test_volume.py
    is removed. This test was testing backup_volume in
    cinder/volume/driver.py, but this code path is not used any more.
    Backup now starts in create_backup in backup/manager.py which calls
    _run_backup which calls _attach_snapshot in volume/driver.py. The new
    test test_create_backup_with_temp_snapshot in test_backup.py tests
    the new code path.

    Change-Id: I2e0c115e1dacf9eea73803cdbb1452bfeb56d87c
    Closes-Bug: #1578034
    Closes-Bug: #1575886

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/328063

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 9.0.0.0b2

This issue was fixed in the openstack/cinder 9.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/mitaka)

Reviewed: https://review.openstack.org/328063
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=cf5fab9e215d738a84456dbc5c349c507bc9d3fc
Submitter: Jenkins
Branch: stable/mitaka

commit cf5fab9e215d738a84456dbc5c349c507bc9d3fc
Author: xing-yang <email address hidden>
Date: Sun May 15 08:08:21 2016 -0400

    Fix backup using temp snapshot code path

    - Non-disruptive backup using a temp snapshot works in Liberty
    but was broken in Mitaka.
    - Backup a snapshot directly without creating a temp volume
    worked when the feature was first added in Mitaka but was broken
    later in Mitaka.

    This patch provides a fix as follows:
    1. It checks an existing config option backup_use_same_host.
       By default, this option is False.
    2. When the backup service starts, it checks the above option. If
       the option is True, the backup service will find volume manager
       on the current node and get volume backends.
    3. If the option is True and backup_use_temp_snapshot returns True,
       volume service returns the snapshot to the backup service in
       get_backup_device and backup will be performed using the snapshot.
       Otherwise, the volume will be returned as the backup device and
       the backup will be performed using the volume.

    This fix is a Mitaka backport candidate. After this is merged,
    we will provide a more complete fix which allows backup using
    temp snapshot to happen on a remote node as well and we will
    also clean up the code to get volume backends on the backup node.

    The unit test test_backup_volume_inuse_temp_snapshot in test_volume.py
    is removed. This test was testing backup_volume in
    cinder/volume/driver.py, but this code path is not used any more.
    Backup now starts in create_backup in backup/manager.py which calls
    _run_backup which calls _attach_snapshot in volume/driver.py. The new
    test test_create_backup_with_temp_snapshot in test_backup.py tests
    the new code path.

    Note: The return value is changed for _attach_snapshot() in
    volume/driver.py. It now returns a dictionary of attach_info.

    Closes-Bug: #1578034
    Closes-Bug: #1575886
    (cherry picked from commit 763dd8cdc5c48b7771d081dcd8b9e37a8f6c0a71)

    Conflicts:
     cinder/backup/manager.py
     cinder/tests/unit/test_volume.py

    Change-Id: I2e0c115e1dacf9eea73803cdbb1452bfeb56d87c

tags: added: in-stable-mitaka
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 8.1.0

This issue was fixed in the openstack/cinder 8.1.0 release.

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

Other bug subscribers

Remote bug watches

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