Skip to content

Commit

Permalink
add onboot, multi disks, and multi nic
Browse files Browse the repository at this point in the history
  • Loading branch information
aabouzaid committed Jul 31, 2018
1 parent 6d51c5b commit 217a5cf
Show file tree
Hide file tree
Showing 3 changed files with 424 additions and 157 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
2 changes: 1 addition & 1 deletion proxmox/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func applyFn(ctx context.Context) error {
return err
}
time.Sleep(10 * time.Second)
vmParams := map[string]string{
vmParams := map[string]interface{}{
"net1": data.Get("net1").(string),
}
_, err = client.SetVmConfig(vmr, vmParams)
Expand Down
Loading

0 comments on commit 217a5cf

Please sign in to comment.