Skip to content

Commit

Permalink
Merge pull request #13 from AAbouZaid/multi_device
Browse files Browse the repository at this point in the history
 [WIP] Add support for multi device.
  • Loading branch information
ggongaware committed Nov 12, 2018
2 parents 3f07e92 + 290e847 commit 95d52ed
Show file tree
Hide file tree
Showing 3 changed files with 425 additions and 167 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Proxmox 4 Terraform
# Proxmox 4 Terraform

Terraform provider plugin for proxmox

Expand Down Expand Up @@ -78,13 +78,27 @@ resource "proxmox_vm_qemu" "prepprovision-test" {
target_node = "proxmox1-xx"
clone = "terraform-ubuntu1404-template"
storage = "local"
cores = 3
sockets = 1
memory = 2560
disk_gb = 4
nic = "virtio"
bridge = "vmbr1"
network {
id = 0
model = "virtio"
}
network {
id = 1
model = "virtio"
bridge = "vmbr1"
}
disk {
id = 0
type = virtio
storage = local-lvm
storage_type = lvm
size = 4G
backup = true
}
preprovision = true
ssh_forward_ip = "10.0.0.1"
ssh_user = "terraform"
ssh_private_key = <<EOF
Expand Down Expand Up @@ -117,7 +131,7 @@ You can start from either an ISO or clone an existing VM.
Optimally, you could create a VM resource you will use a clone base with an ISO, and make the rest of the VM resources depend on that base "template" and clone it.

Interesting parameters:

**preprovision** - to enable or disable internal pre-provisioning (e.g. if you already have another way to provision VMs). Conflicts with: `ssh_forward_ip`, `ssh_user`, `ssh_private_key`, `os_type`, `os_network_config`.
**os_type** -
* cloud-init - from Proxmox 5.2
* ubuntu -(https://github.com/Telmate/terraform-ubuntu-proxmox-iso)
Expand Down
5 changes: 3 additions & 2 deletions proxmox/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ func applyFn(ctx context.Context) error {
return err
}
time.Sleep(10 * time.Second)
var vmParams map[string]interface{}
vmParams["net1"] = data.Get("net1").(string)
vmParams := map[string]interface{}{
"net1": data.Get("net1").(string),
}
_, err = client.SetVmConfig(vmr, vmParams)
time.Sleep(10 * time.Second)
return err
Expand Down
Loading

0 comments on commit 95d52ed

Please sign in to comment.