R5.0.1 - multicloud :: Azure :: availability_zone set to "1" fails.

Bug #1783347 reported by Ritam Gangopadhyay on 2018-07-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
High
Sanju Abraham
Trunk
Fix Committed
High
Sanju Abraham

Bug Description

Default value of availability_zone is set to "1" and terraform fails applying this config

contrail-multi-cloud/transform/infrastructure/terraform_azure.py

        if instance.availability_zone:
            self.availability_zone = instance.availability_zone
        else:
            self.availability_zone = '1'

ERROR
**************
**************
Error: Error applying plan:

5 error(s) occurred:

* azurerm_virtual_machine.compute-ritam-test-1-b: 1 error(s) occurred:

* azurerm_virtual_machine.compute-ritam-test-1-b: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ResourceTypeNotSupportAvailabilityZones" Message="The resource type 'virtualMachines' does not support availability zones at location 'westindia' and api-version '2017-12-01'."
* azurerm_virtual_machine.compute-ritam-test-1-a: 1 error(s) occurred:

* azurerm_virtual_machine.compute-ritam-test-1-a: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ResourceTypeNotSupportAvailabilityZones" Message="The resource type 'virtualMachines' does not support availability zones at location 'westindia' and api-version '2017-12-01'."
* azurerm_public_ip.gw-ritam-test-1-b_subnet-ritam-test-1-b-public: 1 error(s) occurred:

* azurerm_public_ip.gw-ritam-test-1-b_subnet-ritam-test-1-b-public: Error Creating/Updating Public IP "gw-ritam-test-1-b_subnet-ritam-test-1-b-public" (Resource Group "contrail-test-west-india"): network.PublicIPAddressesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ResourceTypeNotSupportAvailabilityZones" Message="The resource type 'publicIPAddresses' does not support availability zones at location 'westindia' and api-version '2018-04-01'."
* azurerm_public_ip.gw-ritam-test-1-a_subnet-ritam-test-1-a-public: 1 error(s) occurred:

* azurerm_public_ip.gw-ritam-test-1-a_subnet-ritam-test-1-a-public: Error Creating/Updating Public IP "gw-ritam-test-1-a_subnet-ritam-test-1-a-public" (Resource Group "contrail-test-west-india"): network.PublicIPAddressesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ResourceTypeNotSupportAvailabilityZones" Message="The resource type 'publicIPAddresses' does not support availability zones at location 'westindia' and api-version '2018-04-01'."
* azurerm_virtual_machine.controller-ritam-test-1-a: 1 error(s) occurred:

* azurerm_virtual_machine.controller-ritam-test-1-a: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ResourceTypeNotSupportAvailabilityZones" Message="The resource type 'virtualMachines' does not support availability zones at location 'westindia' and api-version '2017-12-01'."

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

********************************************************
********************************************************

Removing availability zone from azure.tf.json applies the topology successfully.

********************************************************
********************************************************

REMOVE THE BELOW FROM azure.tf.json file

                "zones": [
                    "1"
                ]

Changed in juniperopenstack:
milestone: r5.0.1 → r5.1.0
Jeba Paulaiyan (jebap) on 2018-07-25
tags: added: fabric
tags: added: beta-blocker
Sanju Abraham (asanju) wrote :

Fixed is as part of the commit - https://github.com/Juniper/contrail-multi-cloud/pull/167.

The issue was that in Azure there are only a few regions that have availability zones. (https://docs.microsoft.com/en-us/azure/availability-zones/az-overview). The ones we tested had them. Azure claims that AZ creation on any region is a beta feature. Instead of creating the AZ OR defaulting to some AZ for a region, we will only depend on the user input.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers