Commit Graph

15 Commits

Author SHA1 Message Date
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
Sven Anderson c45fa95b32 rados: remove pointer arithmetic on C-buffers
This change uses slices on top of C allocated array memory in order
to have a simple (no pointer arithmetic) and safe (boundary-checked)
access to its elements.

Signed-off-by: Sven Anderson <sven@redhat.com>
2021-05-03 16:20:34 +00:00
John Mulligan f84140356a rbd: add CreateMirrorSnapshot implementing rbd_mirror_image_create_snapshot
This function is used to "manually" trigger a snapshot for snapshot
based mirroring. It is needed as a pre-req to test actual cross-cluster
mirroring and the full functionality of GetGlobalMirrorStatus.

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 b614e93b9d rbd: add String method for MirrorImageState
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-03-19 11:23:37 +00:00
John Mulligan 741e7d43bd rbd: add String method for ImageMirrorMode
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-03-19 11:23:37 +00:00
John Mulligan 406868763c rbd: add String method for MirrorMode
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 25a5086184 rbd: fix typo in comment & improve comment consistency
RBD was misspelled as RDB. While I was there I made the comments
for both constants more consistently worded.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-25 14:38:39 +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