Commit Graph

17 Commits

Author SHA1 Message Date
Sanford Miller 15d71fe192 rbd: add mirroring support for nautilus
The librbd API for mirroring-related operations changed substantially between
Nautilus and Octopus. Due to this, go-ceph had previously only implemented
mirroring functionality if built against Octopus client libraries. This patch
implements equivalent functionality for use with Nautilus clients.

Signed-off-by: Sanford Miller <smiller@digitalocean.com>
2022-07-13 13:00:48 +00:00
Sven Anderson 87f4563118 format: run gofmt on all files
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 18:58:35 +00:00
Rakshith R a32355cba2 rbd: implement binding for rbd_mirror_image_instance_id_list
This commit adds MirrorImageInstanceIDList and
MirrorImageInstanceIDIter with necessary helper functions
and tests.

Fixes: #483

Signed-off-by: Rakshith R <rar@redhat.com>
2021-08-23 06:39:51 +00:00
Sven Anderson 3de317e39d rbd: export mirror image list functions
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-10 14:15:01 +00:00
Sven Anderson b968165e78 rbd: add tests for MirrorImageInfoList
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-02 16:39:39 +00:00
Sven Anderson ac895ae097 rbd: implement binding for rbd_mirror_image_info_list
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-02 16:39:39 +00:00
RAJAT SINGH 5c49aab11e rbd: add GetMirrorUUID function
* Add GetMirrorUUID implementing rbd_mirror_uuid_get

This function is be used to get the mirroring uuid for the pool.
Basic tests included.

Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
2021-06-08 14:01:09 +00:00
John Mulligan 24eeb9512c rbd: add a MirrorImageGlobalStatusIter implementing rbd_mirror_image_global_status_list
This adds the function call in the style of an iterator, as the number
of mirrored images in the entire pool could be large. Tests are
included.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-08 12:20:53 +00:00
John Mulligan 2be2128e33 rbd: add CreateMirrorPeerBootstrapToken & ImportMirrorPeerBootstrapToken functions
* Add CreateMirrorPeerBootstrapToken implementing rbd_mirror_peer_bootstrap_create
* Add ImportMirrorPeerBootstrapToken implementing rbd_mirror_peer_bootstrap_import

These functions can be used to set up mirroring between pools. Basic tests
included. The tests only verify that functions work, not that they
actually mirror data. That is a job for another day.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-03 14:42:42 +00:00
John Mulligan 97eefba287 rbd: add SetMirrorSiteName and GetMirrorSiteName functions
* Add SetMirrorSiteName implementing rbd_mirror_site_name_set
* Add GetMirrorSiteName implementing rbd_mirror_site_name_get

These functions are used to set the name of the site (for an entire
cluster) for rbd mirroring purposes. It's a bit strange that it's
part of rdb and not rados, but such is life.

Tests included.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-01 09:56:02 +00:00
John Mulligan d37951f7cd rbd: add MirrorImageStatusSummary implementing rbd_mirror_image_status_summary
The MirrorImageStatusSummary returns a map of image mirroring states to
the number of images in those states or an error.
Tests of both the basic conditions and actual mirrored images are added.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-05-03 16:55:10 +00:00
John Mulligan 40e1224871 rbd: add tests for GetGlobalMirrorStatus based on two ceph clusters
With the infrastructure for running two ceph clusters now available,
we add tests to ensure the functionality of GetGlobalMirrorStatus in
the more typical case, when one or more mirroring clusters exist,

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-04-13 09:47:43 +00:00
John Mulligan 5c537e20ad rbd: add GetGlobalMirrorStatus implementing rbd_mirror_image_get_global_status
This function is added, along with required return types and some helper
functions, to support fetching the global mirroring status component
that makes up a major part of `rbd mirror image status` command's
output.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-04-13 09:47:43 +00:00
John Mulligan 51885f0875 rbd: add test case for Stringer supporting mirroring constants
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-03-19 11:23:37 +00:00
Mudit Agarwal 3032c539a0 rbd: add GetImageMirrorMode() to get the mirroing mode of a RBD image
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2021-01-25 20:35:15 +00:00
Mudit Agarwal 6ff40f828f rbd: add function to fetch mirror status of a RBD image.
Add GetMirrorImageInfo() to fetch the mirror status of a RBD image.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2021-01-25 20:35:15 +00:00
John Mulligan 1e3b9a2cd9 rbd: add an initial set of basic mirroring functions
Add functions:
* SetMirrorMode implementing rbd_mirror_mode_set
* GetMirrorMode implementing rbd_mirror_mode_get
* MirrorEnable implementing rbd_mirror_image_enable2
* MirrorDisable implementing rbd_mirror_image_disable
* MirrorPromote implementing rbd_mirror_image_promote
* MirrorDemote implementing rbd_mirror_image_demote
* MirrorResync implementing rbd_mirror_image_resync
* MirrorInstanceId implementing rbd_mirror_image_get_instance_id

For now, these mirroring related functions are only supported on octopus
builds. Right now the demand is for snapshot based mirroring, which is
new in octopus. We can always relax this in the future and add the
necessary support for nautilus, for journaling only based mirroring.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-22 09:27:06 -05:00