Skip to content

devnal/terraform-provider-ibox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infinibox Terraform Provider

Disclaimer

This project is neither supported nor maintained by Infinidat.

Contents

  1. Requirements - lists the requirements for building the provider
  2. Building The Provider - lists the steps for building the provider
  3. Using The Provider - details how to use the provider
  4. Developing The Provider - steps for contributing back to the provider

Requirements

  • Terraform 0.11.x
  • Go 1.9+ (to build the provider plugin)

Building The Provider

Clone repository to: $GOPATH/src/github.com/devnal/terraform-provider-ibox

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone [email protected]:devnal/terraform-provider-ibox

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/devnal/terraform-provider-ibox
$ make build

Using The Provider

Infinibox Resources List and examples

  1. Provider
  2. Pool
  3. Volume
  4. Host
  5. HostCluster
  6. Lun

Provider

Username, Password and Hostname are required for provider configuration.

Example

provider "ibox" {
  hostname = "ibox630"
  username = "admin"
  password = "123456"
}

Pool

Pool Api Docs

Pool resource has to be configured with minimal physical capacity of 1TB, virtual capacity allows over provisioning. Capacity can be increased or decreased. SSD read cache and compression can be enabled/disabled for this resource.

Example

resource "ibox_pool" "my-pool" {
  name = "my-pool-test"
  physical_capacity = "1100000000000"
  virtual_capacity = "3000000000000"
  physical_capacity_critical = 95
  physical_capacity_warning = 89
  ssd_enabled = true
  compression_enabled = true
}

Volume

Volume Api Docs

Volume resource has to be configured with minimal size of 1GB. Capacity can only be increased or decreased. Volume can be provisioned as THIN or THICK. Volume must be created in one of the pools.

Example

resource "ibox_volume" "my-volume" {
  name = "my-volume-test"
  pool_id = "${ibox_pool.my-pool.id}"
  size = 20000000000
  provtype = "THIN"
  ssd_enabled = true
  compression_enabled = true
}

Host

Host Api Docs

This type of resource creates Host object, for ISCSI host authentication can be added. List of FC or/and ISCSI ports can be added during creation or updated later.

Example

resource "ibox_host" "my-host" {
  name = "my-host-test"
}

Example Host with ISCSI CHAP AUTH

resource "ibox_host" "my-host" {
  name = "my-host-test"
  security_method = "MUTUAL_CHAP"
  security_chap_inbound_username = "hostuser987"
  security_chap_inbound_secret = "hostsecret987654321"
  security_chap_outbound_username = "hostuser98732"
  security_chap_outbound_secret = "hostsecret987654321dasdasdsa"
}

Example Host with ISCSI MUTUAL CHAP AUTH and FC Ports

resource "ibox_host" "my-host7" {
  name = "my-host-test7"
  security_method = "MUTUAL_CHAP"
  security_chap_inbound_username = "h"
  security_chap_inbound_secret = "hostsecret987654321dasdasdsaddd"
  security_chap_outbound_username = "hostuser98732"
  security_chap_outbound_secret = "hostsecret987654321dasdasdsa"
  ports = [

      {
        type = "FC"
        address = "21100024ff913bff"
      },
      {
        type = "FC"
        address = "22100024ff913bff"
      },      
  ]
}

Host_Cluster

Host Cluster Api Docs

Host cluster resource is a collection of host resources that are sharing same mapped volumes. List of hosts can be created during creation or updated later. Changing host list is a dangerous operation and must be performed carefully.

Example

resource "ibox_host_cluster" "my-host-cluster" {
  name = "my-host-cluster"
  hosts = [
    "${ibox_host.my-host.id}",
    "${ibox_host.my-host2.id}",
    "${ibox_host.my-host3.id}",
  ]
}

Lun

Adding LUN to Host Cluster Api Docs

LUN resource can be added or removed from Host or Host Cluster resources. If needed specific LUN ID can be defined e.g. 20

Example

resource "ibox_lun" "my-host-lun-3" {
  volume_id = "${ibox_volume.my-volume3.id}"
  host_id = "${ibox_host.my-host6.id}"
  lun = 20
}