Coder Social home page Coder Social logo

imskyer / terraform-provider-virtualbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terra-farm/terraform-provider-virtualbox

0.0 2.0 0.0 109 KB

VirtualBox provider for Terraform

Home Page: https://terra-farm.github.io/provider-virtualbox/

License: MIT License

Go 100.00%

terraform-provider-virtualbox's Introduction

Build Status FOSSA Status

VirtualBox provider for Terraform

Inspired by terraform-provider-vix

Donated to the terra-farm group by ccll

Published documentation is located on the Terra-Farm website.

How to install

  1. go get github.com/terra-farm/terraform-provider-virtualbox

How to build from source

  1. git clone https://github.com/terra-farm/terraform-provider-virtualbox
  2. cd terraform-provider-virtualbox
  3. dep ensure
  4. mv terraform-provider-virtualbox example/
  5. cd example/
  6. terraform plan
  7. terraform apply

Resources

"virtualbox_vm"

Schema

  • name, string, required: The name of the virtual machine.
  • image, string, required: The place of the image file(archive or vagrant box).
  • url, string, optional, default not set: The url for downloaded vagrant box from external resource (ex. Ubuntu Vagrant box) . If not set using image variable.
  • cpus, int, optional, default=2: The number of CPUs.
  • memory, string, optional, default="512mib": The size of memory, allow human friendly units like 'MB', 'MiB'.
  • user_data, string, optional, default="": User defined data.
  • status, string, optional, default="running": The status of the VM, allowed values: 'poweroff', 'running'. This value will be updated at runtime to reflect the real status of the VM, and you can also specify it explicitly in config to manually control the status of the VM. This value defaults to 'running', so terraform apply will always try to keep the VM running if not specified otherwise.
  • network_adapter, list: The network adapters in the VM, you can have up to 4 adapters.
    • .#.type, string, requried: The type of the network, allowed values: 'nat', 'bridged', 'hostonly', 'internal', 'generic'.
    • .#.device, string, optional, default="IntelPro1000MTServer": The model of the virtual hardware device, allowed values: 'PCIII', 'FASTIII', 'IntelPro1000MTDesktop', 'IntelPro1000TServer', 'IntelPro1000MTServer'.
    • .#.host_interface, string, optional: Some network type (hostonly, bridged, etc) must bind to a host interface to work properly, use this field to specify the name of the host interface you like to bind to (like 'en0', 'eth1', 'wlan', etc). This should get an improvement, see TODO section below.
    • .#.status, string, computed: The status of the network adapter, possible values: 'up', 'down'.
    • .#.mac_address, string, computed: The MAC address of the adapter, this is generated by VirtualBox.
    • .#.ipv4_address, string, computed: The IPv4 address assigned to the adapter.
    • .#.ipv4_address_available, string, computed: Wheather or not an IPv4 address is actaully assigned to the adapter, possible values: "yes", "no".
  • optical_disks, list: The iso image to attach.

Network adapter types

  • NAT
  • bridged

Example

resource "virtualbox_vm" "node" {
    count = 2
    name = "${format("node-%02d", count.index+1)}"

    image = "~/ubuntu-15.04.tar.xz"
    cpus = 2
    memory = "512mib"

    network_adapter {
        type = "nat"
    }

    network_adapter {
        type = "bridged"
        host_interface = "en0"
    }

    optical_disks = ["./cloudinit.iso"]
}

output "IPAddr" {
    # Get the IPv4 address of the bridged adapter (the 2nd one) on 'node-02'
    value = "${element(virtualbox_vm.node.*.network_adapter.1.ipv4_address, 1)}"
}

Limitations

  • Experimental provider!

Example images

TODO

  • Optimize resourceVMUpdate(), eliminate unneccessary restarts of VM.
  • Auto download image from remote url.
  • Validate downloaded image against checksum.
  • Download the same image only once (based on checksum).
  • Re-download corrupted image (based on checksum).

License

FOSSA Status

terraform-provider-virtualbox's People

Contributors

ccll avatar fossabot avatar iuriimedvedev avatar pytoshka avatar ringods avatar tylerauerbeck avatar voytechnology avatar

Watchers

 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.