If engine fails to finalize the transfer, for example due to
inaccessible storage, it will move to "paused by system" state and keep
the disk. We need to cancel the transfer to have the disk removed.
Thanks: Daniel Erez.
---
v2v/rhv-upload-plugin.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index 9b433bd7..114d5d55 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -458,6 +458,11 @@ def close(h):
with builtins.open(params['diskid_file'], 'w') as fp:
fp.write(disk.id)
+ except:
+ # If oVirt engine fails to finalize the transfer, it will pause the
+ # transfer and keep the disk.
+ transfer_service.cancel()
+ raise
finally:
connection.close()
--
2.21.0