Skip to content

Commit 9885164

Browse files
authored
Merge pull request #246763 from dramasamy/vm-arm-bicep
VM ARM and Bicep QuickStart
2 parents dbe39dd + 43187b3 commit 9885164

13 files changed

+495
-15
lines changed

.openpublishing.redirection.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24513,7 +24513,17 @@
2451324513
},
2451424514
{
2451524515
"source_path_from_root": "/articles/operator-nexus/template-virtualized-network-function-deployment.md",
24516-
"redirect_url": "/azure/operator-nexus/quickstarts-tenant-workload-deployment",
24516+
"redirect_url": "/azure/operator-nexus/quickstarts-virtual-machine-deployment-cli",
24517+
"redirect_document_id": false
24518+
},
24519+
{
24520+
"source_path_from_root": "/articles/operator-nexus/quickstarts-tenant-workload-deployment.md",
24521+
"redirect_url": "/azure/operator-nexus/quickstarts-virtual-machine-deployment-cli",
24522+
"redirect_document_id": false
24523+
},
24524+
{
24525+
"source_path_from_root": "/articles/operator-nexus/quickstarts-tenant-workload-deployment-ps.md",
24526+
"redirect_url": "/azure/operator-nexus/quickstarts-virtual-machine-deployment-ps",
2451724527
"redirect_document_id": false
2451824528
},
2451924529
{

articles/operator-nexus/TOC.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@
4040
expanded: true
4141
items:
4242
- name: Use the Azure CLI
43-
href: quickstarts-tenant-workload-deployment.md
43+
href: quickstarts-virtual-machine-deployment-cli.md
44+
- name: Use ARM template
45+
href: quickstarts-virtual-machine-deployment-arm.md
46+
- name: Use Bicep file
47+
href: quickstarts-virtual-machine-deployment-bicep.md
4448
- name: Use Azure PowerShell
45-
href: quickstarts-tenant-workload-deployment-ps.md
49+
href: quickstarts-virtual-machine-deployment-ps.md
4650
- name: How-To Guides
4751
items:
4852
- name: Operator Nexus Instance Deployment and Upgrade

articles/operator-nexus/howto-virtual-machine-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ After executing the script, you'll have a VM image tailored for your Virtual Net
240240

241241
## Next steps
242242

243-
Refer to the [QuickStart guide](./quickstarts-tenant-workload-deployment.md) to deploy a VNF using the image you created.
243+
Refer to the [QuickStart guide](./quickstarts-virtual-machine-deployment-cli.md) to deploy a VNF using the image you created.
244244

245245
<!-- LINKS - internal -->
246246
[kubernetes-concepts]: ../../../aks/concepts-clusters-workloads.md

articles/operator-nexus/howto-virtual-machine-placement-hints.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can increase the overall resilience of your application by using anti-affini
1919

2020
## Prerequisites
2121

22-
Before proceeding with this how-to guide, ensure you have completed all steps in the Azure Operator Nexus virtual machine [QuickStart guide](./quickstarts-tenant-workload-deployment.md).
22+
Before proceeding with this how-to guide, ensure you have completed all steps in the Azure Operator Nexus virtual machine [QuickStart guide](./quickstarts-virtual-machine-deployment-cli.md).
2323

2424

2525
## Placement hints configuration
@@ -53,7 +53,7 @@ The `resourceId` argument in placement hints specifies the target object against
5353
* A Rack: If the target object is a rack, the placement hint is checked against all the bare-metal machines running on that rack.
5454

5555
> [!IMPORTANT]
56-
> The resourceId argument must be specified in the form of an ARM ID, and it must be a valid resource ID for the target object. If the resourceId is incorrect or invalid, the placement hint will not work correctly, and the VM scheduling may fail.
56+
> The resourceId argument must be specified in the form of an ARM ID, and it must be a valid resource ID for the target object. If the resourceId is incorrect or invalid, the placement hint will not work correctly, and the VM scheduling might fail.
5757
5858
### Scope
5959

@@ -114,7 +114,7 @@ The schedulingExecution argument has two possible values: `Hard` or `Soft`.
114114
In this example, we explore the concepts of soft and hard affinities, particularly about placing virtual machines on specific racks.
115115

116116
> [!NOTE]
117-
> In this and the following examples, only variations of the `--placement-hints` argument are provided. For the actual creation of the VM with placement hints, you should add `--placement-hints` to the CLI illustrated in the VM [QuickStart guide](./quickstarts-tenant-workload-deployment.md).
117+
> In this and the following examples, only variations of the `--placement-hints` argument are provided. For the actual creation of the VM with placement hints, you should add `--placement-hints` to the CLI illustrated in the VM [QuickStart guide](./quickstarts-virtual-machine-deployment-cli.md).
118118

119119
#### Strict scheduling (rack affinity)
120120

@@ -125,7 +125,7 @@ This placement hint uses the `Affinity` hintType to ensure that the virtual mach
125125
```
126126

127127
> [!NOTE]
128-
> The current placement hint configuration with the Affinity hintType ensures that the virtual machine is scheduled exclusively on the specified rack with the provided rack ID. However, it's important to note that the rack affinity cannot be specified for more than one rack with `Hard` scheduling execution. This limitation may influence your deployment strategy, particularly if you are considering placing VMs on multiple racks and allowing the scheduler to select from them.
128+
> The current placement hint configuration with the Affinity hintType ensures that the virtual machine is scheduled exclusively on the specified rack with the provided rack ID. However, it's important to note that the rack affinity cannot be specified for more than one rack with `Hard` scheduling execution. This limitation might influence your deployment strategy, particularly if you are considering placing VMs on multiple racks and allowing the scheduler to select from them.
129129
130130
#### Preferred scheduling (rack affinity)
131131
@@ -141,7 +141,7 @@ In this example, we explore the concepts of soft and hard anti-affinities, parti
141141

142142
#### Strict scheduling (rack anti-affinity)
143143

144-
This placement hint uses both the `AntiAffinity` hintType and `Hard` schedulingExecution to prevent the virtual machine from being scheduled on the specified rack identified by the rack ID. In this configuration, the scheduler strictly follows these placement hints. However, if the rack ID is incorrect or there's not enough capacity on other racks, the VM placement may fail due to the strict application of the `Hard` scheduling rule
144+
This placement hint uses both the `AntiAffinity` hintType and `Hard` schedulingExecution to prevent the virtual machine from being scheduled on the specified rack identified by the rack ID. In this configuration, the scheduler strictly follows these placement hints. However, if the rack ID is incorrect or there's not enough capacity on other racks, the VM placement might fail due to the strict application of the `Hard` scheduling rule
145145
146146
```bash
147147
--placement-hints '[{"hintType":"AntiAffinity","resourceId":"/subscriptions/<subscription>/resourceGroups/<managed-resource-group>/providers/Microsoft.NetworkCloud/racks/<compute-rack-2>","schedulingExecution":"Hard","scope":"Rack"}]'
@@ -228,7 +228,7 @@ In this example, we explore the concepts of soft and hard anti-affinities, parti
228228

229229
#### Strict scheduling (bare-metal machine anti-affinity)
230230

231-
This placement hint uses both the `AntiAffinity` hintType and `Hard` schedulingExecution to prevent the virtual machine from being scheduled on the specified bare-metal machine identified by the bare-metal machine ID. In this configuration, the scheduler strictly follows these placement hints. However, if the bare-metal machine ID is incorrect or there's not enough capacity on other bare-metal machines, the VM placement may fail due to the strict application of the `Hard` scheduling rule
231+
This placement hint uses both the `AntiAffinity` hintType and `Hard` schedulingExecution to prevent the virtual machine from being scheduled on the specified bare-metal machine identified by the bare-metal machine ID. In this configuration, the scheduler strictly follows these placement hints. However, if the bare-metal machine ID is incorrect or there's not enough capacity on other bare-metal machines, the VM placement might fail due to the strict application of the `Hard` scheduling rule
232232
233233
```bash
234234
--placement-hints '[{"hintType":"AntiAffinity","resourceId":"/subscriptions/<subscription>/resourceGroups/<managed-resource-group>/providers/Microsoft.NetworkCloud/bareMetalMachines/<machine-name>","schedulingExecution":"Hard","scope":"Machine"}]'

articles/operator-nexus/includes/virtual-machine/quickstart-review-deployment-cli.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ To view the details of the ```myNexusVirtualMachine``` cluster in the ```myResou
1313
### [Azure CLI](#tab/azure-cli)
1414

1515
```azurecli-interactive
16-
az networkcloud virtualmachine show \
17-
--name myNexusVirtualMachine \
18-
--resource-group myResourceGroup
16+
az networkcloud virtualmachine show --name myNexusVirtualMachine --resource-group myResourceGroup
1917
```
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"vmName": {
6+
"type": "string",
7+
"metadata": {
8+
"description": "The name of Nexus virtual machine"
9+
}
10+
},
11+
"location": {
12+
"type": "string",
13+
"metadata": {
14+
"description": "The Azure region where the VM is to be deployed"
15+
},
16+
"defaultValue": "[resourceGroup().location]"
17+
},
18+
"extendedLocation": {
19+
"type": "string",
20+
"metadata": {
21+
"description": "The custom location of the Nexus instance"
22+
}
23+
},
24+
"tags": {
25+
"type": "object",
26+
"metadata": {
27+
"description": "The metadata tags to be associated with the cluster resource"
28+
},
29+
"defaultValue": {}
30+
},
31+
"adminUsername": {
32+
"type": "string",
33+
"defaultValue": "azureuser",
34+
"maxLength": 32,
35+
"minLength": 1,
36+
"metadata": {
37+
"description": "The name of the administrator to which the ssh public keys will be added into the authorized keys."
38+
}
39+
},
40+
"bootMethod": {
41+
"type": "string",
42+
"defaultValue": "UEFI",
43+
"allowedValues": ["UEFI", "BIOS"],
44+
"metadata": {
45+
"description": "Selects the boot method for the virtual machine."
46+
}
47+
},
48+
"cloudServicesNetworkId": {
49+
"type": "string",
50+
"metadata": {
51+
"description": "The Cloud Services Network attachment ARM ID to attach to virtual machine."
52+
}
53+
},
54+
"cpuCores": {
55+
"type": "int",
56+
"defaultValue": 2,
57+
"metadata": {
58+
"description": "Number of CPU cores for the virtual machine. Choose a value between 2 and 46."
59+
}
60+
},
61+
"memorySizeGB": {
62+
"type": "int",
63+
"defaultValue": 4,
64+
"metadata": {
65+
"description": "The memory size of the virtual machine in GB (max 224 GB)"
66+
}
67+
},
68+
"networkAttachments": {
69+
"type": "array",
70+
"metadata": {
71+
"description": "The list of network attachments to the virtual machine."
72+
}
73+
/*
74+
{
75+
"attachedNetworkId": "string",
76+
"defaultGateway": "True"/"False",
77+
"ipAllocationMethod": "Dynamic"/"Static"/"Disabled",
78+
"ipv4Address": "string",
79+
"ipv6Address": "string",
80+
"networkAttachmentName": "string"
81+
}
82+
*/
83+
},
84+
"networkData": {
85+
"type": "string",
86+
"metadata": {
87+
"description": "The Base64 encoded cloud-init network data."
88+
},
89+
"defaultValue": ""
90+
},
91+
"placementHints": {
92+
"type": "array",
93+
"metadata": {
94+
"description": "The placement hints for the virtual machine."
95+
},
96+
"defaultValue": []
97+
/*
98+
{
99+
"hintType": "Affinity",
100+
"resourceId": "string",
101+
"schedulingExecution": "Hard",
102+
"scope": "Rack"
103+
}
104+
*/
105+
},
106+
"sshPublicKeys": {
107+
"type": "array",
108+
"metadata": {
109+
"description": "The list of SSH public keys for the virtual machine."
110+
}
111+
/*
112+
{
113+
"keyData": "string"
114+
}
115+
*/
116+
},
117+
"storageProfile": {
118+
"type": "object",
119+
"metadata": {
120+
"description": "StorageProfile represents information about a disk."
121+
},
122+
"defaultValue": {
123+
"osDisk": {
124+
"createOption": "Ephemeral",
125+
"deleteOption": "Delete",
126+
"diskSizeGB": 64
127+
}
128+
}
129+
},
130+
"userData": {
131+
"type": "string",
132+
"metadata": {
133+
"description": "The Base64 encoded cloud-init user data."
134+
},
135+
"defaultValue": ""
136+
},
137+
"vmDeviceModel": {
138+
"type": "string",
139+
"defaultValue": "T2",
140+
"allowedValues": ["T1", "T2"],
141+
"metadata": {
142+
"description": "The type of the device model to use."
143+
}
144+
},
145+
"vmImage": {
146+
"type": "string",
147+
"metadata": {
148+
"description": "The virtual machine image that is currently provisioned to the OS disk, using the full URL and tag notation used to pull the image."
149+
}
150+
},
151+
"vmImageRepositoryCredentials": {
152+
"type": "object",
153+
"metadata": {
154+
"description": "Credentials used to login to the image repository."
155+
}
156+
/*
157+
"password": "string",
158+
"registryUrl": "string",
159+
"username": "string"
160+
*/
161+
}
162+
},
163+
"resources": [
164+
{
165+
"type": "Microsoft.NetworkCloud/virtualMachines",
166+
"apiVersion": "2023-07-01",
167+
"name": "[parameters('vmName')]",
168+
"location": "[parameters('location')]",
169+
"extendedLocation": {
170+
"type": "CustomLocation",
171+
"name": "[parameters('extendedLocation')]"
172+
},
173+
"tags": "[parameters('tags')]",
174+
"properties": {
175+
"adminUsername": "[if(empty(parameters('adminUsername')), json('null'), parameters('adminUsername'))]",
176+
"bootMethod": "[if(empty(parameters('bootMethod')), json('null'), parameters('bootMethod'))]",
177+
"cloudServicesNetworkAttachment": {
178+
"attachedNetworkId": "[parameters('cloudServicesNetworkId')]",
179+
"defaultGateway": "False",
180+
"ipAllocationMethod": "Dynamic"
181+
},
182+
"cpuCores": "[parameters('cpuCores')]",
183+
"memorySizeGB": "[parameters('memorySizeGB')]",
184+
"networkData": "[if(empty(parameters('networkData')), json('null'), parameters('networkData'))]",
185+
"networkAttachments": "[if(empty(parameters('networkAttachments')), json('null'), parameters('networkAttachments'))]",
186+
"placementHints": "[if(empty(parameters('placementHints')), json('null'), parameters('placementHints'))]",
187+
"sshPublicKeys": "[if(empty(parameters('sshPublicKeys')), json('null'), parameters('sshPublicKeys'))]",
188+
"storageProfile": "[if(empty(parameters('storageProfile')), json('null'), parameters('storageProfile'))]",
189+
"userData": "[if(empty(parameters('userData')), json('null'), parameters('userData'))]",
190+
"vmDeviceModel": "[if(empty(parameters('vmDeviceModel')), json('null'), parameters('vmDeviceModel'))]",
191+
"vmImage": "[if(empty(parameters('vmImage')), json('null'), parameters('vmImage'))]",
192+
"vmImageRepositoryCredentials": "[if(empty(parameters('vmImageRepositoryCredentials')), json('null'), parameters('vmImageRepositoryCredentials'))]"
193+
}
194+
}
195+
]
196+
}

0 commit comments

Comments
 (0)