Skip to content

Check for zfs volume leftovers before migration #558

Description

@YanChii

If the previous migration has failed in a way that has prevented proper cleanup (e.g. network failure), there might be undeleted zfs filesytems/volumes of a migrated VM on a destination node that were not deleted.

When this happens, the next migration fails

Got bad return code (1). Error: cannot receive new filesystem stream: destination 'zones/mgmt03-1.local' exists
must specify -F to overwrite it
warning: cannot send 'zones/mgmt03-1.local/disk0@esmigrate-1-1631083400162894655': signal received
cannot send 'zones/mgmt03-1.local': I/O error
ERROR: Send/receive failed
NAME
zones/cores/mgmt03-1.local 

The solution is to check the destination for target zfs volumes and existing VMs. If the VM is not present and the zfs filesystems for it do exist, we can safely delete them. However if the VM is already present, we prevent accidental unwanted deletion of target VM by failing the migration.

The changes should go most probably to this function.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions