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

fix: allow resizing to min required size for performance plus disks #1950

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

RomanBednar
Copy link
Contributor

What type of PR is this?
/kind bug
/kind feature

What this PR does / why we need it:

See #1949 for detailed description. This patch would reduce the number of errors users might get when creating performancePlus disks.

Which issue(s) this PR fixes:

Fixes #1949

Requirements:

Special notes for your reviewer:

Patch verified with:

  1. Create StorageClass:
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: csi-perfplus
parameters:
  skuname: Premium_LRS
  enablePerformancePlus: "true"
provisioner: disk.csi.azure.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
  1. Create PVC:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mypvc-enableperformanceplus
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: "csi-perfplus"
  1. Warning log message:

W0829 10:46:37.457074 1 controllerserver.go:103] using PerformancePlus, increasing requested disk size from 5GiB to 513GiB (minimal size for PerformancePlus feature)

  1. Check disk was created with performancePlus enabled:
$ az disk show --resource-group rbednar-mycluster-01-4c6xn-rg --name `oc get pv/pvc-3795b4cd-c105-462d-9a95-99e6ce35282b -o custom-columns=:.metadata.name --no-headers` | jq '.creationData.performancePlus'
true

Release note:

When `enablePerformancePlus` parameter is set to `"true"` volumes will be automatically resized to 513Gi if requested size was smaller.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 29, 2023
@@ -98,7 +98,13 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
capacityBytes := req.GetCapacityRange().GetRequiredBytes()
volSizeBytes := int64(capacityBytes)
requestGiB := int(volumehelper.RoundUpGiB(volSizeBytes))

if diskParams.PerformancePlus != nil && *diskParams.PerformancePlus {
Copy link
Member

Choose a reason for hiding this comment

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

if ... && requestGiB < consts.PerformancePlusMinimumDiskSizeGiB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sure, fixed.

Copy link
Member

Choose a reason for hiding this comment

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

still not fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, now it should be ok

@RomanBednar
Copy link
Contributor Author

/assign @andyzhangx for review

if requestGiB < consts.MinimumDiskSizeGiB {
klog.Infof("increasing requested disk size from %vGiB to %vGiB (minimal disk size)")
Copy link
Member

Choose a reason for hiding this comment

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

append requestGiB, consts.MinimumDiskSizeGiB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if requestGiB < consts.MinimumDiskSizeGiB {
klog.Infof("increasing requested disk size from %vGiB to %vGiB (minimal disk size)")
Copy link
Member

Choose a reason for hiding this comment

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

append requestGiB, consts.MinimumDiskSizeGiB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if requestGiB < consts.MinimumDiskSizeGiB {
klog.Infof("increasing requested disk size from %vGiB to %vGiB (minimal disk size)", requestGiB, consts.PerformancePlusMinimumDiskSizeGiB)
Copy link
Member

Choose a reason for hiding this comment

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

it should be MinimumDiskSizeGiB

if requestGiB < consts.MinimumDiskSizeGiB {
klog.Infof("increasing requested disk size from %vGiB to %vGiB (minimal disk size)", requestGiB, consts.PerformancePlusMinimumDiskSizeGiB)
Copy link
Member

Choose a reason for hiding this comment

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

it should be MinimumDiskSizeGiB

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/lgtm
/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 30, 2023
@andyzhangx andyzhangx changed the title allow resizing to min required size for performance plus disks fix: allow resizing to min required size for performance plus disks Sep 30, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, RomanBednar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 30, 2023
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Sep 30, 2023

@RomanBednar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-azuredisk-csi-driver-e2e-capz-windows-2022-hostprocess 6f8c1a2 link true /test pull-azuredisk-csi-driver-e2e-capz-windows-2022-hostprocess

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@andyzhangx andyzhangx merged commit 582d6ef into kubernetes-sigs:master Sep 30, 2023
10 checks passed
@andyzhangx
Copy link
Member

/cherrypick release-1.29

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #1986

In response to this:

/cherrypick release-1.29

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@andyzhangx
Copy link
Member

/cherrypick release-1.28

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #1987

In response to this:

/cherrypick release-1.28

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@andyzhangx
Copy link
Member

/cherrypick release-1.27

@k8s-infra-cherrypick-robot

@andyzhangx: #1950 failed to apply on top of branch "release-1.27":

Applying: allow resizing to min required size for performance plus disks
Using index info to reconstruct a base tree...
M	pkg/azureconstants/azure_constants.go
M	pkg/azuredisk/controllerserver.go
M	pkg/azuredisk/controllerserver_test.go
M	pkg/azuredisk/controllerserver_v2.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/azuredisk/controllerserver_v2.go
Auto-merging pkg/azuredisk/controllerserver_test.go
Auto-merging pkg/azuredisk/controllerserver.go
Auto-merging pkg/azureconstants/azure_constants.go
CONFLICT (content): Merge conflict in pkg/azureconstants/azure_constants.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 allow resizing to min required size for performance plus disks
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.27

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

misleading message for performancePlus disk size
4 participants