Skip to content

Commit e4fc567

Browse files
committed
GuestPatching: Adding AutomaticByPlatofrmSettings within Linux and Windows Patch settings for VM and VMSS model
1 parent 50d1185 commit e4fc567

File tree

4 files changed

+390
-2
lines changed

4 files changed

+390
-2
lines changed

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,10 @@
17691769
"name": "WindowsPatchAssessmentMode",
17701770
"modelAsString": true
17711771
}
1772+
},
1773+
"automaticByPlatformSettings": {
1774+
"$ref": "#/definitions/WindowsAutomaticByPatchSettings",
1775+
"description": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows."
17721776
}
17731777
},
17741778
"description": "Specifies settings related to VM Guest Patching on Windows."
@@ -1798,9 +1802,49 @@
17981802
"name": "LinuxPatchAssessmentMode",
17991803
"modelAsString": true
18001804
}
1805+
},
1806+
"automaticByPlatformSettings": {
1807+
"$ref": "#/definitions/LinuxAutomaticByPatchSettings",
1808+
"description": "Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux."
18011809
}
18021810
},
18031811
"description": "Specifies settings related to VM Guest Patching on Linux."
1812+
},
1813+
"WindowsAutomaticByPatchSettings": {
1814+
"properties": {
1815+
"rebootSetting": {
1816+
"type": "string",
1817+
"description": "Specifies reboot setting for all AutomaticByPlatform patch installation operations.",
1818+
"enum": [
1819+
"Unknown",
1820+
"IfRequired",
1821+
"Never",
1822+
"Always"
1823+
],
1824+
"x-ms-enum": {
1825+
"name": "WindowsVMGuestPatchRebootSetting",
1826+
"modelAsString": true
1827+
}
1828+
}
1829+
}
1830+
},
1831+
"LinuxAutomaticByPatchSettings": {
1832+
"properties": {
1833+
"rebootSetting": {
1834+
"type": "string",
1835+
"description": "Specifies reboot setting for all AutomaticByPlatform patch installation operations.",
1836+
"enum": [
1837+
"Unknown",
1838+
"IfRequired",
1839+
"Never",
1840+
"Always"
1841+
],
1842+
"x-ms-enum": {
1843+
"name": "LinuxVMGuestPatchRebootSetting",
1844+
"modelAsString": true
1845+
}
1846+
}
1847+
}
18041848
}
18051849
}
18061850
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
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+
}
73+
}
74+
},
75+
"networkProfile": {
76+
"networkInterfaces": [
77+
{
78+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
79+
"properties": {
80+
"primary": true
81+
}
82+
}
83+
]
84+
},
85+
"storageProfile": {
86+
"imageReference": {
87+
"sku": "16.04-LTS",
88+
"publisher": "Canonical",
89+
"version": "latest",
90+
"offer": "UbuntuServer"
91+
},
92+
"osDisk": {
93+
"osType": "Linux",
94+
"caching": "ReadWrite",
95+
"createOption": "FromImage",
96+
"name": "myVMosdisk",
97+
"managedDisk": {
98+
"storageAccountType": "Premium_LRS"
99+
}
100+
},
101+
"dataDisks": []
102+
},
103+
"vmId": "a149cd25-409f-41af-8088-275f5486bc93",
104+
"hardwareProfile": {
105+
"vmSize": "Standard_D2s_v3"
106+
},
107+
"provisioningState": "Creating"
108+
},
109+
"name": "myVM",
110+
"location": "westus"
111+
}
112+
},
113+
"201": {
114+
"body": {
115+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
116+
"type": "Microsoft.Compute/virtualMachines",
117+
"properties": {
118+
"osProfile": {
119+
"adminUsername": "{your-username}",
120+
"secrets": [],
121+
"computerName": "myVM",
122+
"linuxConfiguration": {
123+
"provisionVMAgent": true,
124+
"patchSettings": {
125+
"patchMode": "AutomaticByPlatform",
126+
"assessmentMode": "AutomaticByPlatform"
127+
}
128+
}
129+
},
130+
"networkProfile": {
131+
"networkInterfaces": [
132+
{
133+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
134+
"properties": {
135+
"primary": true
136+
}
137+
}
138+
]
139+
},
140+
"storageProfile": {
141+
"imageReference": {
142+
"sku": "16.04-LTS",
143+
"publisher": "Canonical",
144+
"version": "latest",
145+
"offer": "UbuntuServer"
146+
},
147+
"osDisk": {
148+
"osType": "Linux",
149+
"caching": "ReadWrite",
150+
"createOption": "FromImage",
151+
"name": "myVMosdisk",
152+
"managedDisk": {
153+
"storageAccountType": "Premium_LRS"
154+
}
155+
},
156+
"dataDisks": []
157+
},
158+
"vmId": "a149cd25-409f-41af-8088-275f5486bc93",
159+
"hardwareProfile": {
160+
"vmSize": "Standard_D2s_v3"
161+
},
162+
"provisioningState": "Creating"
163+
},
164+
"name": "myVM",
165+
"location": "westus"
166+
}
167+
}
168+
}
169+
}

0 commit comments

Comments
 (0)