[Azure SM] Error: IP address is not valid '' during creating VM in Azure Classic

25 views
Skip to first unread message

Daniel Dragan

unread,
Apr 26, 2016, 11:45:23 AM4/26/16
to Terraform
Hi All,

I am running terraform configuration on Azure Service Management.

But I got an error: 

$ terraform apply -state st.state -var instance_size=Large -var image_name=my_image_name -var service_location="West US"
azure_virtual_network.stackvirt1: Creating...
  address_space.#:                  "" => "1"
  address_space.0:                  "" => "10.10.0.0/16"
  location:                         "" => "West US"
  name:                             "" => "stackvirt1"
  subnet.#:                         "" => "2"
  subnet.2153418312.address_prefix: "" => "10.10.1.0/24"
  subnet.2153418312.name:           "" => "private"
  subnet.2153418312.security_group: "" => ""
  subnet.4214968994.address_prefix: "" => "10.10.2.0/24"
  subnet.4214968994.name:           "" => "public"
  subnet.4214968994.security_group: "" => ""
azure_storage_service.stackstorage1: Creating...
  account_type:  "" => "Standard_LRS"
  description:   "" => "stack Terraform."
  label:         "" => "Made by Terraform."
  location:      "" => "West US"
  name:          "" => "stackstorage1"
  primary_key:   "" => "<computed>"
  secondary_key: "" => "<computed>"
  url:           "" => "<computed>"
azure_hosted_service.stackservice1: Creating...
  default_certificate_thumbprint: "" => "<computed>"
  description:                    "" => "stack Terraform."
  ephemeral_contents:             "" => "0"
  label:                          "" => "stack-service1-label"
  location:                       "" => "West US"
  name:                           "" => "stackservice1"
  status:                         "" => "<computed>"
  url:                            "" => "<computed>"
azure_storage_service.stackstorage1: Still creating... (10s elapsed)
...
azure_storage_service.stackstorage1: Still creating... (40s elapsed)
azure_storage_service.stackstorage1: Creation complete
Error applying plan:

1 error(s) occurred:

* azure_virtual_network.stackvirt1: Error creating Virtual Network stackvirt1: Error response from Azure. Code: BadRequest, Message: IP address is not valid ''.

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.



Does anybody know what is the problem?



My config:

# Connect to the Azure Provider
provider "azure" {
publish_settings = "${file("XXXXXXXXXXXXXXXXXXXXXXXXX.publishsettings")}"
}

resource "azure_hosted_service" "stackservice1" {
    name = "stackservice1"
    location = "West US"
    ephemeral_contents = false
    description = "stack Terraform."
    label = "stack-service1-label"
}

resource "azure_storage_service" "stackstorage1" {
    name = "stackstorage1"
    location = "West US"
    description = "stack Terraform."
    account_type = "Standard_LRS"
}

resource "azure_virtual_network" "stackvirt1" {
    name = "stackvirt1"
    address_space = ["10.10.0.0/16"]
    location = "West US"

    subnet {
        name = "private"
        address_prefix = "10.10.1.0/24"
    }
    subnet {
        name = "public"
        address_prefix = "10.10.2.0/24"
    }
}

resource "azure_instance" "stack-dut" {
    name = "stack-dut1"
    hosted_service_name = "${azure_hosted_service.stackservice1.name}"
    image = "${var.image_name}"
    size = "${var.instance_size}"
    storage_service_name = "${azure_storage_service.stackstorage1.name}"
    location = "${var.service_location}"
    username = "${var.user_name}"
    password = "${var.user_password}"
    virtual_network = "${azure_virtual_network.stackvirt1.name}"
    endpoint {
                name = "SSH"
                protocol = "tcp"
                public_port = 22
                private_port = 22
    }
}

variable "image_name"{
    default = ""
}
variable "instance_size" {
    default = ""
}
variable "service_location" {
    default = ""
}
variable "image_name"{
    default = ""
}
variable "user_name" {
    default = "tester"
}
variable "user_password" {
    default = "XXXXXXXXXX"
}


-Thanks

Surjit Bains

unread,
May 13, 2016, 5:17:12 AM5/13/16
to Terraform
I get the same error, using service managed Azure. Did you find a fix?
Reply all
Reply to author
Forward
0 new messages