cloud - Toolset to deploy clusters on Azure -


i using packer.io deploy single vm azure. next step in project deploy cluster of vms azure. packer alone not sufficient, in opinion (correct me if wrong) orchestrate deployment of clusters. so, need else orchestrate deployment. since cluster, each machine in need know ip addresses of every other machine (my application distributed database.) looking @ terraform.io, documentation not have examples when comes azure. there resources started? terraform need? other tools recommend? complication trying automate deployment of demo vms customers. current workflow is, using packer, create vm, install database, create necessary user accounts, upload staging directories vm. take snapshot image. later, image deployed vmdepot clients (to azure accounts.) again, now, single-machine cluster. later on, need set of @ least 4 machines. there better workflow accomplish this?

thank time.

terraform has an azure provider, though think had not yet been developed @ time asked original question.

terraform allows creation of multiple "copies" of same resource, useful creating clusters. however, passing in ip addresses of of hosts instances can tricky since provisioning step must wait until of instances have completed. common workaround sort of sequencing use undocumented null_resource run standalone provisioning step on hosts. example:

resource "azure_instance" "web" {     name = "terraform-test"     hosted_service_name = "${azure_hosted_service.example.name}"     image = "ubuntu server 14.04 lts"     size = "basic_a1"     storage_service_name = "yourstorage"     location = "west us"     username = "terraform"     password = "pass!admin123"      # tell terraform create 3 identical instances.     count = 3      endpoint {         name = "ssh"         protocol = "tcp"         public_port = 22         private_port = 22     } }  resource "null_resource" "provision" {     count = 3      connection {         host = "${lookup(azura_instance.web.*.ip_address, count.index)}"         user = "terraform"         password = "pass!admin123"     }      provisioner "remote-exec" {         inline = [             "/usr/local/bin/configure-cluster ${join(" ", azura_instance.web.*.ip_address)}",         ]     } } 

the 3 copies of null resource depend on 3 of azure_instance resources, not created , provisioned until of instances ready. once instances ready, each null resource configured connect corresponding instance (by index) , run imaginary configure-cluster command on instance, passing in full set of cluster ip addresses arguments.

note provisioners run @ initial creation of resource. updates resource not re-run provisioners. since null resource doesn't represent real infrastructure resource, provisioning steps can re-run "tainting" terraform re-create on next apply:

terraform taint null_resource.provision 

Comments