提示“call migration failed”时,表示不满足迁移条件,请根据步骤
6
自动处理相关异常信息。Error Number及其对应错误信息请参见
表2
。
10002
URL存在问题,/etc/centos2hce2.conf配置文件中web_link_dir、web_link_tar参数填写有误导致无法下载对应repo文件、rpm文件,或者无法连通。
10003
基础命令缺失,例如rpm、yum、yumdownloader命令。
10004
空间检查失败,磁盘空间不足或者内存大小不足。
10005
原系统无本地yum源或者yum源不通,需要重新配置。
10006
目标系统yum源配置有误,检查/etc/centos2hce2.conf配置文件中web_link_dir参数填写是否有误。
10007
安装sut失败,检查/etc/centos2hce2.conf配置文件中web_link_dir参数填写是否有误。
10008
sut检查失败。
10009
依赖检查失败,需要先执行centos2hce2.py --install all安装依赖。
10010
chroot升级方式,清理原有chroot文件夹失败,文件夹路径见/etc/centos2hce2.conf配置文件中的chroot_path。
10011
chroot路径配置错误,/etc/centos2hce2.conf配置文件中chroot_path配置有误。
10012
chroot升级方式,并且配置了预构建环境tar包下载地址,解压tar包失败,检查/etc/centos2hce2.conf配置文件中的web_link_tar参数是否有误。
10013
/etc/ld.so.conf检查失败,需要清理/etc/ld.so.conf文件中除“include ld.so.conf.d/*.conf”之外的字段。
10014
文件系统存在损坏或异常,需要修复。
10015
/etc/fstab文件挂载目录不符合标准,需要将/etc/fstab文件中非LVM卷格式的文件系统分区以UUID进行挂载。
10016
开启文件属性检查后,系统内存在Immutable/Append_Only属性的文件,对于检查出的文件,需要加入到/etc/centos2hce2.conf配置文件中的exclude_dir字段。
10017
/etc/sysconfig/ntpd文件存在-u ntp:ntp配置,需要删除/etc/sysconfig/ntpd文件中-u ntp:ntp字段。
10018
/etc/ssh/sshd_config配置文件末尾无换行,需要在/etc/ssh/sshd_config文件末尾加入换行符号。
10019
系统中含有重复的rpm包,请先卸载不再使用的低版本rpm包后再次检查。(如果不想卸载重复包例如多内核场景kernel、kernel-devel等,直接进行升级,可以通过配置/etc/centos2hce2.conf文件中的extra_check_switch = false选项,跳过额外检查。)
7. (可选) 重复备份。
执行
/usr/bin/cloud-init init --local
命令,无错误发生,说明Cloud-init配置成功。
正确安装的Cloud-init会显示Cloud-init的版本详细信息,并且无任何错误信息。
(可选)因迁移时会自动关闭selinux服务,如迁移后需启用selinux,执行
centos2hce2.py --precommit upg-selinux
命令。此命令分为两个阶段,每次执行后都需重启系统(若迁移前未开启selinux请忽略此步骤)。
执行
centos2hce2.py --precommit upg-selinux
命令。
[root@localhost ~]# centos2hce2.py --precommit upg-selinux
2022-08-21 23:46:23,891-INFO-centos2hce2.py-[line:1239]: precommit migration
2022-08-21 23:46:23,891-INFO-centos2hce2.py-[line:1149]: begin to set selinux
2022-08-21 23:46:23,892-INFO-centos2hce2.py-[line:1157]: grub path is /boot/grub2/grub.cfg
2022-08-21 23:46:23,895-INFO-centos2hce2.py-[line:1162]: sed selinux succeed
2022-08-21 23:46:23,897-INFO-centos2hce2.py-[line:1167]: create autorelabel file succeed
2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1172]: modify selinux config succeed
2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1174]: create phase 1 flag file succeed
2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1184]: selinux has been set, please reboot now
2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1206]: upgrade precommit selinux success
[root@localhost ~]# reboot
系统重启后,再次执行
centos2hce2.py --precommit upg-selinux
命令。
[root@localhost ~]# centos2hce2.py --precommit upg-selinux
2022-08-21 23:57:07,576-INFO-centos2hce2.py-[line:1239]: precommit migration
2022-08-21 23:57:07,576-INFO-centos2hce2.py-[line:1176]: now begin to set selinux phase 2
2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1181]: modify selinux config succeed
2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1183]: create phase 2 flag file succeed
2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1184]: selinux has been set, please reboot now
2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1206]: upgrade precommit selinux success
[root@localhost ~]# reboot
c.第二次重启后,执行
getenforce
查看selinux状态,Enforcing表明selinux为开启状态。
[root@localhost ~]# getenforce
Enforcing