ceph / go-ceph

Go bindings for Ceph :octopus: :octopus: :octopus:
MIT License
610 stars 251 forks source link

Ceph RBD rollback image #1014

Open BadKid90s opened 1 month ago

BadKid90s commented 1 month ago

How to determine if Ceph RBD rollback image is successful?  How to determine if the rollback is successful using the command line or HTTP API?

phlogistonjohn commented 1 month ago

Are you asking if how to tell if the function https://github.com/ceph/go-ceph/blob/d564eff5238666e05b7ed8e3442c3d4e136b860b/rbd/snapshot.go#L88 succeeded?

On an API level you should be checking the error is not nil. If you mean on some sort of higher level, you'd probably have to build something like a function that checksums an image before snapshotting and then verifies it after rollback. If you asking for something even more than that I suggest talking to the Ceph team directly because go-ceph is focused on making the Ceph APIs available, not making sure they work.

I don't really know what command line or HTTP you might be referring to. Again, if you're looking for general Ceph help you may want to try the ceph lists: https://lists.ceph.io/hyperkitty/list/ceph-users@ceph.io/

BadKid90s commented 1 month ago

Perform a checksum on the image before the snapshot, and then validate it after the rollback. How should it be operated? How to calculate the comparative checksum?

phlogistonjohn commented 1 month ago

If I was going to implement that I would use the image read apis to copy the bytes into one of Go's hash algorithms like sha256.

Just as a reminder go-ceph provides the Ceph apis as a golang library, what you do with those apis is up to you. So take my suggestion above with a grain of salt, because I really don't know what your ultimate goal is. :-)

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contribution.