Bug 1917599 - [RFE] integrate snapshot quiesce hooks for rbd-nbd
Summary: [RFE] integrate snapshot quiesce hooks for rbd-nbd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RBD
Version: 5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 5.0
Assignee: Ilya Dryomov
QA Contact: Gopi
Ranjini M N
URL:
Whiteboard:
Depends On:
Blocks: 1959686
TreeView+ depends on / blocked
 
Reported: 2021-01-18 21:23 UTC by Jason Dillaman
Modified: 2021-08-30 08:28 UTC (History)
5 users (show)

Fixed In Version: ceph-16.1.0-486.el8cp
Doc Type: Technology Preview
Doc Text:
.Snapshot quiesce hook support for `rbd-nbd` devices With this release, librbd API now offers quiesce and unquiesce hooks that enable coordinated snapshot creation. The `rbd-nbd` daemon optionally freezes and thaws the file system mounted on top of the mapped device to create file system consistent snapshots. This behavior can be customized by editing the `rbd-nbd_quiesce` shell script or by replacing it with a custom executable.
Clone Of:
Environment:
Last Closed: 2021-08-30 08:27:52 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCEPH-1212 0 None None None 2021-08-30 00:17:01 UTC
Red Hat Product Errata RHBA-2021:3294 0 None None None 2021-08-30 08:28:07 UTC

Description Jason Dillaman 2021-01-18 21:23:06 UTC
Description of problem:
The librbd API has been extended to provide callback hooks to alert librbd clients that a snapshot creation is in-progress. librbd clients can register for the hook in order to quiesce / freeze the block device and/or file system prior to the snapshot being created.

The first librbd client to utilize this new hook is the "rbd-nbd" daemon which will invoke "fsfreeze" to freeze and thaw mounted file systems on NBD-backed RBD images.

Version-Release number of selected component (if applicable):
5.0

Comment 1 RHEL Program Management 2021-01-18 21:23:11 UTC
Please specify the severity of this bug. Severity is defined here:
https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity.

Comment 2 Ken Dreyer (Red Hat) 2021-01-22 17:30:08 UTC
Jason, is this all complete in pacific upstream now? Any information for QE to verify this feature?

Comment 3 Jason Dillaman 2021-02-09 18:13:40 UTC
It's been merged and documented upstream for a while now.

Comment 4 Ken Dreyer (Red Hat) 2021-03-03 00:40:28 UTC
I'm setting Fixed In Version to the current RH Ceph Storage 5 build.

Comment 11 Gopi 2021-08-09 15:33:35 UTC
Working as expected. Hence moving this bug to verified state.

[root@magna081 ~]# rbd device --device-type nbd map --quiesce --quiesce-hook /home/gpatta/hook/rbd-nbd_quiesce rbd-nbd_pool/rbd-nbd-image
/dev/nbd0
[root@magna081 ~]# rbd-nbd list-mapped
id       pool          namespace  image          snap  device   
1147676  rbd-nbd_pool             rbd-nbd-image  -     /dev/nbd0
[root@magna081 ~]#
[root@magna081 ~]# rbd snap create rbd-nbd_pool/rbd-nbd-image@quiesce1
Creating snap: 100% complete...done.

After inject some error to script:
[root@magna081 ~]# cat /home/gpatta/hook/rbd-nbd_quiesce
#!/bin/sh

echo "$0 $@" >&2

if [ $# -lt 2 ]; then
    echo "usage: $0 <dev> <cmd>" >&2
    exit 1
fi
exit 123
dev=$1
cmd=$2

export PATH=/usr/sbin:/usr/bin:/sbin:/bin

findmnt -S "${dev}" -fno TARGET |
while read mnt; do
    case "${cmd}" in
        quiesce)
            echo "freezing ${mnt}" >&2
            fsfreeze -f "${mnt}"
            ;;
        unquiesce)
            echo "unfreezing ${mnt}" >&2
            fsfreeze -u "${mnt}"
            ;;
        *)
            echo "unknown command ${cmd}" >&2
            exit 1
            ;;
    esac
done

[root@magna081 ~]# rbd snap create rbd-nbd_pool/rbd-nbd-image@quiesce1
Creating snap: 10% complete...2021-08-09T15:24:14.831+0000 7fb8d5172700 -1 librbd::ImageWatcher: 0x7fb8b80079e0 failed to notify quiesce: (123) No medium found
2021-08-09T15:24:14.831+0000 7fb8d5172700 -1 librbd::SnapshotCreateRequest: failed to notify quiesce: (123) No medium found
Creating snap: 10% complete...failed.
rbd: failed to create snapshot: (123) No medium found

Comment 13 errata-xmlrpc 2021-08-30 08:27:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 5.0 bug fix and enhancement), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:3294


Note You need to log in before you can comment on or make changes to this bug.