Skip to content

Commit 527cdde

Browse files
authored
GuestPatching: Adding AutomaticByPlatformSettings (in VMSS and VM model) 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
1 parent 93665b8 commit 527cdde

File tree

7 files changed

+425
-6
lines changed

7 files changed

+425
-6
lines changed

specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/computeRPCommon.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,10 @@
17771777
"name": "WindowsPatchAssessmentMode",
17781778
"modelAsString": true
17791779
}
1780+
},
1781+
"automaticByPlatformSettings": {
1782+
"$ref": "#/definitions/WindowsVMGuestPatchAutomaticByPlatformSettings",
1783+
"description": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows."
17801784
}
17811785
},
17821786
"description": "Specifies settings related to VM Guest Patching on Windows."
@@ -1806,9 +1810,53 @@
18061810
"name": "LinuxPatchAssessmentMode",
18071811
"modelAsString": true
18081812
}
1813+
},
1814+
"automaticByPlatformSettings": {
1815+
"$ref": "#/definitions/LinuxVMGuestPatchAutomaticByPlatformSettings",
1816+
"description": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux."
18091817
}
18101818
},
18111819
"description": "Specifies settings related to VM Guest Patching on Linux."
1820+
},
1821+
"WindowsVMGuestPatchAutomaticByPlatformSettings": {
1822+
"type": "object",
1823+
"properties": {
1824+
"rebootSetting": {
1825+
"type": "string",
1826+
"description": "Specifies the reboot setting for all AutomaticByPlatform patch installation operations.",
1827+
"enum": [
1828+
"Unknown",
1829+
"IfRequired",
1830+
"Never",
1831+
"Always"
1832+
],
1833+
"x-ms-enum": {
1834+
"name": "WindowsVMGuestPatchAutomaticByPlatformRebootSetting",
1835+
"modelAsString": true
1836+
}
1837+
}
1838+
},
1839+
"description": "Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Windows patch settings."
1840+
},
1841+
"LinuxVMGuestPatchAutomaticByPlatformSettings": {
1842+
"type": "object",
1843+
"properties": {
1844+
"rebootSetting": {
1845+
"type": "string",
1846+
"description": "Specifies the reboot setting for all AutomaticByPlatform patch installation operations.",
1847+
"enum": [
1848+
"Unknown",
1849+
"IfRequired",
1850+
"Never",
1851+
"Always"
1852+
],
1853+
"x-ms-enum": {
1854+
"name": "LinuxVMGuestPatchAutomaticByPlatformRebootSetting",
1855+
"modelAsString": true
1856+
}
1857+
}
1858+
},
1859+
"description": "Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Linux patch settings."
18121860
}
18131861
}
18141862
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"vmName": "myVM",
6+
"api-version": "2022-03-01",
7+
"parameters": {
8+
"location": "westus",
9+
"properties": {
10+
"hardwareProfile": {
11+
"vmSize": "Standard_D2s_v3"
12+
},
13+
"storageProfile": {
14+
"imageReference": {
15+
"sku": "16.04-LTS",
16+
"publisher": "Canonical",
17+
"version": "latest",
18+
"offer": "UbuntuServer"
19+
},
20+
"osDisk": {
21+
"caching": "ReadWrite",
22+
"managedDisk": {
23+
"storageAccountType": "Premium_LRS"
24+
},
25+
"name": "myVMosdisk",
26+
"createOption": "FromImage"
27+
}
28+
},
29+
"osProfile": {
30+
"adminUsername": "{your-username}",
31+
"computerName": "myVM",
32+
"adminPassword": "{your-password}",
33+
"linuxConfiguration": {
34+
"provisionVMAgent": true,
35+
"patchSettings": {
36+
"patchMode": "AutomaticByPlatform",
37+
"assessmentMode": "AutomaticByPlatform",
38+
"automaticByPlatformSettings": {
39+
"rebootSetting": "Never"
40+
}
41+
}
42+
}
43+
},
44+
"networkProfile": {
45+
"networkInterfaces": [
46+
{
47+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
48+
"properties": {
49+
"primary": true
50+
}
51+
}
52+
]
53+
}
54+
}
55+
}
56+
},
57+
"responses": {
58+
"200": {
59+
"body": {
60+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
61+
"type": "Microsoft.Compute/virtualMachines",
62+
"properties": {
63+
"osProfile": {
64+
"adminUsername": "{your-username}",
65+
"secrets": [],
66+
"computerName": "myVM",
67+
"linuxConfiguration": {
68+
"provisionVMAgent": true,
69+
"patchSettings": {
70+
"patchMode": "AutomaticByPlatform",
71+
"assessmentMode": "AutomaticByPlatform",
72+
"automaticByPlatformSettings": {
73+
"rebootSetting": "Never"
74+
}
75+
}
76+
}
77+
},
78+
"networkProfile": {
79+
"networkInterfaces": [
80+
{
81+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
82+
"properties": {
83+
"primary": true
84+
}
85+
}
86+
]
87+
},
88+
"storageProfile": {
89+
"imageReference": {
90+
"sku": "16.04-LTS",
91+
"publisher": "Canonical",
92+
"version": "latest",
93+
"offer": "UbuntuServer"
94+
},
95+
"osDisk": {
96+
"osType": "Linux",
97+
"caching": "ReadWrite",
98+
"createOption": "FromImage",
99+
"name": "myVMosdisk",
100+
"managedDisk": {
101+
"storageAccountType": "Premium_LRS"
102+
}
103+
},
104+
"dataDisks": []
105+
},
106+
"vmId": "a149cd25-409f-41af-8088-275f5486bc93",
107+
"hardwareProfile": {
108+
"vmSize": "Standard_D2s_v3"
109+
},
110+
"provisioningState": "Creating"
111+
},
112+
"name": "myVM",
113+
"location": "westus"
114+
}
115+
},
116+
"201": {
117+
"body": {
118+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
119+
"type": "Microsoft.Compute/virtualMachines",
120+
"properties": {
121+
"osProfile": {
122+
"adminUsername": "{your-username}",
123+
"secrets": [],
124+
"computerName": "myVM",
125+
"linuxConfiguration": {
126+
"provisionVMAgent": true,
127+
"patchSettings": {
128+
"patchMode": "AutomaticByPlatform",
129+
"assessmentMode": "AutomaticByPlatform",
130+
"automaticByPlatformSettings": {
131+
"rebootSetting": "Never"
132+
}
133+
}
134+
}
135+
},
136+
"networkProfile": {
137+
"networkInterfaces": [
138+
{
139+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
140+
"properties": {
141+
"primary": true
142+
}
143+
}
144+
]
145+
},
146+
"storageProfile": {
147+
"imageReference": {
148+
"sku": "16.04-LTS",
149+
"publisher": "Canonical",
150+
"version": "latest",
151+
"offer": "UbuntuServer"
152+
},
153+
"osDisk": {
154+
"osType": "Linux",
155+
"caching": "ReadWrite",
156+
"createOption": "FromImage",
157+
"name": "myVMosdisk",
158+
"managedDisk": {
159+
"storageAccountType": "Premium_LRS"
160+
}
161+
},
162+
"dataDisks": []
163+
},
164+
"vmId": "a149cd25-409f-41af-8088-275f5486bc93",
165+
"hardwareProfile": {
166+
"vmSize": "Standard_D2s_v3"
167+
},
168+
"provisioningState": "Creating"
169+
},
170+
"name": "myVM",
171+
"location": "westus"
172+
}
173+
}
174+
}
175+
}

0 commit comments

Comments
 (0)