mirror of
https://github.com/letic/terraform-provider-proxmox.git
synced 2024-07-03 16:12:38 +00:00
Merge pull request #108 from claudusd/keep_id_updateconfig_fail
Set id when updateconfig fail
This commit is contained in:
commit
0f7edc67dd
|
@ -517,6 +517,8 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
|
|||
log.Print("[DEBUG] cloning VM")
|
||||
err = config.CloneVm(sourceVmr, vmr, client)
|
||||
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)
|
||||
return err
|
||||
}
|
||||
|
@ -547,6 +549,8 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
|
|||
|
||||
err := config.UpdateConfig(vmr, client)
|
||||
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)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user