El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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
Situation Awareness
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
Help Center/ Bare Metal Server/ Private Image Creation Guide/ Linux/ Installing Cloud-Init/ SUSE/Red Hat/CentOS/Oracle Linux/Ubuntu/Debian

SUSE/Red Hat/CentOS/Oracle Linux/Ubuntu/Debian

Updated on 2025-01-27 GMT+08:00

You can install Cloud-Init in any of the following ways: (Recommended) Install Cloud-Init Using the Official Installation Package, Install Cloud-Init Using the Official Source Code Package and pip, and Install Cloud-Init Using the Compiled Source Code.

(Recommended) Install Cloud-Init Using the Official Installation Package

The method of installing Cloud-Init on a VM varies depending on the OS. Perform the installation operations as user root.

The following describes how to install Cloud-Init on VMs running SUSE, CentOS, Debian, and Ubuntu. For other OS types, install the required type of Cloud-Init. For example, you need to install coreos-cloudinit on VMs running CoreOS.

  • SUSE Linux

    Paths for obtaining the Cloud-Init installation package for SUSE Linux

    http://ftp5.gwdg.de/pub/opensuse/repositories/Cloud:/Tools/

    http://download.opensuse.org/repositories/Cloud:/Tools/

    NOTE:

    Select the required repo installation package in the provided paths.

    Take SUSE Enterprise Linux Server 12 as an example. Perform the following steps to install Cloud-Init:

    1. Run the following command to install the network installation source for SUSE Enterprise Linux Server 12:

      zypper ar http://ftp5.gwdg.de/pub/opensuse/repositories/Cloud:/Tools/SLE_12_SP3/Cloud:Tools.repo

    2. Run the following command to update the network installation source:

      zypper refresh

    3. Run the following command to install Cloud-Init:

      zypper install cloud-init

    4. Run the following commands to enable Cloud-Init to automatically start upon system boot:
      • SUSE 11

        chkconfig cloud-init-local on; chkconfig cloud-init on; chkconfig cloud-config on; chkconfig cloud-final on

        service cloud-init-local status; service cloud-init status; service cloud-config status; service cloud-final status

      • SUSE 12 and openSUSE 12/13/42

        systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service

        systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service

      NOTICE:

      For SUSE and openSUSE, perform the following steps to disable dynamic change of the VM name:

      1. Run the following command to open the dhcp file using the vi editor:

        vi etc/sysconfig/network/dhcp

      2. Change the value of DHCLIENT_SET_HOSTNAME in the dhcp file to no.
  • CentOS

    Table 1 lists the Cloud-Init installation paths for CentOS. Select an address from the following table and download the EPEL release package.

    Run the following commands to install Cloud-Init on a VM running CentOS 6.5 64-bit (example):

    yum install https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/Packages/e/epel-release-xx-xx.noarch.rpm

    yum install cloud-init

    NOTE:

    xx-xx indicates the version of Extra Packages for Enterprise Linux (EPEL) release required by the OS.

  • Debian

    Before installing Cloud-Init, ensure that the network installation source address has been configured for the OS by checking whether the /etc/apt/sources.list file contains the installation source address of the software package. If the file does not contain the address, configure the address by following the instructions on the Debian official website.

    Run the following commands to install Cloud-Init:

    apt-get update

    apt-get install cloud-init

    After Cloud-Init is installed in the Debian OS, run the following commands to install the vlan and ifenslave services:

    apt-get install vlan

    apt-get install ifenslave

  • Ubuntu

    Before installing Cloud-Init, ensure that the network installation source address has been configured for the OS by checking whether the /etc/apt/sources.list file contains the installation source address of the software package. If the file does not contain the address, configure the address by following the instructions on the Ubuntu official website.

    Run the following commands to install Cloud-Init:

    apt-get update

    apt-get install cloud-init

    After Cloud-Init is installed in the Ubuntu OS, perform the following operations to install tools and services:

    1. Install the SSH service.

      For x86, run the following commands:

      apt-get install openssh-client

      apt-get install openssh-server

      For ARM64, run the following commands:

      apt install openssh-client

      apt install openssh-server

    2. Install dkms.

      To ensure that SDI drivers can run properly, you need to install dkms for Ubuntu.

      Run the following command to install the tool:

      apt-get install dkms

      Then, run the following command:

      vi /usr/sbin/dkms

      Go to line 283 (press shift and : to enter the CLI mode. Then, type 283 and press Enter) and modify this line as follows:

      invoke_command "$mkinitrd -f $initrd_dir/$initrd $1" "$mkinitrd" background
    3. Install the vlan and ifenslave services.

      apt-get install vlan

      apt-get install ifenslave

    4. Install the ifupdown service.

      apt-get install ifupdown

Install Cloud-Init Using the Official Source Code Package and pip

