Skip to content

Commit

Permalink
Merge pull request #1855 from andyzhangx/enablePerformancePlus
Browse files Browse the repository at this point in the history
feat: add enablePerformancePlus in storage class
  • Loading branch information
andyzhangx committed May 16, 2023
2 parents cbbde44 + 50cce62 commit fc7d59e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/driver-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ networkAccessPolicy | NetworkAccessPolicy property to prevent anybody from gener
publicNetworkAccess | Enabling or disabling public access to the underlying data of a disk on the internet, even when the NetworkAccessPolicy is set to `AllowAll` | `Enabled`, `Disabled` | No | `Enabled`
diskAccessID | ARM id of the [DiskAccess](https://aka.ms/disksprivatelinksdoc) resource for using private endpoints on disks | | No | ``
enableBursting | [enable on-demand bursting](https://docs.microsoft.com/en-us/azure/virtual-machines/disk-bursting) beyond the provisioned performance target of the disk. On-demand bursting only be applied to Premium disk, disk size > 512GB, Ultra & shared disk is not supported. Bursting is disabled by default. | `true`, `false` | No | `false`
enablePerformancePlus | [enabling performance plus](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-enable-performance), this setting only applies to Premium SSD, Standard SSD and HDD with disk size > 512GB. | `true`, `false` | No | `false`
useragent | User agent used for [customer usage attribution](https://docs.microsoft.com/en-us/azure/marketplace/azure-partner-customer-usage-attribution)| | No | Generated Useragent formatted `driverName/driverVersion compiler/version (OS-ARCH)`
subscriptionID | specify Azure subscription ID in which Azure disk will be created | Azure subscription ID | No | if not empty, `resourceGroup` must be provided

Expand Down
1 change: 1 addition & 0 deletions pkg/azureconstants/azure_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const (
WriteAcceleratorEnabled = "writeacceleratorenabled"
ZonedField = "zoned"
EnableAsyncAttachField = "enableasyncattach"
PerformancePlusField = "enableperformanceplus"
TooManyRequests = "TooManyRequests"
ClientThrottled = "client throttled"
VolumeID = "volumeid"
Expand Down
1 change: 1 addition & 0 deletions pkg/azuredisk/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
SourceType: sourceType,
Tags: diskParams.Tags,
Location: diskParams.Location,
PerformancePlus: diskParams.PerformancePlus,
}

volumeOptions.SkipGetDiskOperation = d.isGetDiskThrottled()
Expand Down
1 change: 1 addition & 0 deletions pkg/azuredisk/controllerserver_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func (d *DriverV2) CreateVolume(ctx context.Context, req *csi.CreateVolumeReques
SourceType: sourceType,
Tags: diskParams.Tags,
Location: diskParams.Location,
PerformancePlus: diskParams.PerformancePlus,
}
// Azure Stack Cloud does not support NetworkAccessPolicy, PublicNetworkAccess
if !azureutils.IsAzureStackCloud(d.cloud.Config.Cloud, d.cloud.Config.DisableAzureStackCloud) {
Expand Down
7 changes: 7 additions & 0 deletions pkg/azureutils/azure_disk_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ type ManagedDiskParameters struct {
DiskName string
EnableAsyncAttach *bool
EnableBursting *bool
PerformancePlus *bool
FsType string
Incremental bool
Location string
Expand Down Expand Up @@ -662,6 +663,12 @@ func ParseDiskParameters(parameters map[string]string) (ManagedDiskParameters, e
}
case consts.ZonedField:
// no op, only for backward compatibility with in-tree driver
case consts.PerformancePlusField:
value, err := strconv.ParseBool(v)
if err != nil {
return diskParams, fmt.Errorf("invalid %s: %s in storage class", consts.PerformancePlusField, v)
}
diskParams.PerformancePlus = &value
default:
// accept all device settings params
// device settings need to start with azureconstants.DeviceSettingsKeyPrefix
Expand Down
7 changes: 4 additions & 3 deletions test/e2e/dynamic_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,10 @@ func (t *dynamicProvisioningTestSuite) defineTests(isMultiZone bool) {
"skuName": "Premium_LRS",
"perfProfile": "Basic",
// enableBursting can only be applied to Premium disk, disk size > 512GB, Ultra & shared disk is not supported.
"enableBursting": "true",
"userAgent": "azuredisk-e2e-test",
"enableAsyncAttach": "false",
"enableBursting": "true",
"userAgent": "azuredisk-e2e-test",
"enableAsyncAttach": "false",
"enablePerformancePlus": "true",
},
}
test.Run(ctx, cs, ns)
Expand Down

0 comments on commit fc7d59e

Please sign in to comment.