Writing a terraform remote state server

  • Post author:
  • Post category:Terraform

Terraform is a useful tool for deploying cloud resources. This post isn't an introduction to terraform, so I'll assume you already know and love it. If you want more, then this getting started guide would be a sensible start. At its most basic level, terraform deploys cloud resources and stores information about those resources in a file on local disk called terraform.tfstate -- it needs that state information so it can make later changes to the deployment, be those modifying resources in use or tearing the whole deployment down. If you had an operations team working on an environment, then you could store the tfstate file in git or a shared filesystem so that the entire team could manage the deployment. However, there is nothing with that approach that stops two members of the team making overlapping changes. That's where terraform state servers come in. State servers can implement optional locking, which stops overlapping operations from happening. The protocol that these servers talk isn't well documented (that I could find). I wanted to explore that more, so I wrote a simple terraform HTTP state server in python. To use this state server, configure your terraform file as per demo.tf. The…

Continue ReadingWriting a terraform remote state server

Further thoughts on Azure instance start times

  • Post author:
  • Post category:Azure

My post from the other day about slow instance starts on Azure caused some commentary (mainly on reddit) that prompted me to think more about all this. In the end, there were a few more experiments I wanted to run to see if I could squeeze more performance out of Azure. First off, looking at the logs from my initial testing it looks like resource groups are slow. The original terraform creates a resource group as part of the test and then cleans it up at the end. What if instead we had a single permanent resource group and created instances within that? Here is a series of instance starts and deletes using the terraform from the last post: You'll notice that there's no delete value for the last instance. That's because terraform crashed and never deleted the instance. You can also see that instance starts are somewhat consistent, except for being slower in the second half of the test than the first, and occasionally spiking out to very very slow. Oh, and deletes are almost always really slow. What happens if we use a permanent resource group and network? This means that all the "instance start terraform" is doing…

Continue ReadingFurther thoughts on Azure instance start times

Why is Azure so slow to start instances?

  • Post author:
  • Post category:Azure

I've been playing with terraform recently, and decided to see how different the terraform for launching a simple Ubuntu instance in various clouds is. There are two big questions there for me -- how big is the variation between OpenStack derived clouds; and how painful is it to move between the proprietary clouds? Part of this is because terraform doesn't present a standardised layer of cloud functionality, it has a provider per cloud. (Although, I suspect there's nothing stopping someone from writing a libcloud provider or something like that. It is an interesting idea which requires some additional thought.) My terraform implementations for each cloud are on github if you're interested. I don't want to spend a lot of analysis on the actual terraform, because I think the really interesting thing I found isn't where I expected it to be (there's a hint in the title for this post). That said, the OpenStack clouds vary mostly by capabilities. vexxhost for example seems to only offer flavors that require boot-from-volume. The proprietary clouds are complete re-writes, but are generally relatively simple and well documented. However, that interesting accidental thing -- as best as I can tell, Microsoft Azure is really really slow to…

Continue ReadingWhy is Azure so slow to start instances?

End of content

No more pages to load