xcp icon indicating copy to clipboard operation
xcp copied to clipboard

Upgrade script

Open olivierlambert opened this issue 3 years ago • 3 comments

At some point, we should be able to have a "upgrade script" (like do-release-upgrade in Ubuntu), allowing us to move even between major version, and in the "ISO upgrade" fashion.

Something like:

  • doing a backup of the existing partition
  • upgrading
  • rebooting on the new version

All of this from the existing shell/in live. We should also be able to rollback if needed.

Main issues will be:

  • how to be sure it will run on newer version? ISO installer is a check by itself because if it boots, it means XCP-ng works on this hardware. At least, we should warn the user about it
  • should be atomic and resumable in case of connection loss

olivierlambert avatar Jun 01 '21 17:06 olivierlambert

For clean data/consistency, a way could be:

  • Put upgradeiso to /tmp
  • Add bootentry to boot update-liveiso
  • Reboot
  • Remove bootentry first (side effect: it won't make it into the backup)
  • Upgrade steps (automated by an answerfile?)
  • Reboot

Otherwise it's ugly to copy active partitions to backup partitions as you will have an inconsistent state as long as whatever is writing to logfiles etc. - that could lead into a broken backup. Ubuntu doesn't have that situation, as they simply have no backup. If it fails, it fails. ;-)

nagilum99 avatar Jun 01 '21 17:06 nagilum99

Logs files doesn't really matters. Also we will shutdown XAPI while doing it, so XAPI DB will be safe.

olivierlambert avatar Jun 01 '21 18:06 olivierlambert

To 100 % avoid any FS inconsistency, you'd either need to reboot to the ISO or remount all mounts RO until the copy process is done. Keep in mind: Any write can make the backup inconsistent and break the filesystems. Where you cold stop any VMs, you probably can't stop anything that might write (systemd/...?) to /*

nagilum99 avatar Jun 01 '21 19:06 nagilum99