diff --git a/proxmox/nodes/vms/vms.go b/proxmox/nodes/vms/vms.go index cfdc4480..fded8410 100644 --- a/proxmox/nodes/vms/vms.go +++ b/proxmox/nodes/vms/vms.go @@ -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, })