/usr/local/qcloud/python
, and it does not conflict with the default python in the system.Type | OS | Version | x86_64 | arm64 | ||
| | | qcloud-python | cloud-init | qcloud-python | cloud-init |
rpm | CentOS | 7 | ||||
| | 8 | ||||
| Fedora | 36 | N/A | N/A | ||
| Kylin | 20sp1 | ||||
| openSUSE | 15.4 | N/A | N/A | ||
deb | Debian | 11 | ||||
| | 10 | N/A | N/A | ||
| | 9 | N/A | N/A | ||
| | 8 | N/A | N/A | ||
| Ubuntu | 22.04 | N/A | N/A | ||
| | 20.04 | ||||
| | 18.04 | ||||
| | 16.04 | N/A | N/A |
rm -rf /var/lib/cloudrm -rf /etc/cloudrm -rf /usr/local/bin/cloud*
dpkg -i *.deb
rpm -ivh *.rpm
cloud-init qcloud -v/usr/bin/cloud-init qcloud 0011
wget https://gerryguan-1306210569.cos.ap-chongqing.myqcloud.com/cloud-init/src/cloud-init-20.1.0011.tar.gz
tar -zxvf cloud-init-20.1.0011.tar.gz
cd cloud-init
yum install python3-pip -y
apt-get -y install python3-pip
python3 -m pip install --upgrade pip
pip install 'requests<2.20.0'
command to install requests 2.20.0 or later before installing the cloud-init dependencies.pip3 install -r requirements.txt
yum install cloud-utils-growpart dracut-modules-growroot -ydracut -f
yum install cloud-utils-growpart -y
apt-get install cloud-guest-utils -y
python3 setup.py build
python3 setup.py install --init-system systemd
--init-system
can be followed by any of systemd
, sysvinit
, sysvinit_deb
, sysvinit_freebsd
, sysvinit_openrc
, sysvinit_suse
, upstart
, or None
(default). Choose one according to the auto-start service management method of the operating system. Otherwise the cloud-init service cannot automatically start upon system startup.sysvinit
for the CentOS 6 and earlier versions, and select systemd
for CentOS 7 and later versions. This document uses systemd as an example./etc/cloud/cloud.cfg
with that of the downloaded cloud.cfg file.useradd syslog
strings /sbin/init | grep "/lib/system"
command, and you will receive a return message.ln -s /usr/local/bin/cloud-init /usr/bin/cloud-init
systemctl enable cloud-init-local.servicesystemctl start cloud-init-local.servicesystemctl enable cloud-init.servicesystemctl start cloud-init.servicesystemctl enable cloud-config.servicesystemctl start cloud-config.servicesystemctl enable cloud-final.servicesystemctl start cloud-final.servicesystemctl status cloud-init-local.servicesystemctl status cloud-init.servicesystemctl status cloud-config.servicesystemctl status cloud-final.service
/lib/systemd/system/cloud-init-local.service
with the following:[Unit]Description=Initial cloud-init job (pre-networking)Wants=network-pre.targetAfter=systemd-remount-fs.serviceBefore=NetworkManager.serviceBefore=network-pre.targetBefore=shutdown.targetConflicts=shutdown.targetRequiresMountsFor=/var/lib/cloud[Service]Type=oneshotExecStart=/usr/bin/cloud-init init --localExecStart=/bin/touch /run/cloud-init/network-config-readyRemainAfterExit=yesTimeoutSec=0# Output needs to appear in instance console outputStandardOutput=journal+console[Install]WantedBy=cloud-init.target
/lib/systemd/system/cloud-init.service
with the following:[Unit]Description=Initial cloud-init job (metadata service crawler)Wants=cloud-init-local.serviceWants=sshd-keygen.serviceWants=sshd.serviceAfter=cloud-init-local.serviceAfter=systemd-networkd-wait-online.serviceAfter=networking.serviceAfter=systemd-hostnamed.serviceBefore=network-online.targetBefore=sshd-keygen.serviceBefore=sshd.serviceBefore=systemd-user-sessions.serviceConflicts=shutdown.target[Service]Type=oneshotExecStart=/usr/bin/cloud-init initRemainAfterExit=yesTimeoutSec=0# Output needs to appear in instance console outputStandardOutput=journal+console[Install]WantedBy=cloud-init.target
strings /sbin/init | grep "sysvinit"
command, and you will receive a return message.chkconfig --add cloud-init-localchkconfig --add cloud-initchkconfig --add cloud-configchkconfig --add cloud-finalchkconfig cloud-init-local onchkconfig cloud-init onchkconfig cloud-config onchkconfig cloud-final on
apt-get/yum install cloud-init
apt-get
or yum
is the default cloud-init version in the software source configured for the operating system. Some configuration items of instances created by using the image whose cloud-init is installed this way may not be initialized as expected. Therefore, we recommend that you install the service by manually downloading the cloud-init source package./etc/cloud/cloud.cfg
with that of the downloaded cloud.cfg file.cloud-init init --local
Cloud-init v. 20.1.0011 running 'init-local' at Fri, 01 Apr 2022 01:26:11 +0000. Up 38.70 seconds.
rm -rf /var/lib/cloud
rm -rf /etc/network/interfaces.d/50-cloud-init.cfg
/etc/network/interfaces
to the following:# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*
yum install epel-release -y
yum install python3-pip -y
apt-get clean all
apt-get update -y
apt-get -y install python3-pip
Was this page helpful?