The following operations use Cloud-Init 0.7.9 as an example to describe how to install Cloud-Init.

  1. Download the cloud-init-0.7.9.tar.gz source code package (version 0.7.9 is recommended) and upload it to the /home/ directory of the VM.

    Download cloud-init-0.7.9.tar.gz from the following path:

    https://launchpad.net/cloud-init/trunk/0.7.9/+download/cloud-init-0.7.9.tar.gz

  2. Create a pip.conf file in the ~/.pip/ directory and edit the following content:
    NOTE:

    If the ~/.pip/ directory does not exist, run the mkdir ~/.pip command to create it.

    [global]
    index-url  = https://<$mirror>/simple/
    trusted-host = <$mirror>
    NOTE:

    Replace <$mirror> with a public network PyPI source.

    Public network PyPI source: https://pypi.python.org/

  3. Run the following command to install the downloaded Cloud-Init source code package (select --upgrade as needed during installation):

    pip install [--upgrade] /home/cloud-init-0.7.9.tar.gz

  4. Run the cloud-init -v command. Cloud-Init is installed successfully if the following information is displayed:
    cloud-init 0.7.9
  5. Enable Cloud-Init to automatically start upon system boot.
    • If the OS uses SysVinit to manage automatic start of services, run the following commands:

      chkconfig --add cloud-init-local; chkconfig --add cloud-init; chkconfig --add cloud-config; chkconfig --add cloud-final

      chkconfig cloud-init-local on; chkconfig cloud-init on; chkconfig cloud-config on; chkconfig cloud-final on

      service cloud-init-local status; service cloud-init status; service cloud-config status; service cloud-final status

    • If the OS uses Systemd to manage automatic start of services, run the following commands:

      systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service

      systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service

NOTICE:

If you install Cloud-Init using the official source code package and pip, pay attention to the following:

  1. Add user syslog to the adm group during the installation. If user syslog exists, add it to the adm group. For some OSs (such as CentOS and SUSE), user syslog may not exist. Run the following commands to create user syslog and add it to the adm group:

    useradd syslog

    groupadd adm

    usermod -g adm syslog

  2. Change the value of distro in system_info in the /etc/cloud/cloud.cfg file based on the OS release version, such as distro: ubuntu, distro: sles, distro: debian, and distro: fedora.

Install Cloud-Init Using the Compiled Source Code

The Cloud-Init configuration has been compiled in the source code. Therefore, you do not need to configure Cloud-Init after the installation. You can obtain the Cloud-Init source code from GitHub at https://github.com/canonical/cloud-init/

  1. Run the following commands to download the Cloud-Init package and copy it to the /tmp/CLOUD-INIT folder:
    NOTE:

    Cloud-Init 0.7.6: https://github.com/canonical/cloud-init/archive/refs/tags/0.7.6.zip

    Cloud-Init 0.7.9: https://github.com/canonical/cloud-init/archive/refs/tags/0.7.9.zip

    wget https://github.com/canonical/cloud-init/archive/refs/tags/0.7.9.zip

    mkdir /tmp/CLOUD-INIT

    cp cloud-init-0.7.9.zip /tmp/CLOUD-INIT

    cd /tmp/CLOUD-INIT

  2. Run the following command to decompress the package:

    unzip cloud-init-0.7.9.zip

  3. Run the following command to enter the cloud-init-0.7.9 directory:

    cd cloud-init-0.7.9

  4. Install the Cloud-Init package. The commands vary depending on the OS type.
    • For CentOS 6.x or SUSE 11.x, run the following commands:

      python setup.py build

      python setup.py install --init-system sysvinit

    • For CentOS 7.x, SUSE 12.x, or EulerOS 2.8 ARM, run the following commands:

      python setup.py build

      python setup.py install --init-system systemd

    NOTICE:

    Add user syslog to the adm group during the installation. If user syslog exists, add it to the adm group. For some OSs (such as CentOS and SUSE), user syslog may not exist. Run the following commands to create user syslog and add it to the adm group:

    useradd syslog

    groupadd adm

    usermod -g adm syslog

  5. Enable Cloud-Init to automatically start upon system boot.
    • If the OS uses SysVinit to manage automatic start of services, run the following commands:

      chkconfig --add cloud-init-local; chkconfig --add cloud-init; chkconfig --add cloud-config; chkconfig --add cloud-final

      chkconfig cloud-init-local on; chkconfig cloud-init on; chkconfig cloud-config on; chkconfig cloud-final on

      service cloud-init-local status; service cloud-init status; service cloud-config status; service cloud-final status

    • If the OS uses Systemd to manage automatic start of services, run the following commands:

      systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service

      systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service

  6. Run the following commands to check whether Cloud-Init has been installed:

    cloud-init -v

    cloud-init init --local

    Cloud-Init is successfully installed if the following information is displayed:

    cloud-init 0.7.9

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback