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

Add support for Ultra Disks as Persistent Volumes #2421

Merged
merged 1 commit into from Jun 27, 2022
Merged

Add support for Ultra Disks as Persistent Volumes #2421

merged 1 commit into from Jun 27, 2022

Conversation

damdo
Copy link
Member

@damdo damdo commented Jun 24, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
Following the design conversations held on #1852
we are introducing a new AdditionalCapabilities field in the Machine spec which will allow us to specify these types of capabilities on Azure Machines.
More specifically, this change is introduced to allow users to specify the UltraSSDEnabled Additional Capability, which will instruct Azure to allow or disallow the use of Ultra Disks with an host instance. More on this on the linked issue.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1852

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Add support for Ultra Disks as Persistent Volumes

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. labels Jun 24, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @damdo!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-azure 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-azure has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 24, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @damdo. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 24, 2022
@@ -86,6 +86,10 @@ type AzureMachineSpec struct {
// +optional
AdditionalTags Tags `json:"additionalTags,omitempty"`

// AdditionalCapabilities specifies additional capabilities enabled or disabled on the virtual machine.
// +optional
AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

So I see that the Azure SDK type spec defines this AdditionalCapabilities struct to contain the UltraSSD config... I wonder if we want to expose that to capz users, or simply add UltraSSDEnabled to the existing flat configuration property structure in AzureMachineSpec.

Thoughts @CecileRobertMichon @mboersma

Copy link
Contributor

Choose a reason for hiding this comment

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

lol I see this was discussed at length in the linked issue

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah :) we agreed with @CecileRobertMichon on going with this design.

@jackfrancis
Copy link
Contributor

Thanks for this @damdo!

@jackfrancis
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 24, 2022
@jackfrancis
Copy link
Contributor

@damdo can you do the following:

  1. Add this new configuration to the base template that we use to test by adding to the AzureMachineTemplate under templates/flavors/default/machine-deployment.yaml?
  2. Run hack/gen-flavors.sh to render the changes across all templates that re-use that base flavor partial

This will allow us to get E2E test signal on this PR before it merges, and to better ensure its functionality going forward.

Thanks!

@CecileRobertMichon
Copy link
Contributor

Add this new configuration to the base template

@jackfrancis the base template is published as a reference template for users and is the default flavor that clusterctl uses to create a CAPZ cluster, we shouldn't turn on arbitrary features unless they are blessed "best practice" configurations that we recommend users turn on by default. This doesn't apply to ultra disks, especially since Ultra disk support is quite limited it won't work for every region/zone/VM size.

If we want to test it in e2e, we should add it to one of the test templates as a kustomize patch.

Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together @damdo, looks good, just one nit in the documentation I found

docs/book/src/topics/data-disks.md Outdated Show resolved Hide resolved
@jackfrancis
Copy link
Contributor

@damdo I tried to test this manually and got this error:

E0627 10:02:14.628416      45 controller.go:317] controller/azuremachine "msg"="Reconciler error" "error"="failed to reconcile AzureMachine: failed to reconcile AzureMachine service virtualmachine: failed to create resource default-11551/default-11551-control-plane-wbsz8 (service: virtualmachine): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=\"InvalidParameter\" Message=\"Storage Account type UltraSSD_LRS is not supported with caching type ReadWrite. Please use caching type None.\" Target=\"dataDisk.caching\"" "name"="default-11551-control-plane-wbsz8" "namespace"="default" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AzureMachine" 

We'll need to automatically set the dataDisk.cachingType value to None if "UltraSSD_LRS" is the chosen managedDisk.storageAccountType value and the cachingType val is empty. And, if it's not empty and != None we'll need to throw a webhook validation error.

- add AdditionalCapabilities struct field, add UltraSSDEnabled field support
- add AdditionalCapabilities and UltraSSDEnabled tests
- add Ultra disks as Persistent Volumes docs
- add AdditionalCapabilities, UltraSSDEnabled generated manifests & conversion
@jackfrancis
Copy link
Contributor

@damdo I confirmed that the following template addition to a dataDisk spec works in this PR:

        - nameSuffix: mydata
          diskSizeGB: 256
          lun: 1
          managedDisk:
            storageAccountType: "UltraSSD_LRS"
          cachingType: None

So let's get the cachingType foo incorporated (including mentioning that in docs) and I think we're good to go. Thanks so much!

@jackfrancis
Copy link
Contributor

@CecileRobertMichon I cross-referenced your docs with the regions we test and all of our testing regions support zones + ultrassd. After this PR merges I'll start testing a change where we confiure our etcd data disk to use ultrassd in reference templates. I think that is in fact a "best practice" configuration.

@damdo
Copy link
Member Author

damdo commented Jun 27, 2022

Hey @jackfrancis, thanks for manually testing this.

If I'm understanding the error correctly here, this is strictly related to specifying a Data Disk of type UltraSSD_LRS when also choosing a cachingType other than None.

I think is something not strictly related or introduced in this PR, even though part of the same overall big feature (Ultra Disks).
I suspect the issue you are talking about would be reproducible even without this PR as that'd be in the domain of the: "Ultra disks as data disks" feature, rather than the "Ultra Disks as Persistent Volumes" feature (which this PR introduces).

That said I completely agree with your suggestions for fixing this.
So my only ask is whether we should instead do it in another PR to be merged before this one, to treat what you are flagging as a bug of an existing behaviour, and merge this as an additional feature after that.

Thanks!

@damdo
Copy link
Member Author

damdo commented Jun 27, 2022

/test pull-cluster-api-provider-azure-e2e

@damdo
Copy link
Member Author

damdo commented Jun 27, 2022

@jackfrancis I've created a bug issue #2429 to track that cachingType validation issue and opened a pr #2430 to fix it.

@jackfrancis
Copy link
Contributor

@damdo sgtm!

thanks for the add'l PR!

Copy link
Contributor

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 27, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis

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 Jun 27, 2022
@k8s-ci-robot k8s-ci-robot merged commit 7e8cd85 into kubernetes-sigs:main Jun 27, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Jun 27, 2022
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/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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Allow Ultra Disk Enablement for Persistent Volumes
5 participants