-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_managed_disk
- add support for the UltraSSD disk_iops_read_write
& disk_mbps_read_write
properties
#4102
Conversation
azurerm_managed_disk
add support for the UltraSSD disk_iops_read_write
& disk_mbps_read_write
properties
azurerm_managed_disk
add support for the UltraSSD disk_iops_read_write
& disk_mbps_read_write
propertiesazurerm_managed_disk
- add support for the UltraSSD disk_iops_read_write
& disk_mbps_read_write
properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM 👍
azurerm/data_source_managed_disk.go
Outdated
@@ -82,6 +92,12 @@ func dataSourceArmManagedDiskRead(d *schema.ResourceData, meta interface{}) erro | |||
if diskSize := props.DiskSizeGB; diskSize != nil { | |||
d.Set("disk_size_gb", *diskSize) | |||
} | |||
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil { | |||
d.Set("disk_iops_read_write", *diskIOPS) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can just be:
} | |
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
azurerm/data_source_managed_disk.go
Outdated
} | ||
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil { | ||
d.Set("disk_mbps_read_write", *diskMBps) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can just be:
d.Set("disk_mbps_read_write", props.DiskMBpsReadWrite)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
azurerm/resource_arm_managed_disk.go
Outdated
} | ||
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil { | ||
d.Set("disk_mbps_read_write", *diskMBps) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @jeffreyCline,
In addition to my inline comments could we get a test with the ultraSSD type and the new properties?
@@ -110,5 +110,8 @@ resource "azurerm_virtual_machine" "test" { | |||
* `source_resource_id` - ID of an existing managed disk that the current resource was created from. | |||
* `os_type` - The operating system for managed disk. Valid values are `Linux` or `Windows` | |||
* `disk_size_gb` - The size of the managed disk in gigabytes. | |||
* `disk_iops_read_write` - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. | |||
* `disk_mbps_read_write` - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second. | |||
~> **Note**: A `storage_account_type` of type `UltraSSD_LRS` and the attributes `disk_iops_read_write` and `disk_mbps_read_write` are currently in private preview and are not available to subscriptions that have not opted-in to the `Azure ultra disks` private preview. For more information see the `Azure ultra disks` [product documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-enable-ultra-ssd). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this note here as its just the datasource and exists in the resource docs. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure... I'm fine with that.
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
I didn't add the test as this is a private preview and you need to set up your subscription to use this in one of the three regions it is currently in. I believe that it is supposed to GA on Oct. 1st, so I would be happy to add one then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreyCline, Looks like you missed some of toms comments. Even thou it is in preview i'd like to see the tests for these properties. I believe our subscription is now whitelisted so we should be able to run them.
azurerm/data_source_managed_disk.go
Outdated
d.Set("disk_size_gb", *diskSize) | ||
d.Set("disk_size_gb", props.DiskSizeGB) | ||
} | ||
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the check here as d.Set() will do it for us:
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil { | |
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
azurerm/data_source_managed_disk.go
Outdated
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil { | ||
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite) | ||
} | ||
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
azurerm/resource_arm_managed_disk.go
Outdated
@@ -268,6 +298,12 @@ func resourceArmManagedDiskRead(d *schema.ResourceData, meta interface{}) error | |||
if osType := props.OsType; osType != "" { | |||
d.Set("os_type", string(osType)) | |||
} | |||
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the check here as d.Set
will do it for us:
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil { | |
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
azurerm/resource_arm_managed_disk.go
Outdated
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil { | ||
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite) | ||
} | ||
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
* `disk_mbps_read_write` - (Optional) The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second. | ||
|
||
-> **Note**: A `storage_account_type` of type `UltraSSD_LRS` and the arguments `disk_iops_read_write` and `disk_mbps_read_write` are currently in private preview and are not available to subscriptions that have not requested onboarding to `Azure Ultra Disk Storage` private preview. `Azure Ultra Disk Storage` is only available in `East US 2`, `North Europe`, and `Southeast Asia` regions. For more information see the `Azure Ultra Disk Storage` [product documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-enable-ultra-ssd), [product blog](https://azure.microsoft.com/en-us/blog/announcing-the-general-availability-of-azure-ultra-disk-storage/) and [FAQ](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/faq-for-disks#ultra-disks). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this applies to the "type" could we move it up to under the type??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk... moved. :)
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
I have added the tests to both data source and resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @jeffreyCline! LGTM 👍
This has been released in version 1.34.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 1.34.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
[fixes: #3765 ]