Skip to content
Search Anolis OS

    Browse this documentation

    CentOS 7 to Anolis OS 7 with centos2anolis: a real migration log (eight pitfalls and the kernel truth)

    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).

    DimensionBefore (CentOS)After (Anolis OS 7.9, measured)
    /etc/*-releaseCentOS Linux release 7.9.2009Anolis OS release 7.9
    PRETTY_NAMECentOS Linux 7.9.2009Anolis OS 7.9
    Running kernel3.10.0-1160.80.1.el73.10.0-1160.119.1.0.1.an7
    glibc2.17 (el7)2.17-326.an7.3 (an7 rebuild)
    openssl1.0.2k (el7)1.0.2k-26.an7 (an7 rebuild)
    Enabled reposCentOS-*.repo (dead mirrorlist)AnolisOS-7.9 os/updates/extras (11,524 packages)
    sshdactiveactive

    Before: CentOS 7.9 console (VM 433)

    Before: stock CentOS repo inventory (the starting point of pit ① — the mirrorlist.centos.org era)

    After: Anolis OS 7.9 login banner (an7 rebuilt kernel)

    After: network and repos ready

    Terminal window
    # 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 empty
    qm snapshot <vmid> pre-migration # always snapshot VMs first
    mkdir -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.repo
    curl -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.rpm
    curl -fsS -o /etc/yum.repos.d/anolis-migration.repo \
    https://mirrors.openanolis.cn/migration/anolis-migration.repo
    yum 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.py
    sed -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-sync
    mv /etc/yum.repos.d/CentOS-*.repo /root/repo-backup/ 2>/dev/null
    yum -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 + verify
    reboot
    grubby --default-kernel # expect the an7 rebuild (see "kernel truth")
    cat /etc/os-release; uname -r
    #SymptomFix
    ①Couldn't resolve host: mirrorlist.centos.orgDead. mv CentOS-*.repo into a backup dir — that’s all
    ②No package centos2anolis availableNot in the os tree; it’s in the official migration repo. Guessed epao paths all 404
    ③Requires: python36-psutilLocal rpm from the EPEL7 archive; the python3 dependency comes from the os tree
    ④Tool fails downloading from openanolis.orgThe 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.10See “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.

    PhaseMeasured
    Setup (repo location, psutil archive, dead-domain sed)Hours when hitting the pitfalls first; 10 minutes with this page
    yum install centos2anolis + psutilMinutes
    centos2anolis.py repo + release switchMinutes
    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

    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).