Azure VM fail to join domain

298 views
Skip to first unread message

wesleyvand...@gmail.com

unread,
Mar 17, 2016, 9:49:28 AM3/17/16
to Terraform
Hi,


We started using Terraform to deploy virtual machines within Azure. We would like to add these vm's to our Active Directory Domain once they are created and I implemented the desired Terraform configuration for it:

resource "azure_instance" "terraform" {
    name = "${var.vmname}"
    image = "Windows Server 2012 R2 Datacenter, February 2016"
    size = "Basic_A1"
    storage_service_name = "${azure_storage_service.terraform.name}"
    hosted_service_name = "${azure_hosted_service.terraform.name}"
    virtual_network = "VNETwe"
    subnet = "Servers"
    location = "West Europe"
    time_zone = "Europe/Amsterdam"
    username = "terraform"
    password = "clearedpassword"
    domain_name = "ourdomain.nl"
    domain_ou = "OU=terraform,DC=ourdomain,DC=nl"
    domain_username = "administrator"
    domain_password = "clearedpassword"
}

If I run a terraform plan and a terraform apply it fails with the following error:

Error applying plan:

1 error(s) occurred:

* azure_instance.terraform: Error creating instance terraformwin01: Error response from Azure. Code: BadRequest, Message: Invalid domain join information specified. Ensure that the JoinDomain setting is specified, and that either the Credentials or Provisioning setting is specified.  See the Windows Automated Installation Kit documentation for more information.

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.

Anybody else had this problem? How can I fix this? Manually joining a VM to our domain after it is created works, so it looks like it has something to do with our terraform configuration.


With best regards,

Wesley van den Hengel 

Paul Hinze

unread,
Mar 23, 2016, 7:22:28 PM3/23/16
to terrafo...@googlegroups.com
Hi Wesley,

Looks like you are using the Azure Service Management (ASM) API based provider, which we're in the process of phasing out in favor of the new Azure Resource Manager (ARM) API based provider.

In looking into the equivalent resource on the ARM side, I noticed that we don't yet support JoinDomain functionality for that resource, so I filed https://github.com/hashicorp/terraform/issues/5820 to track that feature.

Hopefully we can get the domain functionality into the ARM VM resource soon and you can switch over to that to get everything working again!

Paul


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/0873dc51-5b34-448b-b1be-3ab99507dafb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gangadhar r

unread,
May 27, 2017, 1:59:36 AM5/27/17
to Terraform
Any updates on this?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages