Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Migration Operations

Updated on 2024-09-14 GMT+08:00

Migrate CentOS 7.9 to HCE 1.1.

Preparing Dependent Packages

  1. Remotely connect to the source OS.

    Remotely log in to the ECS to be migrated and verify that it can be accessed from the Internet. For details, see Login Overview.

  2. Disable all repository configurations in /etc/yum.repos.d of CentOS. This ensures that the repositories of CentOS and HCE do not conflict.

    Take Centos_Base.repo as an example. Add enabled=0 under each item, as shown in the following figure.

  3. Configure the repository of HCE.
    Add the following content to hce.repo and then store it in the /etc/yum.repos.d/ directory:
    [centos7_everything]
    name=centos7_everything
    baseurl=https://repo.huaweicloud.com/hce/1.1/os/x86_64/
    enable=1
    gpgcheck=0
    priority=1
    
    #released updates
    [updates]
    name=hce1_updates
    baseurl=https://repo.huaweicloud.com/hce/1.1/updates/x86_64/
    gpgcheck=0
    enabled=1 
    gpgkey=
  4. Check whether CentOS 7.9 can access the repository of HCE.
    Run the curl https://repo.huaweicloud.com/hce/1.1/os/x86_64/ command to check whether the repository of HCE can be accessed. If information similar to the following is displayed, the repository can be accessed:
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    Dload  Upload   Total   Spent    Left  Speed
    100  3417    0  3417    0     0    373      0 --:--:--  0:00:09 --:--:--   696
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet"  href="/repository/static/css/style.css" type="text/css"/>
    <style>
    * {
    font-family: 'Verdana', sans-serif;
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    }
    ......
  5. Install Python 3.0.
    [root@localhost ~]#  yum install -y python 3 //Run this command in any directory you want.
    NOTE:

    If Python 3 has been installed on CentOS 7.9, skip this step.

  6. Disable SELinux.
    To ensure that system configuration files are consistent before and after the migration, SELinux needs to be disabled.
    1. Modify the /etc/selinux/config file by changing the value of SELINUX to disabled.
      SELINUX=disabled
    2. Restart the OS to apply the changes.

Installing the Migration Tool

  1. Download tool package centos2hce1-*.rpm from the Huawei Cloud open-source image site. Contact customer service to obtain the download link from O&M engineers.
    The asterisk (*) indicates the version of the migration tool. In this example, centos2hce1-1.0.0-0.0.2.x86_64.rpm is used.
    [root@localhost test]# wget https://repo.huaweicloud.com/hce/1.1/updates/x86_64/Packages/centos2hce1-1.0.0-0.0.2.x86_64.rpm    //Download the centos2hce1-*.rpm package.
    [root@localhost test]# ls  //Check whether the download is successful.
    centos2hce1-1.0.0-0.0.2.x86_64.rpm  
  2. Install the migration tool.
    After the tool has been installed, the system automatically generates the /etc/centos2hce1.conf file.
    [root@localhost ~]# rpm -ivh centos2hce1-1.0.0-0.0.2.x86_64.rpm
  3. Configure the centos2hce1.conf file.

    Configure the repository of HCE. It will be used for checking whether the repository can be accessed and updating RPM packages.

    #iso as yum source link
    [repo_info]
    base_yum_url =https://repo.huaweicloud.com/hce/1.1/os/x86_64/
    
    #iso as yum source
    repostr_hce1_1 =
    [base]
    name=hceversion
    baseurl=https://repo.huaweicloud.com/hce/1.1/os/x86_64/
    gpgcheck=0
    enabled=1
    #released updates
    [updates]
    name=hce1_updates
    baseurl=https://repo.huaweicloud.com/hce/1.1/updates/x86_64/
    gpgcheck=0
    enabled=1
    gpgkey=
    NOTE:

    To learn more about the parameters in the centos2hce1.conf file, see Appendix: Description of the .conf File.

Migrating the OS

  1. Back up the OS.

    The migration to HCE 1.1 cannot be rolled back. Before performing the migration, you should back up CentOS including its system disk and data disks.

  2. Run the centos2hce1.py command to migrate the OS.
    The migration takes 20 minutes to 1 hour, depending on the number and size of RPM packages to be updated and the download speed of RPM packages from the repository. Reserve sufficient time for the migration based on your environment.
    [root@localhost home]# centos2hce1.py

    If the following information is displayed, the migration was complete. If the migration failed, use the backup to restore data.

    NOTE:

    CentOS contains some RPM packages that are not provided by HCE 1.1. After you run the centos2hce1.py command to migrate the OS, these RPM packages are automatically deleted. If you want to retain them, run the -s skip command to migrate the OS.

  3. (Optional) Delete unnecessary RPM packages.

    The following two RPM packages are not used during the migration and do not affect how the system runs. You can just delete them.

  4. Run the reboot command to restart the OS.
  5. Run the cat /etc/os-release command to check whether the migration was successful.

    If the following information is displayed, the migration was successful.

  6. (Optional) Enable SELinux.
    SELinux was disabled before the OS migration. Enable it if needed.
    1. Modify the /etc/selinux/config file by changing the value of SELINUX to enforcing.
      SELINUX=enforcing
    2. Restart the OS to apply the changes.

