1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(instances): clones roll back their copies; own error messages stay

Clone:
- only shut-off VMs are cloned, as the UI already required: a running
  guest keeps writing while its disks are copied; the definition comes
  from the persistent XML;
- MAC addresses and disk destinations are checked before anything is
  allocated;
- every volume the clone creates (NVRAM and disks) is tracked; if a
  later copy or the definition fails, only those are deleted, and any
  that cannot be deleted are named in the error. Before, a failed clone
  left its earlier copies behind.

libvirtError(msg) reports the thread's last libvirt error instead of
msg when there is one, so WebVirtCloud's own errors could show an
earlier, unrelated failure. util.OperationError, a libvirtError
subclass that keeps its message, replaces those raises in vrtManager,
instances and nwfilters; 'except libvirtError' still catches it.
This commit is contained in:
catborise 2026-10-04 00:27:55 +03:00
parent e5fda79f5a
commit 57cf49262a
8 changed files with 282 additions and 139 deletions

View file

@ -301,7 +301,7 @@ class wvmConnectionManager(object):
return connection.connection
else:
# raise libvirt error
raise libvirtError(connection.last_error)
raise util.OperationError(connection.last_error)
def host_is_up(self, conn_type, hostname):
"""