Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add guide doc for flex migration #9222

Merged
merged 2 commits into from Dec 2, 2021

Conversation

subhamkrai
Copy link
Contributor

@subhamkrai subhamkrai commented Nov 22, 2021

Description of your changes:
Adding guide doc for migrating rbd flexvolume to ceph-csi.

Which issue is resolved by this Pull Request:
Resolves #

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@subhamkrai
Copy link
Contributor Author

this is at top of #9221

@subhamkrai subhamkrai changed the title doc: add guide doc for flex migration docs: add guide doc for flex migration Nov 22, 2021
@subhamkrai subhamkrai force-pushed the add-flex-doc branch 2 times, most recently from 2b4da81 to e6c3a7d Compare November 22, 2021 12:58
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flexMigration/flex-to-csi-migration.md Outdated Show resolved Hide resolved
@subhamkrai subhamkrai force-pushed the add-flex-doc branch 3 times, most recently from c63a260 to b8292dc Compare November 23, 2021 08:15
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
4. Create the CSI storage class to which you want to migrate
5. Create migrator pod
1) `kubectl create -f <update this with file link in the tool repo>`
6. Download the tool binary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about an approach to build an image that includes the binary, and no need for this manual step to get it... In the 1.7 branch, we add an image to the build that is just like the rook ceph image, but it also includes the tool binary. Then the sample migrator.yaml would just pull that image. The image on dockerhub would appear as rook/flex-migration:v1.7.9, where the tag would be the latest 1.7.x release. Rooks existing release process should make this fairly simple to implement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that approach it makes sense to include the migrator.yaml in the rook repo as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest discussion is that we can just add the tool to the main rook image in the 1.7 releases. No need to create a new image.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need migrator.yaml file in rook?

Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Show resolved Hide resolved
@subhamkrai subhamkrai force-pushed the add-flex-doc branch 2 times, most recently from a23c524 to 6022b0c Compare November 25, 2021 11:36
Documentation/flex-to-csi-migration.md Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Show resolved Hide resolved

## Migration Tool Options

These are the options for converting a single PVC. **For more options**, see the [tool documentation](https://github.com/ceph/persistent-volume-migrator), for example to convert all PVCs automatically that belong to the same storage class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These are the options for converting a single PVC. **For more options**, see the [tool documentation](https://github.com/ceph/persistent-volume-migrator), for example to convert all PVCs automatically that belong to the same storage class.
These are the options for converting a single PVC. For more options, see the [tool documentation](https://github.com/ceph/persistent-volume-migrator), for example to convert all PVCs automatically that belong to the same storage class.

Why was this bold?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thought was to get more eyes but yeah we can remove them too.

Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Show resolved Hide resolved
@subhamkrai subhamkrai force-pushed the add-flex-doc branch 2 times, most recently from 2ce58ae to 7aaaed3 Compare November 29, 2021 06:55
@subhamkrai subhamkrai marked this pull request as ready for review November 29, 2021 11:21
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
@mergify
Copy link

mergify bot commented Nov 30, 2021

This pull request has merge conflicts that must be resolved before it can be merged. @subhamkrai please rebase it. https://rook.io/docs/rook/latest/development-flow.html#updating-your-fork

@subhamkrai subhamkrai changed the base branch from master to release-1.7 November 30, 2021 03:11
@mergify
Copy link

mergify bot commented Nov 30, 2021

This pull request has merge conflicts that must be resolved before it can be merged. @subhamkrai please rebase it. https://rook.io/docs/rook/latest/development-flow.html#updating-your-fork

@mergify
Copy link

mergify bot commented Nov 30, 2021

Hi @subhamkrai, this pull request was opened against a release branch, is it expected? Normally patches should go in the master branch first and then be backported to release branches.

@subhamkrai
Copy link
Contributor Author

I tried to move this PR from master to release-1.7 branch...messed in between but looks good now 😄

@subhamkrai
Copy link
Contributor Author

Hi @subhamkrai, this pull request was opened against a release branch, is it expected? Normally patches should go in the master branch first and then be backported to release branches.

Yes, this is intentional.

Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test of the conversion worked! just a few small suggestions in the doc...

My test consisted of creating flex volumes for mysql and wordpress example app pods, then converting them with these commands:

kubectl scale --replicas=0 deploy/wordpress-mysql
kubectl scale --replicas=0 deploy/wordpress
# connect to the migrator pod
pv-migrator --pvc=mysql-pv-claim --pvc-ns=default --destination-sc=rook-ceph-block-csi 
pv-migrator --pvc=wp-pv-claim --pvc-ns=default --destination-sc=rook-ceph-block-csi 
# disconnect from the migrator pod
kubectl scale --replicas=1 deploy/wordpress-mysql
kubectl scale --replicas=1 deploy/wordpress

Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
I1125 07:56:26.504578 63 log.go:34] waiting for PV pvc-30a01887-8821-4baf-835c-16a7e55ba7f0 in state &PersistentVolumeStatus{Phase:Bound,Message:,Reason:,} to be deleted (0 seconds elapsed)
I1125 07:56:26.702921 63 log.go:34] deleted persistent volume pvc-30a01887-8821-4baf-835c-16a7e55ba7f0
I1125 07:56:26.702944 63 log.go:34] successfully migrated pvc rbd-pvc
I1125 07:56:26.703335 63 log.go:34] Successfully migrated all the PVCs to CSI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only one PVC is being migrated, the tool should skip printing this line, it was confusing.

Suggested change
I1125 07:56:26.703335 63 log.go:34] Successfully migrated all the PVCs to CSI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this I'll need to change in tool side first. will open PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to log something after successful migration. How about this

  1. Successfully migrated flex PVCs to CSI
  2. Migration done successfully

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message for individual PVC names seems sufficient. Or instead of saying "all" PVCs, how about printing the number of PVCs converted?

Documentation/flex-to-csi-migration.md Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
Documentation/flex-to-csi-migration.md Outdated Show resolved Hide resolved
@subhamkrai
Copy link
Contributor Author

My test of the conversion worked! just a few small suggestions in the doc...

My test consisted of creating flex volumes for mysql and wordpress example app pods, then converting them with these commands:

kubectl scale --replicas=0 deploy/wordpress-mysql
kubectl scale --replicas=0 deploy/wordpress
# connect to the migrator pod
pv-migrator --pvc=mysql-pv-claim --pvc-ns=default --destination-sc=rook-ceph-block-csi 
pv-migrator --pvc=wp-pv-claim --pvc-ns=default --destination-sc=rook-ceph-block-csi 
# disconnect from the migrator pod
kubectl scale --replicas=1 deploy/wordpress-mysql
kubectl scale --replicas=1 deploy/wordpress

Good to know it is working as expected!

Adding guide doc for migrating rbd flexvolume to ceph-csi.

Signed-off-by: subhamkrai <srai@redhat.com>
Missed few nits of flex-migrator,doing it here
as discussed.

Signed-off-by: subhamkrai <srai@redhat.com>
I1125 07:56:26.504578 63 log.go:34] waiting for PV pvc-30a01887-8821-4baf-835c-16a7e55ba7f0 in state &PersistentVolumeStatus{Phase:Bound,Message:,Reason:,} to be deleted (0 seconds elapsed)
I1125 07:56:26.702921 63 log.go:34] deleted persistent volume pvc-30a01887-8821-4baf-835c-16a7e55ba7f0
I1125 07:56:26.702944 63 log.go:34] successfully migrated pvc rbd-pvc
I1125 07:56:26.703335 63 log.go:34] Successfully migrated all the PVCs to CSI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message for individual PVC names seems sufficient. Or instead of saying "all" PVCs, how about printing the number of PVCs converted?

@travisn travisn merged commit a899d96 into rook:release-1.7 Dec 2, 2021
@subhamkrai subhamkrai linked an issue Dec 2, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration procedure from flexvolume to ceph-csi
4 participants