Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LR90 placement groups #890

Merged
merged 3 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/examples/201/anchored-proximity-placement-group/README.md
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
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 docs/examples/201/anchored-proximity-placement-group/linux-vm-as.json
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 docs/examples/201/anchored-proximity-placement-group/linux-vm-az.bicep
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}'
]
}
Loading