Skip to content

Commit

Permalink
GuestPatching: Adding AutomaticByPlatformSettings (in VMSS and VM mod…
Browse files Browse the repository at this point in the history
…el) and useRollingUpgradePolicy (in VMSS model) properties (#18581)

* GuestPatching: Adding AutomaticByPlatofrmSettings within Linux and Windows Patch settings for VM and VMSS model

* Updating examples related to AutomaticByPlatformSettings property in PatchSettings for VM and VMSS model

* Adding useRollingUpgradePolicy property to automaticOSUpgradePolicy for VMSS and other minor changes for AutomaticByPlatfrom settings

* Addressing PR feedback

* Addressing PR feedback #2

* Renaming reboot reference for windows and linux automaticbyplatform patch settings - reboot settings

* Resolving errors reported on the PR by Avocado and LintDiff
  • Loading branch information
rane-rajasi authored Apr 21, 2022
1 parent 93665b8 commit 527cdde
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,10 @@
"name": "WindowsPatchAssessmentMode",
"modelAsString": true
}
},
"automaticByPlatformSettings": {
"$ref": "#/definitions/WindowsVMGuestPatchAutomaticByPlatformSettings",
"description": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows."
}
},
"description": "Specifies settings related to VM Guest Patching on Windows."
Expand Down Expand Up @@ -1806,9 +1810,53 @@
"name": "LinuxPatchAssessmentMode",
"modelAsString": true
}
},
"automaticByPlatformSettings": {
"$ref": "#/definitions/LinuxVMGuestPatchAutomaticByPlatformSettings",
"description": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux."
}
},
"description": "Specifies settings related to VM Guest Patching on Linux."
},
"WindowsVMGuestPatchAutomaticByPlatformSettings": {
"type": "object",
"properties": {
"rebootSetting": {
"type": "string",
"description": "Specifies the reboot setting for all AutomaticByPlatform patch installation operations.",
"enum": [
"Unknown",
"IfRequired",
"Never",
"Always"
],
"x-ms-enum": {
"name": "WindowsVMGuestPatchAutomaticByPlatformRebootSetting",
"modelAsString": true
}
}
},
"description": "Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Windows patch settings."
},
"LinuxVMGuestPatchAutomaticByPlatformSettings": {
"type": "object",
"properties": {
"rebootSetting": {
"type": "string",
"description": "Specifies the reboot setting for all AutomaticByPlatform patch installation operations.",
"enum": [
"Unknown",
"IfRequired",
"Never",
"Always"
],
"x-ms-enum": {
"name": "LinuxVMGuestPatchAutomaticByPlatformRebootSetting",
"modelAsString": true
}
}
},
"description": "Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Linux patch settings."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"vmName": "myVM",
"api-version": "2022-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",
"automaticByPlatformSettings": {
"rebootSetting": "Never"
}
}
}
},
"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",
"automaticByPlatformSettings": {
"rebootSetting": "Never"
}
}
}
},
"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",
"automaticByPlatformSettings": {
"rebootSetting": "Never"
}
}
}
},
"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"
}
}
}
}
Loading

0 comments on commit 527cdde

Please sign in to comment.