mirror of
https://github.com/letic/terraform-provider-proxmox.git
synced 2024-07-06 01:22:39 +00:00
Set id when updateconfig fail
This commit is contained in:
parent
7a4a86f9e1
commit
f403e94593
|
@ -388,9 +388,9 @@ func resourceVmQemu() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"ipconfig2": {
|
"ipconfig2": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"preprovision": {
|
"preprovision": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -512,6 +512,8 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
log.Print("[DEBUG] cloning VM")
|
log.Print("[DEBUG] cloning VM")
|
||||||
err = config.CloneVm(sourceVmr, vmr, client)
|
err = config.CloneVm(sourceVmr, vmr, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// Set the id because when update config fail the vm is still created
|
||||||
|
d.SetId(resourceId(targetNode, "qemu", vmr.VmId()))
|
||||||
pmParallelEnd(pconf)
|
pmParallelEnd(pconf)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -542,6 +544,8 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
err := config.UpdateConfig(vmr, client)
|
err := config.UpdateConfig(vmr, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// Set the id because when update config fail the vm is still created
|
||||||
|
d.SetId(resourceId(targetNode, "qemu", vmr.VmId()))
|
||||||
pmParallelEnd(pconf)
|
pmParallelEnd(pconf)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user