CentOS 7 to Anolis OS 7 with centos2anolis: a real migration log (eight pitfalls and the kernel truth)
Scope of verification
Section titled “Scope of verification”This page is a real migration log from PVE VM 433 (2C/2G) on 2026-11-08: before/after run.json (E3), the tool’s full log and package lists (migration-logs.txt), a pre-migration snapshot (pre-migration-c7, verified restorable), and console/serial screenshots. Applies to all of CentOS 7.9 (the tool targets 7.x). Not tested: database/middleware application smoke tests; this run booted with selinux=0 (see the boundary note below).
Before and after, on the machine
Section titled “Before and after, on the machine”| Dimension | Before (CentOS) | After (Anolis OS 7.9, measured) |
|---|---|---|
| /etc/*-release | CentOS Linux release 7.9.2009 | Anolis OS release 7.9 |
| PRETTY_NAME | CentOS Linux 7.9.2009 | Anolis OS 7.9 |
| Running kernel | 3.10.0-1160.80.1.el7 | 3.10.0-1160.119.1.0.1.an7 |
| glibc | 2.17 (el7) | 2.17-326.an7.3 (an7 rebuild) |
| openssl | 1.0.2k (el7) | 1.0.2k-26.an7 (an7 rebuild) |
| Enabled repos | CentOS-*.repo (dead mirrorlist) | AnolisOS-7.9 os/updates/extras (11,524 packages) |
| sshd | active | active |




Migration flow (verified, ready to use)
Section titled “Migration flow (verified, ready to use)”# 0. Pre-migration checks + snapshot (pit ①: on the 7 line you don't repair CentOS repo# contents — just move them aside)rpm -qa | grep i686 # precheck: must be emptyqm snapshot <vmid> pre-migration # always snapshot VMs firstmkdir -p /root/repo-backup && mv /etc/yum.repos.d/CentOS-*.repo /root/repo-backup/
# 1. Add the os repo + migration repo + install the tool (pits ②③)printf '[anolis7-os]\nname=AnolisOS7-os\nbaseurl=http://mirrors.openanolis.cn/anolis/7/os/x86_64/os/\ngpgcheck=0\nenabled=1\n' > /etc/yum.repos.d/anolis7-temp.repocurl -fL -o /tmp/python36-psutil.rpm \ https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/p/python36-psutil-5.6.7-1.el7.x86_64.rpmcurl -fsS -o /etc/yum.repos.d/anolis-migration.repo \ https://mirrors.openanolis.cn/migration/anolis-migration.repoyum clean all && yum install -y centos2anolis /tmp/python36-psutil.rpm
# 2. Fix the tool's built-in dead domain (pit ④) + disable the migration repo (pit ⑤)sed -i 's|mirrors.openanolis.org|mirrors.openanolis.cn|g' /usr/sbin/centos2anolis.pysed -i 's/^enabled=1/enabled=0/' /etc/yum.repos.d/anolis-migration.repo
# 3. Run the migration (repo switch + distro-sync; the tool logs to /var/log/centos2anolis.log)centos2anolis.py # ends with "Switch complete… rebooting"
# 4. If an interrupted re-run reports RC=102 (pit ⑥): finish with a manual distro-syncmv /etc/yum.repos.d/CentOS-*.repo /root/repo-backup/ 2>/dev/nullyum -y distro-sync # with AnolisOS-os/updates/extras/Plus enabled
# 5. Outside Aliyun: disable the cloud-init Aliyun datasource before rebooting# (pit ⑦, otherwise first boot blocks for 300s×N)printf 'datasource_list: [ None ]\n' > /etc/cloud/cloud.cfg.d/99-disable-datasource.cfg
# 6. Reboot + verifyrebootgrubby --default-kernel # expect the an7 rebuild (see "kernel truth")cat /etc/os-release; uname -rEight-pit quick table
Section titled “Eight-pit quick table”| # | Symptom | Fix |
|---|---|---|
| ① | Couldn't resolve host: mirrorlist.centos.org | Dead. mv CentOS-*.repo into a backup dir — that’s all |
| ② | No package centos2anolis available | Not in the os tree; it’s in the official migration repo. Guessed epao paths all 404 |
| ③ | Requires: python36-psutil | Local rpm from the EPEL7 archive; the python3 dependency comes from the os tree |
| ④ | Tool fails downloading from openanolis.org | The el7 build hard-codes the dead domain in 6 places (L63/67/73/79/85/308), sed to .cn |
| ⑤ | distro-sync reports Error: Package: systemd-219-78.5.an7… | Disable the [Imigration] repo during migration (conflicts with the os tree) |
| ⑥ | Re-run says You are already using Anolis OS. (RC=102) | Interrupted state with anolis-release already installed; finish with a manual yum -y distro-sync |
| ⑦ | First boot hangs for minutes, no network, no login prompt (serial shows url_helper …100.100.100.200 WARNING) | cloud-init Aliyun datasource; write datasource_list: [None] |
| ⑧ | rpm -q kernel shows no ANCK / boots 3.10 | See “kernel truth” below |
Kernel truth: the 7-line migration lands the an7 rebuild of 3.10
Section titled “Kernel truth: the 7-line migration lands the an7 rebuild of 3.10”SIG documentation says ANCK is installed by default. The measured chain: the tool really does install kernel-4.19.91-28.2.an7 first (an Installed record exists in yum.log), but after the full distro-sync convergence the system retains only the an7 rebuild 3.10.0-1160.119.1.0.1.an7 as its one bootable kernel (the 4.19 /boot files, /lib/modules and rpm records vanished with no matching Erase line in yum.log — a non-yum deletion; recorded as-is as an anomaly). Base your migration acceptance on the actual uname -r containing .an7, not on an expectation of “upgraded to 4.19” — the 7 line differs from the 8 line: on 8 the migration really does land ANCK 4.19 (see the 8→8 migration log page), while on 7 the major version stays 3.10, internally rebuilt as an7.
Migration time and scale
Section titled “Migration time and scale”| Phase | Measured |
|---|---|
| Setup (repo location, psutil archive, dead-domain sed) | Hours when hitting the pitfalls first; 10 minutes with this page |
| yum install centos2anolis + psutil | Minutes |
| centos2anolis.py repo + release switch | Minutes |
| Full distro-sync transaction | ~10 minutes (Swapped 286 / Installed 248 / Updated 20, on a 2C/2G VM) |
| First-boot acceptance (after the cloud-init fix) | 12-step journey |
Boundary statement
Section titled “Boundary statement”Verified on the machine: repo switch, distro-sync, reboot, network/SSH recovery, repo reachability (12-step journey, all pass). Not covered: application-level smoke (databases/middleware); this run booted with selinux=0 (SELinux policy loads normally after migration, but the full Enforcing service matrix was not re-validated); the disappearance path of ANCK 4.19 was not traced frame by frame (recorded as an anomaly). Rollback via the pre-migration-c7 snapshot (verified restorable).