From 18743c0e54c108f643e2f45520982c85d4ddecf0 Mon Sep 17 00:00:00 2001 From: Claude Dioudonnat Date: Mon, 30 Sep 2019 13:23:40 +0200 Subject: [PATCH] Add choice between full or partial clone --- proxmox/resource_vm_qemu.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/proxmox/resource_vm_qemu.go b/proxmox/resource_vm_qemu.go index ed3110b..feec531 100644 --- a/proxmox/resource_vm_qemu.go +++ b/proxmox/resource_vm_qemu.go @@ -71,6 +71,12 @@ func resourceVmQemu() *schema.Resource { Optional: true, ForceNew: true, }, + "full_clone": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Default: true, + }, "qemu_os": { Type: schema.TypeString, Optional: true, @@ -478,6 +484,12 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error { // check if ISO or clone if d.Get("clone").(string) != "" { + fullClone := 1 + if !d.Get("full_clone").(bool) { + fullClone = 0 + } + config.FullClone = &fullClone + sourceVmr, err := client.GetVmRefByName(d.Get("clone").(string)) if err != nil { pmParallelEnd(pconf)