Appendix: Description of the .conf File

#rpm lists for os migration
[rpm_lists]
#origin system must need rpms
baserpms_list = "basesystem initscripts hce-logos plymouth grub2 grubby"  //The RPM packages required for the OS migration.

#old rpm and default conflict rpms  //The conflicting RPM packages that may exist in the source OS during the migration.
oldrpms_list =  centos-backgrounds centos-release-cr desktop-backgrounds-basic \
centos-release-advanced-virtualization centos-release-ansible26 centos-release-ansible-27 \
centos-release-ansible-28 centos-release-ansible-29 centos-release-azure \
centos-release-ceph-jewel centos-release-ceph-luminous centos-release-ceph-nautilus \
centos-release-ceph-octopus centos-release-configmanagement centos-release-dotnet centos-release-fdio \
centos-release-gluster40 centos-release-gluster41 centos-release-gluster5 \
centos-release-gluster6 centos-release-gluster7 centos-release-gluster8 \
centos-release-gluster-legacy centos-release-messaging centos-release-nfs-ganesha28 \
centos-release-nfs-ganesha30 centos-release-nfv-common \
centos-release-nfv-openvswitch centos-release-openshift-origin centos-release-openstack-queens \
centos-release-openstack-rocky centos-release-openstack-stein centos-release-openstack-train \
centos-release-openstack-ussuri centos-release-opstools centos-release-ovirt42 centos-release-ovirt43 \
centos-release-ovirt44 centos-release-paas-common centos-release-qemu-ev centos-release-qpid-proton \
centos-release-rabbitmq-38 centos-release-samba411 centos-release-samba412 \
centos-release-scl centos-release-scl-rh centos-release-storage-common \
centos-release-virt-common centos-release-xen centos-release-xen-410 \
centos-release-xen-412 centos-release-xen-46 centos-release-xen-48 centos-release-xen-common \
python3-syspurpose python-oauth sl-logos yum-rhn-plugin centos-indexhtml \
libreport-centos libreport-web libreport-plugin-mantisbt libreport-plugin-rhtsupport \
libreport hunspell-en-US hunspell-en policycoreutils-gui libcanberra-gtk2 cups \
NetworkManager-libreswan-gnome plymouth-graphics-libs avahi cups-lpd pinentry-qt \
librsvg2-devel libcanberra-gtk3 gnome-themes-standard wodim gsettings-desktop-schemas-devel \
avahi-ui-gtk3 freerdp-libs pulseaudio-utils gstreamer1-plugins-bad-free-gtk ghostscript-cups \
setools-console libxkbcommon-x11 cups plymouth-plugin-two-step pulseaudio-module-x11 ImageMagick-c++ \
cups-devel policycoreutils-sandbox PackageKit-gstreamer-plugin gtk3-immodule-xim avahi-glib avahi-autoipd \
mesa-libGLES foomatic libcanberra-devel plymouth-plugin-label PackageKit-gtk3-module colord avahi-gobject \
pinentry-qt4 avahi-ui-gtk3 plymouth-plugin-two-step ghostscript-cups ImageMagick-perl firewall-config \
plymouth-plugin-label redhat-redhat-lsb-corelsb vim-X11 dbus-x11 pulseaudio PackageKit-command-not-found libproxy-mozjs \
pinentry-gtk nm-connection-editor gtk2-immodule-xim wireshark-gnome pulseaudio-module-bluetooth pidgin-sipe freerdp kmod-kvdo  \
redhat-lsb-core

#The following list contains the same symbol as centos/redhat
dstrpms_list = "hce-release hce-repos"

[log_conf]
# migration tool log common dir
migrate_common_dir = "/var/log/migrate-tool/"    //The path for storing logs.

# migration tool classification log dir
migrate_classification_dir = %(migrate_common_dir)s/centos2hce1/

#iso as yum source link
[repo_info]
base_yum_url =https://repo.huaweicloud.com/hce/1.1/os/x86_64/  //The base yum URL used for checking the network connection.


#iso as yum source
repostr_hce1_1 =     //The source path that provides the migration method.
[base]
name=hceversion
baseurl=https://repo.huaweicloud.com/hce/1.1/os/x86_64/   //The base yum URL used for obtaining the RPM packages.
gpgcheck=0
enabled=1
gpgkey=

#released updates
[updates]
name=hce1_updates
baseurl=
gpgcheck=0
enabled=0
gpgkey=

#additional packages that may be useful
[extras]
name=hce1_extras
baseurl=
gpgcheck=0
enabled=0
gpgkey=

# plus packages provided by Huawei Linux dev team
[plus]
name=hce1_plus
baseurl=
gpgcheck=0
enabled=0
gpgkey=

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback