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

rbd: enable expand operation for intree volumes #2741

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

humblec
Copy link
Collaborator

@humblec humblec commented Dec 22, 2021

This commit enable the resize operation [1] for in-tree volumes.
new helper has been introduced here to aid the enablement or to
make it clean with existing code base.

[1] https://github.com/ceph/ceph-csi/blob/devel/docs/design/proposals/intree-migrate.md?plain=1#L66

Updates #2509

Signed-off-by: Humble Chirammal [email protected]

Additional Info:

  • no unit test added for the helper newVolFromVolIDWithMigration() as it contains cr format as in other left out helpers.
  • no e2e as it need support from sidecar..etc.
  • I have tested this manually and the resize has worked as expected and also for other operations.

Here is the log:

I1222 06:34:26.791024 1000552 utils.go:177] ID: 26 Req-ID: mig_mons-b7f67366bb43f32e07d8a261a7840da9_image-773226a6-dbc3-47b5-b47c-bfa8d64b1e2e_7265706c696361706f6f6c GRPC call: /csi.v1./ExpandVolume
I1222 06:34:26.791314 1000552 utils.go:181] ID: 26 Req-ID: mig_mons-b7f67366bb43f32e07d8a261a7840da9_image-773226a6-dbc3-47b5-b47c-bfa8d64b1e2e_7265706c696361706f6f6c GRPC request: {"capacity_range":{"required_bytes":4294967296},....
I1222 06:34:26.828325 1000552 mount_linux.go:487] Attempting to determine if disk "/dev/rbd0" is formatted using blkid with args: ([-p -s TYPE -s PTTYPE -o export /dev/rbd0])
I1222 06:34:26.830157 1000552 mount_linux.go:490] Output: "DEVNAME=/dev/rbd0\nTYPE=ext4\n"
I1222 06:34:26.830187 1000552 resizefs_linux.go:56] ResizeFS.Resize - Expanding mounted volume /dev/rbd0
I1222 06:34:26.832030 1000552 resizefs_linux.go:71] Device /dev/rbd0 resized successfully
I1222 06:34:26.832140 1000552 utils.go:188] ID: 26 Req-ID: mig_mons-b7f67366bb43f32e07d8a261a7840da9_image-773226a6-dbc3-47b5-b47c-bfa8d64b1e2e_7265706c696361706f6f6c GRPC response: {}
...


[hchiramm@hchiramm ]$ mount |grep rbd
/dev/rbd0 on /var/lib/kubelet/plugins/kubernetes.io/csi/pv/pvc-c827c204-94e7-4ed9-87e9-fce212fe61a0/globalmount/mig_mons-b7f67366bb43f32e07d8a261a7840da9_image-773226a6-dbc3-47b5-b47c-bfa8d64b1e2e_7265706c696361706f6f6c type ext4 (rw,relatime,stripe=16,_netdev)
/dev/rbd0 on /var/lib/kubelet/pods/80dc68c4-049d-49cb-8933-abf64c35bb65/volumes/kubernetes.io~csi/pvc-c827c204-94e7-4ed9-87e9-fce212fe61a0/mount type ext4 (rw,relatime,stripe=16,_netdev)
[hchiramm@hchiramm ]$ kubectl exec -ti in-task-pv-pod -- df -kh|grep nginx
/dev/rbd0                                4.0G  4.0M  3.9G   1% /usr/share/nginx/html
[hchiramm@hchiramm ]$ 

@mergify mergify bot added the component/rbd Issues related to RBD label Dec 22, 2021
@humblec humblec added this to the release-3.5.0 milestone Dec 22, 2021
@humblec humblec requested review from Madhu-1, a team and nixpanic December 22, 2021 08:24
Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

if not available Please add e2e changes for this one.

internal/rbd/migration.go Outdated Show resolved Hide resolved
internal/rbd/controllerserver.go Show resolved Hide resolved
internal/rbd/migration.go Show resolved Hide resolved
internal/rbd/rbd_util.go Show resolved Hide resolved
@humblec
Copy link
Collaborator Author

humblec commented Dec 22, 2021

if not available Please add e2e changes for this one.

@Madhu-1 you mean in the tracker ?

@humblec humblec requested a review from Madhu-1 December 22, 2021 09:10
@Madhu-1
Copy link
Collaborator

Madhu-1 commented Dec 22, 2021

if not available Please add e2e changes for this one.

@Madhu-1 you mean in the tracker ?

as expand is getting adding in this PR it good to add E2E to make sure its working

internal/rbd/migration.go Outdated Show resolved Hide resolved
internal/rbd/controllerserver.go Show resolved Hide resolved
@humblec humblec force-pushed the in-resize-new branch 3 times, most recently from c7cacc4 to 962513c Compare December 22, 2021 09:38
@humblec
Copy link
Collaborator Author

humblec commented Dec 22, 2021

if not available Please add e2e changes for this one.

@Madhu-1 you mean in the tracker ?

as expand is getting adding in this PR it good to add E2E to make sure its working

@Madhu-1 our current e2e for static volumes in general is not upto the mark. so adding an extension again on that at this stage is not really worth I believe. Once the sidecars are in place and when we revamp we can add or try to simulate the setups.

@humblec humblec force-pushed the in-resize-new branch 3 times, most recently from b1f7e7a to e24f79c Compare December 22, 2021 11:23
internal/rbd/rbd_util.go Outdated Show resolved Hide resolved
internal/rbd/rbd_util.go Outdated Show resolved Hide resolved
@humblec humblec force-pushed the in-resize-new branch 2 times, most recently from 94462cf to a7c370e Compare December 22, 2021 11:48
@humblec humblec force-pushed the in-resize-new branch 2 times, most recently from cfc4734 to 1432707 Compare December 22, 2021 11:58
Madhu-1
Madhu-1 previously approved these changes Dec 22, 2021
Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

small nit and suggested a nicer version for genVolFromVolIDWithMigration .

internal/rbd/migration.go Show resolved Hide resolved
internal/rbd/rbd_util.go Show resolved Hide resolved
@mergify mergify bot dismissed Madhu-1’s stale review December 22, 2021 11:59

Pull request has been modified.

@humblec
Copy link
Collaborator Author

humblec commented Dec 22, 2021

updated the nicer version too, the current github action failure is spurious one. conternarized-test pass locally.

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Dec 22, 2021

#2743 should fix CI

internal/rbd/rbd_util.go Outdated Show resolved Hide resolved
@humblec humblec force-pushed the in-resize-new branch 2 times, most recently from 9d94c32 to 7dfa1ac Compare December 22, 2021 14:19
internal/rbd/migration.go Outdated Show resolved Hide resolved
@humblec humblec force-pushed the in-resize-new branch 3 times, most recently from d415e0b to 4eb3877 Compare December 22, 2021 14:39
Madhu-1
Madhu-1 previously approved these changes Dec 22, 2021
@mergify mergify bot dismissed Madhu-1’s stale review December 22, 2021 14:40

Pull request has been modified.

@humblec humblec removed the request for review from nixpanic December 22, 2021 14:52
@humblec humblec added the ci/retry/e2e Label to retry e2e retesting on approved PR's label Dec 22, 2021
This commit enable the resize operation[1] for in-tree volumes.
new helper has been introduced here to aid the enablement or to
make it clean with existing code base.

[1] https://github.com/ceph/ceph-csi/blob/devel/docs/design/proposals/intree-migrate.md?plain=1#L66

Signed-off-by: Humble Chirammal <[email protected]>
@mergify mergify bot merged commit b9a8d37 into ceph:devel Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/retry/e2e Label to retry e2e retesting on approved PR's component/rbd Issues related to RBD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants