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

Update azurerm_windows_virtual_machine - Support patch_mode #9258

Merged

Conversation

ArcturusZhang
Copy link
Contributor

No description provided.

@ArcturusZhang ArcturusZhang force-pushed the virtual-machine-windows-patch-mode branch from 83184ed to f479d4d Compare November 11, 2020 06:12
@ArcturusZhang
Copy link
Contributor Author

New tests passed:

=== RUN   TestAccWindowsVirtualMachine_otherPatchModeManual
=== PAUSE TestAccWindowsVirtualMachine_otherPatchModeManual
=== CONT  TestAccWindowsVirtualMachine_otherPatchModeManual
--- PASS: TestAccWindowsVirtualMachine_otherPatchModeManual (316.32s)
=== RUN   TestAccWindowsVirtualMachine_otherPatchModeAutomaticByOS
=== PAUSE TestAccWindowsVirtualMachine_otherPatchModeAutomaticByOS
=== CONT  TestAccWindowsVirtualMachine_otherPatchModeAutomaticByOS
--- PASS: TestAccWindowsVirtualMachine_otherPatchModeAutomaticByOS (425.57s)
=== RUN   TestAccWindowsVirtualMachine_otherPatchModeAutomaticByPlatform
=== PAUSE TestAccWindowsVirtualMachine_otherPatchModeAutomaticByPlatform
=== CONT  TestAccWindowsVirtualMachine_otherPatchModeAutomaticByPlatform
--- PASS: TestAccWindowsVirtualMachine_otherPatchModeAutomaticByPlatform (297.50s)
=== RUN   TestAccWindowsVirtualMachine_otherPatchModeUpdate
=== PAUSE TestAccWindowsVirtualMachine_otherPatchModeUpdate
=== CONT  TestAccWindowsVirtualMachine_otherPatchModeUpdate
--- PASS: TestAccWindowsVirtualMachine_otherPatchModeUpdate (692.15s)
PASS

Process finished with exit code 0

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 @ArcturusZhang - overall this looks good but i've left some comments inline that should be addressed

@@ -141,6 +141,8 @@ The following arguments are supported:

-> **NOTE:** This can only be configured when `priority` is set to `Spot`.

* `patch_mode` - (Optional) Specifies the mode of in-guest patching to this Windows Virtual Machine. Possible values are `Manual`, `AutomaticByOS` and `AutomaticByPlatform`. Defaults to `AutomaticByOS`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we include a note that this is a preview feature and the command to enable it?

 TestAccWindowsVirtualMachine_otherPatchModeUpdate: testing.go:684: Step 2 error: errors during apply:
        
        Error: updating Windows Virtual Machine "acctestvmlv1eo" (Resource Group "acctestRG-201114233915712563"): compute.VirtualMachinesClient#Update: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The property 'windowsConfiguration.patchSettings.patchMode' is not valid because the 'Microsoft.Compute/InGuestAutoPatchVMPreview' feature is not enabled for this subscription." Target="windowsConfiguration.patchSettings.patchMode"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh...yeah I will update the doc to include the enabling process for this. Thanks

@ArcturusZhang
Copy link
Contributor Author

Hi @katbyte I have add a comment in the schema and a NOTE in the doc on how to enable this preview feature.
Could you also run this command in your testing subscriptions to ensure we could run those tests properly as well?

az feature register -n InGuestAutoPatchVMPreview --namespace Microsoft.Compute

@tombuildsstuff
Copy link
Member

@ArcturusZhang is this also applicable for Linux VM's?

@ArcturusZhang
Copy link
Contributor Author

@ArcturusZhang is this also applicable for Linux VM's?

Well, no, this is only applicable for windows operating systems

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 @ArcturusZhang - LGTM 👍

@katbyte katbyte added this to the v2.37.0 milestone Nov 17, 2020
@katbyte katbyte merged commit 4c465da into hashicorp:master Nov 17, 2020
katbyte added a commit that referenced this pull request Nov 17, 2020
@ArcturusZhang ArcturusZhang deleted the virtual-machine-windows-patch-mode branch November 17, 2020 10:44
@ghost
Copy link

ghost commented Nov 20, 2020

This has been released in version 2.37.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.37.0"
}
# ... other configuration ...

@delampri
Copy link

This feature is still in preview, so it failed on every subscription which did not enable it explicity.
please add a feature_flag so it won't fail with the following error:

compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The property 'windowsConfiguration.patchSettings.patchMode' is not valid because the 'Microsoft.Compute/InGuestAutoPatchVMPreview' feature is not enabled for this subscription." Target="windowsConfiguration.patchSettings.patchMode"

@tombuildsstuff
Copy link
Member

@ArcturusZhang based on the comment above, would you mind sending a PR to conditionally set this functionality?

@ghost
Copy link

ghost commented Dec 17, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked as resolved and limited conversation to collaborators Dec 17, 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.

None yet

4 participants