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_mssql_virtual_machine - Add support for storage_configuration_settings #8623

Merged
merged 5 commits into from
Oct 2, 2020

Conversation

mbfrahry
Copy link
Member

Fixes #6874

@mbfrahry mbfrahry added service/mssql Microsoft SQL Server enhancement labels Sep 25, 2020
@mbfrahry mbfrahry requested a review from a team September 25, 2020 07:27
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.

Aside from some comments about the property this is looking good

@@ -171,6 +172,37 @@ func resourceArmMsSqlVirtualMachine() *schema.Resource {
ValidateFunc: validate.MsSqlVMLoginUserName,
},

"storage_configuration_settings": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think settings is redundant here

Suggested change
"storage_configuration_settings": {
"storage_configuration": {

MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"disk_configuration_type": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

as is configuration?

Suggested change
"disk_configuration_type": {
"disk_type": {

string(sqlvirtualmachine.DW),
}, false),
},
"sql_data_settings": helper.StorageSettingSchema(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

as is sql?

Suggested change
"sql_data_settings": helper.StorageSettingSchema(),
"data_settings": helper.StorageSettingSchema(),

}, false),
},
"sql_data_settings": helper.StorageSettingSchema(),
"sql_log_settings": helper.StorageSettingSchema(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"sql_log_settings": helper.StorageSettingSchema(),
"log_settings": helper.StorageSettingSchema(),

},
"sql_data_settings": helper.StorageSettingSchema(),
"sql_log_settings": helper.StorageSettingSchema(),
"sql_temp_db_settings": helper.StorageSettingSchema(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"sql_temp_db_settings": helper.StorageSettingSchema(),
"temp_db_settings": helper.StorageSettingSchema(),

@a30000931
Copy link

looks great - happy to help test this out

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 @mbfrahry - looks like the tests are failing thou:

=== RUN   TestAccAzureRMMsSqlVirtualMachine_storageConfigurationSettings
=== PAUSE TestAccAzureRMMsSqlVirtualMachine_storageConfigurationSettings
=== CONT  TestAccAzureRMMsSqlVirtualMachine_storageConfigurationSettings
    TestAccAzureRMMsSqlVirtualMachine_updateAutoPatching: testing.go:684: Step 0 error: Check failed: Check 2/4 error: azurerm_mssql_virtual_machine.test: Attribute 'auto_patching.0.day_of_week' expected "Sunday", got ""
    TestAccAzureRMMsSqlVirtualMachine_complete: testing.go:684: Step 0 error: After applying this step, the plan was not empty:
        
        DIFF:
        
        UPDATE: azurerm_mssql_virtual_machine.test
          auto_patching.#:                               "0" => "0"
          id:                                            "/subscriptions/*******/resourceGroups/acctestRG-mssql-200929043203782538/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/acctest-VM-200929043203782538" => "/subscriptions/*******/resourceGroups/acctestRG-mssql-200929043203782538/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/acctest-VM-200929043203782538"
          key_vault_credential.#:                        "0" => "0"
          r_services_enabled:                            "true" => "true"
          sql_connectivity_port:                         "1433" => "1433"
          sql_connectivity_type:                         "PRIVATE" => "PRIVATE"
          sql_connectivity_update_password:              "Password1234!" => "Password1234!"
          sql_connectivity_update_username:              "sqllogin" => "sqllogin"
          sql_license_type:                              "PAYG" => "PAYG"
          storage_configuration.#:                       "1" => "0"
          storage_configuration.0.data_settings.#:       "0" => ""
          storage_configuration.0.disk_type:             "" => ""
          storage_configuration.0.log_settings.#:        "0" => ""
          storage_configuration.0.storage_workload_type: "" => ""
          storage_configuration.0.temp_db_settings.#:    "0" => ""
          virtual_machine_id:                            "/subscriptions/*******/resourceGroups/acctestRG-mssql-200929043203782538/providers/Microsoft.Compute/virtualMachines/acctest-VM-200929043203782538" => "/subscriptions/*******/resourceGroups/acctestRG-mssql-200929043203782538/providers/Microsoft.Compute/virtualMachines/acctest-VM-200929043203782538"
        ```

@mbfrahry
Copy link
Member Author

mbfrahry commented Oct 2, 2020

Those tests have been failing on master as well. Thoughts on fixing it in another PR?

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.

+1

@mbfrahry mbfrahry merged commit 9fbb0a1 into master Oct 2, 2020
@mbfrahry mbfrahry deleted the f-sql-vm-scs branch October 2, 2020 23:20
mbfrahry added a commit that referenced this pull request Oct 2, 2020
@katbyte katbyte added this to the v2.31.0 milestone Oct 3, 2020
@ghost
Copy link

ghost commented Oct 8, 2020

This has been released in version 2.31.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 = "~> 2.31.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 2, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 2, 2020
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 SQL Virtual Machine StorageConfigurationSettings
3 participants