#834432 ganeti-2.12: Can not start Xen VMs when /etc an /var are different partitions

#834432#5
Date:
2016-08-15 15:47:56 UTC
From:
To:
We only noticed this bug after the latest Xen upgrades (that is 4.4.1-9+deb8u5
-> 4.4.1-9+deb8u6), however this upgrade may be unrelated to our issue.

When starting a Xen VM with ganeti, at some point the config file for the VM is
moved from /etc/xen/VMCONFIGFILE to /var/log/ganeti/xen/VMCONFIGFILE-TIMESTAMP.
For this move, python os.rename() is used. When /etc and /var are different
partitions, this call is bound to fail with an "[Errno 18] Invalid cross-device
link".
Instead, it is possible to use python shutil.move(), which handles cross-
partition moves different.

For our setup the following patch was sufficient, since it is not the only call
to os.rename() it might not cover the bug completely.

/usr/share/ganeti/2.12/ganeti/utils/io.py
410c410,411
<     return os.rename(old, new)
---