From a2610f19d72dc59c5331267b636cd0acd5f4276c Mon Sep 17 00:00:00 2001 From: jvhoof Date: Thu, 23 Mar 2023 23:40:34 +0100 Subject: [PATCH] FGT AP: customvhd - ARM64 --- .../Active-Passive-ELB-ILB/azuredeploy.json | 85 ++++++++++++------- .../createUiDefinition.json | 63 +++++++++++++- 2 files changed, 114 insertions(+), 34 deletions(-) diff --git a/FortiGate/Active-Passive-ELB-ILB/azuredeploy.json b/FortiGate/Active-Passive-ELB-ILB/azuredeploy.json index 53078d29..ab435a2e 100755 --- a/FortiGate/Active-Passive-ELB-ILB/azuredeploy.json +++ b/FortiGate/Active-Passive-ELB-ILB/azuredeploy.json @@ -120,7 +120,25 @@ "Standard_D32as_v5", "Standard_D8ads_v5", "Standard_D16ads_v5", - "Standard_D32ads_v5" + "Standard_D32ads_v5", + "Standard_D8ps_v5", + "Standard_D16ps_v5", + "Standard_D32ps_v5", + "Standard_D8pds_v5", + "Standard_D16pds_v5", + "Standard_D32pds_v5", + "Standard_D8pls_v5", + "Standard_D16pls_v5", + "Standard_D32pls_v5", + "Standard_D8plds_v5", + "Standard_D16plds_v5", + "Standard_D32plds_v5", + "Standard_E8ps_v5", + "Standard_E16ps_v5", + "Standard_E32ps_v5", + "Standard_E8pds_v5", + "Standard_E16pds_v5", + "Standard_E32pds_v5" ], "metadata": { "description": "Virtual Machine size selection - must be F4 or other instance that supports 4 NICs" @@ -419,6 +437,13 @@ "description": "Secondary FortiGate BYOL Flex-VM license token" } }, + "customImageReference": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "By default, the deployment will use Azure Marketplace images. In specific cases, using BYOL custom FortiGate images can be deployed. This requires a reference " + } + }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]", @@ -442,14 +467,6 @@ "availabilitySetId": { "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('availabilitySetName'))]" }, - "useAZ": "[and(not(empty(pickZones('Microsoft.Compute', 'virtualMachines', parameters('location')))), equals(parameters('availabilityOptions'), 'Availability Zones'))]", - "pipZones": "[if(variables('useAZ'), pickZones('Microsoft.Network', 'publicIPAddresses', parameters('location'), 3), json('null'))]", - "zone1": [ - "1" - ], - "zone2": [ - "2" - ], "vnetName": "[if(equals(parameters('vnetName'),''),concat(parameters('fortiGateNamePrefix'),'-VNET'),parameters('vnetName'))]", "subnet1Id": "[if(equals(parameters('vnetNewOrExisting'),'new'),resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vnetName'),parameters('subnet1Name')),resourceId(parameters('vnetResourceGroup'),'Microsoft.Network/virtualNetworks/subnets', variables('vnetName'),parameters('subnet1Name')))]", "subnet2Id": "[if(equals(parameters('vnetNewOrExisting'),'new'),resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vnetName'),parameters('subnet2Name')),resourceId(parameters('vnetResourceGroup'),'Microsoft.Network/virtualNetworks/subnets', variables('vnetName'),parameters('subnet2Name')))]", @@ -564,7 +581,29 @@ "externalLBBEName": "[concat(parameters('fortiGateNamePrefix'),'-ELB-',parameters('subnet1Name'),'-BackEnd')]", "externalLBBEId": "[resourceID('Microsoft.Network/loadBalancers/backendAddressPools/',variables('externalLBName'),variables('externalLBBEName'))]", "externalLBProbeName": "lbprobe", - "externalLBProbeId": "[resourceId('Microsoft.Network/loadBalancers/probes/',variables('externalLBName'),variables('externalLBProbeName'))]" + "externalLBProbeId": "[resourceId('Microsoft.Network/loadBalancers/probes/',variables('externalLBName'),variables('externalLBProbeName'))]", + "useAZ": "[and(not(empty(pickZones('Microsoft.Compute', 'virtualMachines', parameters('location')))), equals(parameters('availabilityOptions'), 'Availability Zones'))]", + "pipZones": "[if(variables('useAZ'), pickZones('Microsoft.Network', 'publicIPAddresses', parameters('location'), 3), json('null'))]", + "zone1": [ + "1" + ], + "zone2": [ + "2" + ], + "imageReferenceMarketplace": { + "publisher": "[variables('imagePublisher')]", + "offer": "[variables('imageOffer')]", + "sku": "[parameters('fortiGateImageSKU')]", + "version": "[parameters('FortigateImageVersion')]" + }, + "imageReferenceCustomImage": { + "id": "[parameters('customImageReference')]" + }, + "virtualMachinePlan": { + "name": "[parameters('fortiGateImageSKU')]", + "publisher": "[variables('imagePublisher')]", + "product": "[variables('imageOffer')]" + } }, "resources": [ { @@ -1211,11 +1250,7 @@ "type": "SystemAssigned" }, "zones": "[if(variables('useAZ'), variables('zone1'), json('null'))]", - "plan": { - "name": "[parameters('fortiGateImageSKU')]", - "publisher": "[variables('imagePublisher')]", - "product": "[variables('imageOffer')]" - }, + "plan": "[if(and(equals(parameters('fortiGateImageSKU'),'fortinet_fg-vm'),not(equals(parameters('customImageReference'),''))), json('null'), variables('virtualMachinePlan'))]", "dependsOn": [ "[variables('fgaNic1Id')]", "[variables('fgaNic2Id')]", @@ -1234,12 +1269,7 @@ "customData": "[variables('fgaCustomData')]" }, "storageProfile": { - "imageReference": { - "publisher": "[variables('imagePublisher')]", - "offer": "[variables('imageOffer')]", - "sku": "[parameters('fortiGateImageSKU')]", - "version": "[parameters('fortiGateImageVersion')]" - }, + "imageReference": "[if(and(equals(parameters('fortiGateImageSKU'),'fortinet_fg-vm'),not(equals(parameters('customImageReference'),''))), variables('imageReferenceCustomImage'), variables('imageReferenceMarketplace'))]", "osDisk": { "createOption": "FromImage" }, @@ -1298,11 +1328,7 @@ "type": "SystemAssigned" }, "zones": "[if(variables('useAZ'), variables('zone2'), json('null'))]", - "plan": { - "name": "[parameters('fortiGateImageSKU')]", - "publisher": "[variables('imagePublisher')]", - "product": "[variables('imageOffer')]" - }, + "plan": "[if(and(equals(parameters('fortiGateImageSKU'),'fortinet_fg-vm'),not(equals(parameters('customImageReference'),''))), json('null'), variables('virtualMachinePlan'))]", "dependsOn": [ "[variables('fgbNic1Id')]", "[variables('fgbNic2Id')]", @@ -1321,12 +1347,7 @@ "customData": "[variables('fgbCustomData')]" }, "storageProfile": { - "imageReference": { - "publisher": "[variables('imagePublisher')]", - "offer": "[variables('imageOffer')]", - "sku": "[parameters('fortiGateImageSKU')]", - "version": "[parameters('fortiGateImageVersion')]" - }, + "imageReference": "[if(and(equals(parameters('fortiGateImageSKU'),'fortinet_fg-vm'),not(equals(parameters('customImageReference'),''))), variables('imageReferenceCustomImage'), variables('imageReferenceMarketplace'))]", "osDisk": { "createOption": "FromImage" }, diff --git a/FortiGate/Active-Passive-ELB-ILB/createUiDefinition.json b/FortiGate/Active-Passive-ELB-ILB/createUiDefinition.json index 521d7456..2f39b5e3 100644 --- a/FortiGate/Active-Passive-ELB-ILB/createUiDefinition.json +++ b/FortiGate/Active-Passive-ELB-ILB/createUiDefinition.json @@ -351,7 +351,25 @@ "Standard_D32as_v5", "Standard_D8ads_v5", "Standard_D16ads_v5", - "Standard_D32ads_v5" + "Standard_D32ads_v5", + "Standard_D8ps_v5", + "Standard_D16ps_v5", + "Standard_D32ps_v5", + "Standard_D8pds_v5", + "Standard_D16pds_v5", + "Standard_D32pds_v5", + "Standard_D8pls_v5", + "Standard_D16pls_v5", + "Standard_D32pls_v5", + "Standard_D8plds_v5", + "Standard_D16plds_v5", + "Standard_D32plds_v5", + "Standard_E8ps_v5", + "Standard_E16ps_v5", + "Standard_E32ps_v5", + "Standard_E8pds_v5", + "Standard_E16pds_v5", + "Standard_E32pds_v5" ] }, "options": { @@ -1014,6 +1032,46 @@ } } ] + }, + { + "name": "customvhd", + "type": "Microsoft.Common.Section", + "label": "Custom VHD", + "elements": [ + { + "name": "customvhdinfo", + "type": "Microsoft.Common.InfoBox", + "visible": true, + "options": { + "icon": "Info", + "text": "For BYOL it is possible to upload a specific FortiGate image to Azure provided by support. Provide the resource ID of the required VM image version in the field below.", + "uri": "https://docs.fortinet.com/document/fortigate-public-cloud/7.2.0/azure-administration-guide/392531/deploying-fortigate-vm-from-a-vhd-image-file" + } + }, + { + "name": "resourceid", + "type": "Microsoft.Common.TextBox", + "label": "Azure Compute Gallery Image Version resource ID", + "defaultValue": "", + "toolTip": "Azure Compute Gallery Image Version resource ID", + "constraints": { + "required": "[and(contains(steps('instance').instancetype.selection, 'p'),equals(basics('fortiGateImageSKU'),'fortinet_fg-vm'))]", + "regex": "^[\\w\\W\n\t]{0,10240}$", + "validationMessage": "All characters allowed, max 10240 characters." + }, + "visible": "[equals(basics('fortiGateImageSKU'),'fortinet_fg-vm')]" + }, + { + "name": "customvhdinfo2", + "type": "Microsoft.Common.InfoBox", + "visible": "[contains(steps('instance').instancetype.selection, 'p')]", + "options": { + "icon": "Info", + "text": "An ARM64 based instance type was selected. This requires a custom image using an Azure Compute Gallery.", + "uri": "https://docs.fortinet.com/document/fortigate-public-cloud/7.2.0/azure-administration-guide/392531/deploying-fortigate-vm-from-a-vhd-image-file" + } + } + ] } ] } @@ -1063,7 +1121,8 @@ "fortiManager": "[steps('advanced').fortimanager.enabled]", "fortiManagerIP": "[steps('advanced').fortimanager.fortimanagerip]", "fortiManagerSerial": "[steps('advanced').fortimanager.fortimanagerserial]", - "fortiGateAdditionalCustomData": "[steps('advanced').customdata.config]" + "fortiGateAdditionalCustomData": "[steps('advanced').customdata.config]", + "customImageReference": "[steps('advanced').customvhd.resourceid]" } } }