An attempt to migrate a container may fail with the error output as follows:
[firstname.lastname@example.org ~]# vzmigrate target.node 100500 email@example.com's password: Connection to destination node (target.node) is successfully established Moving/copying CT#100500 -> CT#100500, ,  ... Checking external bind mounts Check cluster ID Checking keep dir for private area copy Checking technologies Checking disk usage space Checking templates for CT copy ez template area directories from /vz/template/centos/6/x86_64 Ignore /bin/vztar exit code 0, continue Checking IP addresses on destination node syncing UUID: /vz/template/vc//297121d9-224e-49a4-a155-715d11a49782 UUID-collision, directory /vz/template/vc//297121d9-224e-49a4-a155-715d11a49782 exists Can't move/copy CT#100500 -> CT#100500, ,  : UUID-collision, directory /vz/template/vc//297121d9-224e-49a4-a155-715d11a49782 exists
As the error states - the issue is caused by the collision of UUID:
Can't move/copy CT#100500 -> CT#100500, ,  : UUID-collision, directory /vz/template/vc//297121d9-224e-49a4-a155-715d11a49782 exists
That means that both servers - the source server and the destination server - have the following folder:
/vz/template/vc/ keeps caches for containers, each folder is named after the container's UUID. UUID should be unique, that means that either the destination server has the very same copy of the container, or this folder is obsolete and it should not exist over there.
For the migration to succeed, it is necessary to get rid of the duplicate folder on the destination server. There are 2 scenarios - either the destination server has the very same copy of the container (probably outdated), or this folder is obsolete and should not exist over there.
In order to understand which case is that, we need to understand if there is any container with the same UUID that uses this cache. Execute following command on the destination server to find it out:
[firstname.lastname@example.org ~]# grep 297121d9-224e-49a4-a155-715d11a49782 /etc/vz/conf/*.conf /etc/vz/conf/100500.conf:UUID=297121d9-224e-49a4-a155-715d11a49782 [email@example.com ~]#
In the output above we can see that UUID belongs to the already existing container #100500.
If the output from this
grep command is empty - it means this cache does not belong to any container - it is obsolete and no longer required.
Cache belongs to some container
If cache belongs to some container, and this container is not required anymore - simply destroy it. It will cleanup the cache folder that caused the collision.
If cache belongs to some container that should not be destroyed - schedule the maintenance window to perform the following operation that will change UUID for the container:
# vzctl stop 100500 # vzmlocal -C 100500:666666 # vzctl destroy 100500 # vzmlocal 666666:100500 # vzctl start 100500
Cache does not belong to any container
If cache does not belong to any container (output from the
grep command above is empty) - simply remove the folder on the destination server:
[firstname.lastname@example.org ~]# rm -rf /vz/template/vc//297121d9-224e-49a4-a155-715d11a49782