Skip to content

Commit

Permalink
PatchSetting Assessment Mode Windows + Linux (#14234)
Browse files Browse the repository at this point in the history
* PatchSetting assessment feature

* PatchSetting assessment feature cleanup

* Patchsetting example

* Patchsetting example 2

* Patchsetting example 3

* Patchsetting example 4

* Patchsetting example 5
  • Loading branch information
Sandido authored May 4, 2021
1 parent 4893282 commit cc3bea0
Show file tree
Hide file tree
Showing 6 changed files with 382 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3091,21 +3091,27 @@
"Create a Windows vm with a patch setting patchMode of AutomaticByOS.": {
"$ref": "./examples/CreateAWindowsVmWithPatchSettingModeOfAutomaticByOS.json"
},
"Create a Windows vm with a patch setting patchMode of AutomaticByPlatform.": {
"$ref": "./examples/CreateAWindowsVmWithPatchSettingModeOfAutomaticByPlatform.json"
"Create a Windows vm with patch settings patchMode and assessmentMode set to AutomaticByPlatform.": {
"$ref": "./examples/CreateAWindowsVmWithPatchSettingModesOfAutomaticByPlatform.json"
},
"Create a Windows vm with a patch setting patchMode of Manual.": {
"$ref": "./examples/CreateAWindowsVmWithPatchSettingModeOfManual.json"
},
"Create a Windows vm with a patch setting assessmentMode of ImageDefault.": {
"$ref": "./examples/CreateAWindowsVmWithPatchSettingAssessmentModeOfImageDefault.json"
},
"Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set to true.": {
"$ref": "./examples/CreateAWindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json"
},
"Create a Linux vm with a patch setting patchMode of AutomaticByPlatform.": {
"$ref": "./examples/CreateALinuxVmWithPatchSettingModeOfAutomaticByPlatform.json"
"Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform.": {
"$ref": "./examples/CreateALinuxVmWithPatchSettingModesOfAutomaticByPlatform.json"
},
"Create a Linux vm with a patch setting patchMode of ImageDefault.": {
"$ref": "./examples/CreateALinuxVmWithPatchSettingModeOfImageDefault.json"
},
"Create a Linux vm with a patch setting assessmentMode of ImageDefault.": {
"$ref": "./examples/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json"
},
"Create a vm with an extensions time budget.": {
"$ref": "./examples/CreateAVmWithExtensionsTimeBudget.json"
},
Expand Down Expand Up @@ -12578,6 +12584,18 @@
"enableHotpatching": {
"type": "boolean",
"description": "Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'."
},
"assessmentMode": {
"type": "string",
"description": "Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. ",
"enum": [
"ImageDefault",
"AutomaticByPlatform"
],
"x-ms-enum": {
"name": "WindowsPatchAssessmentMode",
"modelAsString": true
}
}
},
"description": "Specifies settings related to VM Guest Patching on Windows."
Expand All @@ -12595,6 +12613,18 @@
"name": "LinuxVMGuestPatchMode",
"modelAsString": true
}
},
"assessmentMode": {
"type": "string",
"description": "Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.",
"enum": [
"ImageDefault",
"AutomaticByPlatform"
],
"x-ms-enum": {
"name": "LinuxPatchAssessmentMode",
"modelAsString": true
}
}
},
"description": "Specifies settings related to VM Guest Patching on Linux."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"linuxConfiguration": {
"provisionVMAgent": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform"
"assessmentMode": "ImageDefault"
}
}
},
Expand Down Expand Up @@ -63,7 +63,7 @@
"linuxConfiguration": {
"provisionVMAgent": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform"
"assessmentMode": "ImageDefault"
}
}
},
Expand Down Expand Up @@ -117,7 +117,7 @@
"linuxConfiguration": {
"provisionVMAgent": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform"
"assessmentMode": "ImageDefault"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"vmName": "myVM",
"api-version": "2021-03-01",
"parameters": {
"location": "westus",
"properties": {
"hardwareProfile": {
"vmSize": "Standard_D2s_v3"
},
"storageProfile": {
"imageReference": {
"sku": "16.04-LTS",
"publisher": "Canonical",
"version": "latest",
"offer": "UbuntuServer"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Premium_LRS"
},
"name": "myVMosdisk",
"createOption": "FromImage"
}
},
"osProfile": {
"adminUsername": "{your-username}",
"computerName": "myVM",
"adminPassword": "{your-password}",
"linuxConfiguration": {
"provisionVMAgent": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform",
"assessmentMode": "AutomaticByPlatform"
}
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
"properties": {
"primary": true
}
}
]
}
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
"type": "Microsoft.Compute/virtualMachines",
"properties": {
"osProfile": {
"adminUsername": "{your-username}",
"secrets": [],
"computerName": "myVM",
"linuxConfiguration": {
"provisionVMAgent": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform",
"assessmentMode": "AutomaticByPlatform"
}
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
"properties": {
"primary": true
}
}
]
},
"storageProfile": {
"imageReference": {
"sku": "16.04-LTS",
"publisher": "Canonical",
"version": "latest",
"offer": "UbuntuServer"
},
"osDisk": {
"osType": "Linux",
"caching": "ReadWrite",
"createOption": "FromImage",
"name": "myVMosdisk",
"managedDisk": {
"storageAccountType": "Premium_LRS"
}
},
"dataDisks": []
},
"vmId": "a149cd25-409f-41af-8088-275f5486bc93",
"hardwareProfile": {
"vmSize": "Standard_D2s_v3"
},
"provisioningState": "Creating"
},
"name": "myVM",
"location": "westus"
}
},
"201": {
"body": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
"type": "Microsoft.Compute/virtualMachines",
"properties": {
"osProfile": {
"adminUsername": "{your-username}",
"secrets": [],
"computerName": "myVM",
"linuxConfiguration": {
"provisionVMAgent": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform",
"assessmentMode": "AutomaticByPlatform"
}
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
"properties": {
"primary": true
}
}
]
},
"storageProfile": {
"imageReference": {
"sku": "16.04-LTS",
"publisher": "Canonical",
"version": "latest",
"offer": "UbuntuServer"
},
"osDisk": {
"osType": "Linux",
"caching": "ReadWrite",
"createOption": "FromImage",
"name": "myVMosdisk",
"managedDisk": {
"storageAccountType": "Premium_LRS"
}
},
"dataDisks": []
},
"vmId": "a149cd25-409f-41af-8088-275f5486bc93",
"hardwareProfile": {
"vmSize": "Standard_D2s_v3"
},
"provisioningState": "Creating"
},
"name": "myVM",
"location": "westus"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"provisionVMAgent": true,
"enableAutomaticUpdates": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform"
"assessmentMode": "ImageDefault"
}
}
},
Expand Down Expand Up @@ -65,7 +65,7 @@
"provisionVMAgent": true,
"enableAutomaticUpdates": true,
"patchSettings": {
"patchMode": "AutomaticByPlatform"
"assessmentMode": "ImageDefault"
}
}
},
Expand Down Expand Up @@ -118,9 +118,9 @@
"computerName": "myVM",
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true,
"enableAutomaticUpdates": false,
"patchSettings": {
"patchMode": "AutomaticByPlatform"
"assessmentMode": "ImageDefault"
}
}
},
Expand Down
Loading

0 comments on commit cc3bea0

Please sign in to comment.