fortinet/fortigate-autoscale-azure

load balancer ip allocation issue

JaydenLiang opened this issue · 1 comments

issue copied from the internal bug id: 0720643

The template fails because it asks for the last octet for the load balancer IP
This IP is then being used to create the front end ip addresses of the LB in the respective subnets

The issue comes from the fact that the frontend ip is constructed with the concatenation of the subnet prefix and the provided last octet so this assumes that all subnets are /24

`"LoadBalancerIP": {
"defaultValue": "10",
"type": "String",
"metadata": {
"description": "The last octet of the Frontend Private IP address to be used by the Load Balancer. For example, if set to 10, the Private IP for the Load Balancer in the subnet with prefix 10.0.1.0/24 would be 10.0.1.10."
}
},

   "subnet2LoadBalancerIP": "[concat(substring(variables('subnet2Prefix'), 0, lastIndexOf(variables('subnet2Prefix'), '.')),'.', parameters('LoadBalancerIP'))]", <--------------Here`

My template failed because I used /26 subnets

{ "status": "Failed", "error": { "code": "DeploymentFailed", "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.", "details": [ { "code": "BadRequest", "message": "{\r\n \"error\": {\r\n \"code\": \"PrivateIPAddressNotInSubnet\",\r\n \"message\": \"Private static IP address 1x.68.0.70 does not belong to the range of subnet prefix 10.68.0.128/26.\",\r\n \"details\": []\r\n }\r\n}" } ] } }

[Expected Behavior]

Never hard code ip addresses in template. Please ask them as input parameters

in https://github.com/fortinet/fortigate-autoscale-azure/releases/tag/3.4.0
we updated the default deployment of resources so it:

  1. will no longer deploy an internal load balancer
  2. will no longer deploy NIC for FortiGate into other subnets, e.g. subnet 2, subnet 3, or subnet 4.

so this issue will not exist and no actual fix is needed.