Giter Club home page Giter Club logo

terraform-provider-bigv's Introduction

Terraform-Profider-Bigv

BigV is a private dedicated virtual machine platfom provided by Bytemark,

This terraform provider allows the management of machines on that platform.

See BigV prices, Resource definitions and API documentation for configuration options to resource parameters.

Imaging and status of created

If the os you provide is not none, then terraform will wait for the imaging to finish before reporting completion. That should be one in under 3 minutes depending on your distribution. Your distribution must expose an ssh daemon on port 22, since that's how we define "alive".

If your os is none, then we either wait for the VM to be processed by bigv if power_on is false, or we wait for it to be powered up if power_on is true.

Resource changes and reboots

If you change cores or memory, the VM will be restarted. It's always necessary for increases. Strictly bigv can downsize without restarts, but we've noticed that decreasing RAM nearly always ends up inconsistent in the VM. e.g. decreasing to 1GiB gives you 750MiB until you restart.

Provider parameters

  • account

    Bigv account name.

  • user

    Bigv Username

  • password

    Your bigv password. Yubikey is not yet supported. Patches welcome.

Resource parameters

  • name

    The VM name

  • group

    The group name for the server.

    Defaults to default.

  • zone

    The zone to put the server in. Currently this is machester or york. See definitions.

    Defaults to york.

  • cores

    How many cores to allocate. Note that cores must be allocated 1 per 4GiB of RAM. So 1-3GiB = 1 core, 4-7GiB = 2 core.

    If you don't specify cores, but do specify memory, you'll be assigned the correct cores for the memory.

    Defaults to 1.

  • memory

    How much RAM to allocate in MiB.

    If you don't specify mmeory byt do specify cores, you'll be allocated the minimal memory for the core count. e.g. 1GiB for 1 core, 4GiB for 2 cores, etc.

    Defaults to 1024.

  • os

    Short name of operating system to image. See: Resource definitions Common options are: jessie, vivid and none

    Defaults to none.

  • ipv4

  • ipv6

    IP address to allocate. We recommend ips should be specified because it eases the burden on bytemark's allocation process, and should allow concurrent imaging without deadlocks.

  • disc_size

    Disc size in MiB. More options in the API are not yet supported, such as storage grade.

    Defaults to 25600

  • power_on

    Whether or not the machine should be powered. Note that if reboot is true then setting power_on to false just reboots the VM immediately. See Bigv power documentation

    Defaults to true.

  • reboot

    Whether or not the machine should be rebooted automatically when powered down. See Bigv power documentation

    Defaults to true.

  • ssh_public_key

    SSH public key to be created on the VM. Can be multiple keys.

  • firstboot_script

    A script to be run on first boot only by the bigv system itself. Useful for provisioning, especially if terraform remote-exec or file provisioners don't work.

Computed values

  • root_password

    The root password assigned to this vm.

Example Usage

variables.tf:

variable "account" {
  default = "myaccount"
}
variable "user" {
  default = "myuser"
}
// Probably best to supply this interactively
variable "password" { }

provider.tf:

provider "bigv" {
  account  = "${var.account}"
  user     = "${var.user}"
  password = "${var.password}"
}

resources.tf:

resource "bigv_vm" "tf01" {
  name    = "tf01"
  ipv4    = "49.48.12.201"
  ipv6    = "1996:41c8:20:5ed::3:1"
  cores   = 1
  memory  = 1024
  os      = "vivid"
  group   = "default"
  zone    = "manchester"
}
 
resource "bigv_vm" "tf02" {
  name    = "tf02"
  ipv4    = "49.48.12.202"
  ipv6    = "1996:41c8:20:5ed::3:2"
  cores   = 2
  memory  = 4096
  os      = "trusty"
  group   = "vlan1519"
  zone    = "york"
}
 
resource "bigv_vm" "tf03" {
  name    = "tf03"
  ipv4     = "49.48.12.203"
  ipv6    = "1996:41c8:20:5ed::3:3"
  cores   = 1
  memory  = 1024
  os      = "none"
} 

And then just:

terraform plan
terraform apply
terraform refresh
terraform destroy

Debugging and troubleshooting

Terraform commands support TF_LOG=level environment variables:

TF_LOG=DEBUG terraform apply

This provider will be fairly verbose.

terraform-provider-bigv's People

Contributors

gbjk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.