/usr/local/qcloud/pythonにインストールされた、cloud-initオペレーティング環境にのみ使用される個別のpython環境です。システムでのデフォルトのpythonと競合しません。タイプ | OS | バージョン | x86_64 | arm64 | ||
| | | qcloud-python | cloud-init | qcloud-python | cloud-init |
rpm | CentOS | 7 | ||||
| | 8 | ||||
| Fedora | 36 | NA | NA | ||
| Kylin | 20sp1 | ||||
| openSUSE | 15.4 | NA | NA | ||
deb | Debian | 11 | ||||
| | 10 | NA | NA | ||
| | 9 | NA | NA | ||
| | 8 | NA | NA | ||
| Ubuntu | 22.04 | NA | NA | ||
| | 20.04 | ||||
| | 18.04 | ||||
| | 16.04 | NA | NA | ||
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' コマンドを実行して、requests 2.20.0以前のバージョンをインストールしてください。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
/etc/cloud/cloud.cfg の内容を、ダウンロードしたcloud.cfgファイルの内容に置き換えます。useradd syslog
strings /sbin/init | grep "/lib/system"コマンドを実行できます。メッセージが返された場合は、OSがsystemdを使用していることを意味します。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
[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
[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"コマンドを実行できます。メッセージが返された場合は、OSがsysvinitを使用していることを意味します。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
/etc/cloud/cloud.cfg の内容を、ダウンロードしたcloud.cfgファイルの内容に置き換えます。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の内容を次のように変更します:# 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
フィードバック