-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added anchored proximity placement group example * Yep, learning to run that dotnet test :) Co-authored-by: Trevor Cooper-Chadwick <[email protected]>
- Loading branch information
Showing
12 changed files
with
1,463 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
docs/examples/201/anchored-proximity-placement-group/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Anchored Proximity Placement Groups containing Availability Sets | ||
Why? Well It can be a requirement in HPC and SAP to use Proximity Groups to minimise latencies while at the same time we need to ensure the highest availability of resources within the target zone. The approach is outlined [here](https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/sap-proximity-placement-scenarios#combine-availability-sets-and-availability-zones-with-proximity-placement-groups) | ||
|
||
This exemplar uses [Bicep](https://github.com/Azure/bicep) to deploy the Azure resources in a manner that meets this requirement and has been tested with v0.2.3 (alpha). | ||
|
||
Just edit or supply parameters to override the defaults | ||
|
||
Deployment steps | ||
``` | ||
bicep build *.bicep | ||
az deployment sub create --template-file sub.json --location uksouth | ||
az deployment group create --resource-group rg-bicep --template-file main.json | ||
``` | ||
|
||
In this example Modules have been used to seperate out the definition of the network and virtual machine resources simplifying the main Bicep template but also enabling me to explore reusing the modules in other deployments |
90 changes: 90 additions & 0 deletions
90
docs/examples/201/anchored-proximity-placement-group/linux-vm-as.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
param location string = resourceGroup().location | ||
param adminSshKey string | ||
param availabilitySetId string | ||
param subnetId string | ||
param vmName string | ||
|
||
resource pip 'Microsoft.Network/publicIpAddresses@2020-05-01' = { | ||
name: '${vmName}-pip' | ||
location: location | ||
properties: { | ||
publicIPAllocationMethod: 'Static' | ||
} | ||
sku: { | ||
name: 'Standard' | ||
} | ||
zones: [ | ||
'1' | ||
] | ||
} | ||
|
||
resource nic 'Microsoft.Network/networkInterfaces@2020-05-01' = { | ||
name: '${vmName}-nic' | ||
location: location | ||
properties: { | ||
ipConfigurations: [ | ||
{ | ||
name: 'ipconfig' | ||
properties: { | ||
privateIPAllocationMethod: 'Dynamic' | ||
subnet: { | ||
id: subnetId | ||
} | ||
publicIPAddress: { | ||
id: pip.id | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
|
||
resource vm 'Microsoft.Compute/virtualMachines@2020-06-01' = { | ||
name: vmName | ||
location: location | ||
properties: { | ||
availabilitySet: { | ||
id: availabilitySetId | ||
} | ||
hardwareProfile: { | ||
vmSize: 'Standard_B4ms' | ||
} | ||
networkProfile: { | ||
networkInterfaces: [ | ||
{ | ||
id: nic.id | ||
} | ||
] | ||
} | ||
osProfile: { | ||
computerName: vmName | ||
adminUsername: 'vmadmin' | ||
linuxConfiguration: { | ||
disablePasswordAuthentication: true | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
path: '/home/vmadmin/.ssh/authorized_keys' | ||
keyData: adminSshKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
storageProfile: { | ||
imageReference: { | ||
publisher: 'OpenLogic' | ||
offer: 'CentOS' | ||
sku: '7.7' | ||
version: 'latest' | ||
} | ||
osDisk: { | ||
name: '${vmName}-os' | ||
createOption: 'FromImage' | ||
managedDisk: { | ||
storageAccountType: 'StandardSSD_LRS' | ||
} | ||
} | ||
} | ||
} | ||
} |
119 changes: 119 additions & 0 deletions
119
docs/examples/201/anchored-proximity-placement-group/linux-vm-as.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]" | ||
}, | ||
"adminSshKey": { | ||
"type": "string" | ||
}, | ||
"availabilitySetId": { | ||
"type": "string" | ||
}, | ||
"subnetId": { | ||
"type": "string" | ||
}, | ||
"vmName": { | ||
"type": "string" | ||
} | ||
}, | ||
"functions": [], | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Network/publicIPAddresses", | ||
"apiVersion": "2020-05-01", | ||
"name": "[format('{0}-pip', parameters('vmName'))]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"publicIPAllocationMethod": "Static" | ||
}, | ||
"sku": { | ||
"name": "Standard" | ||
}, | ||
"zones": [ | ||
"1" | ||
] | ||
}, | ||
{ | ||
"type": "Microsoft.Network/networkInterfaces", | ||
"apiVersion": "2020-05-01", | ||
"name": "[format('{0}-nic', parameters('vmName'))]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"ipConfigurations": [ | ||
{ | ||
"name": "ipconfig", | ||
"properties": { | ||
"privateIPAllocationMethod": "Dynamic", | ||
"subnet": { | ||
"id": "[parameters('subnetId')]" | ||
}, | ||
"publicIPAddress": { | ||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-pip', parameters('vmName')))]" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-pip', parameters('vmName')))]" | ||
] | ||
}, | ||
{ | ||
"type": "Microsoft.Compute/virtualMachines", | ||
"apiVersion": "2020-06-01", | ||
"name": "[parameters('vmName')]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"availabilitySet": { | ||
"id": "[parameters('availabilitySetId')]" | ||
}, | ||
"hardwareProfile": { | ||
"vmSize": "Standard_B4ms" | ||
}, | ||
"networkProfile": { | ||
"networkInterfaces": [ | ||
{ | ||
"id": "[resourceId('Microsoft.Network/networkInterfaces', format('{0}-nic', parameters('vmName')))]" | ||
} | ||
] | ||
}, | ||
"osProfile": { | ||
"computerName": "[parameters('vmName')]", | ||
"adminUsername": "vmadmin", | ||
"linuxConfiguration": { | ||
"disablePasswordAuthentication": true, | ||
"ssh": { | ||
"publicKeys": [ | ||
{ | ||
"path": "/home/vmadmin/.ssh/authorized_keys", | ||
"keyData": "[parameters('adminSshKey')]" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"storageProfile": { | ||
"imageReference": { | ||
"publisher": "OpenLogic", | ||
"offer": "CentOS", | ||
"sku": "7.7", | ||
"version": "latest" | ||
}, | ||
"osDisk": { | ||
"name": "[format('{0}-os', parameters('vmName'))]", | ||
"createOption": "FromImage", | ||
"managedDisk": { | ||
"storageAccountType": "StandardSSD_LRS" | ||
} | ||
} | ||
} | ||
}, | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.Network/networkInterfaces', format('{0}-nic', parameters('vmName')))]" | ||
] | ||
} | ||
] | ||
} |
100 changes: 100 additions & 0 deletions
100
docs/examples/201/anchored-proximity-placement-group/linux-vm-az.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
param location string = resourceGroup().location | ||
param adminSshKey string | ||
param proximityPlacementGroupId string | ||
param subnetId string | ||
param vmName string | ||
param zone int { | ||
allowed: [ | ||
1 | ||
2 | ||
3 | ||
] | ||
} | ||
|
||
resource pip 'Microsoft.Network/publicIpAddresses@2020-05-01' = { | ||
name: '${vmName}-pip' | ||
location: location | ||
properties: { | ||
publicIPAllocationMethod: 'Static' | ||
} | ||
sku: { | ||
name: 'Standard' | ||
} | ||
zones: [ | ||
'${zone}' | ||
] | ||
} | ||
|
||
resource nic 'Microsoft.Network/networkInterfaces@2020-05-01' = { | ||
name: '${vmName}-nic' | ||
location: location | ||
properties: { | ||
ipConfigurations: [ | ||
{ | ||
name: 'ipconfig' | ||
properties: { | ||
privateIPAllocationMethod: 'Dynamic' | ||
subnet: { | ||
id: subnetId | ||
} | ||
publicIPAddress: { | ||
id: pip.id | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
|
||
resource vm 'Microsoft.Compute/virtualMachines@2020-06-01' = { | ||
name: vmName | ||
location: location | ||
properties: { | ||
hardwareProfile: { | ||
vmSize: 'Standard_B4ms' | ||
} | ||
networkProfile: { | ||
networkInterfaces: [ | ||
{ | ||
id: nic.id | ||
} | ||
] | ||
} | ||
osProfile: { | ||
computerName: vmName | ||
adminUsername: 'vmadmin' | ||
linuxConfiguration: { | ||
disablePasswordAuthentication: true | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
path: '/home/vmadmin/.ssh/authorized_keys' | ||
keyData: adminSshKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
proximityPlacementGroup: { | ||
id: proximityPlacementGroupId | ||
} | ||
storageProfile: { | ||
imageReference: { | ||
publisher: 'OpenLogic' | ||
offer: 'CentOS' | ||
sku: '7.7' | ||
version: 'latest' | ||
} | ||
osDisk: { | ||
name: '${vmName}-os' | ||
createOption: 'FromImage' | ||
managedDisk: { | ||
storageAccountType: 'StandardSSD_LRS' | ||
} | ||
} | ||
} | ||
} | ||
zones: [ | ||
'${zone}' | ||
] | ||
} |
Oops, something went wrong.