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

azurerm_managed_disk - add support for the UltraSSD disk_iops_read_write & disk_mbps_read_write properties #4102

Merged
merged 21 commits into from Sep 6, 2019

Conversation

WodansSon
Copy link
Collaborator

@WodansSon WodansSon commented Aug 15, 2019

[fixes: #3765 ]

@WodansSon WodansSon added this to the v1.33.0 milestone Aug 15, 2019
@ghost ghost added the size/S label Aug 15, 2019
@ghost ghost added size/M and removed size/S labels Aug 16, 2019
@katbyte katbyte changed the title [WIP]Enhancement: Add support for UltraSSD to Managed Disk azurerm_managed_disk add support for the UltraSSD disk_iops_read_write & disk_mbps_read_write properties Aug 18, 2019
@katbyte katbyte changed the title 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 properties Aug 18, 2019
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

otherwise LGTM 👍

@@ -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)
}
Copy link
Member

Choose a reason for hiding this comment

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

this can just be:

Suggested change
}
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

}
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil {
d.Set("disk_mbps_read_write", *diskMBps)
}
Copy link
Member

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

}
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil {
d.Set("disk_mbps_read_write", *diskMBps)
}
Copy link
Member

Choose a reason for hiding this comment

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

(same here)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@katbyte katbyte modified the milestones: v1.33.0, v1.34.0 Aug 21, 2019
Copy link
Collaborator

@katbyte katbyte 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 the PR @jeffreyCline,

In addition to my inline comments could we get a test with the ultraSSD type and the new properties?

website/docs/d/managed_disk.html.markdown Outdated Show resolved Hide resolved
website/docs/d/managed_disk.html.markdown Outdated Show resolved Hide resolved
@@ -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).
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

WodansSon and others added 2 commits August 28, 2019 16:52
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
@WodansSon
Copy link
Collaborator Author

Thanks for the PR @jeffreyCline,
In addition to my inline comments could we get a test with the ultraSSD type and the new properties?

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.

Copy link
Collaborator

@katbyte katbyte left a 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.

d.Set("disk_size_gb", *diskSize)
d.Set("disk_size_gb", props.DiskSizeGB)
}
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil {
Copy link
Collaborator

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:

Suggested change
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil {
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil {
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite)
}
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@@ -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 {
Copy link
Collaborator

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:

Suggested change
if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil {
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

if diskIOPS := props.DiskIOPSReadWrite; diskIOPS != nil {
d.Set("disk_iops_read_write", props.DiskIOPSReadWrite)
}
if diskMBps := props.DiskMBpsReadWrite; diskMBps != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

website/docs/d/managed_disk.html.markdown Outdated Show resolved Hide resolved
website/docs/d/managed_disk.html.markdown Outdated Show resolved Hide resolved

* `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).
Copy link
Collaborator

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??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

kk... moved. :)

website/docs/r/managed_disk.html.markdown Outdated Show resolved Hide resolved
@WodansSon
Copy link
Collaborator Author

@kt

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.

I have added the tests to both data source and resource.

@ghost ghost added size/L and removed size/M labels Sep 5, 2019
@ghost ghost added size/L and removed size/M labels Sep 5, 2019
Copy link
Collaborator

@katbyte katbyte 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 the changes @jeffreyCline! LGTM 👍

@katbyte katbyte merged commit 3ef7d49 into master Sep 6, 2019
@katbyte katbyte deleted the nr_ultrassd branch September 6, 2019 19:14
katbyte added a commit that referenced this pull request Sep 6, 2019
@ghost
Copy link

ghost commented Sep 18, 2019

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 ...

@ghost
Copy link

ghost commented Oct 7, 2019

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!

@ghost ghost locked and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for 'UltraSSDEnabled' flag for a VM
4 participants