mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 10:33:46 +00:00
fix(vm): edge case of deleting incomplete VM if create
fails and provider retries (#1684)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
parent
3d020a1441
commit
bf9e2436d4
@ -94,8 +94,7 @@ func (c *Client) CreateVMAsync(ctx context.Context, d *CreateRequestBody) (*stri
|
||||
"error": err.Error(),
|
||||
})
|
||||
|
||||
e := c.DoRequest(ctx, http.MethodDelete, c.ExpandPath("?destroy-unreferenced-disks=1&purge=1"), nil, nil)
|
||||
if e != nil {
|
||||
if e := c.DeleteVM(ctx); e != nil {
|
||||
tflog.Warn(ctx, "deleting VM after failed creation", map[string]interface{}{
|
||||
"error": e,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user