What Are Common Problems During Cloud-Init Installation?
You are advised to install Cloud-Init after the restoration to ensure the new server restored by using backups support custom configurations.
To install Cloud-Init, see section "Installing Cloud-Init" in the Image Management Service User Guide.
To configure Cloud-Init, see section "Configuring Cloud-Init" in the Image Management Service User Guide.
This section illustrates the FAQs encountered when installing Cloud-Init and their solutions.
Ubuntu 16.04/CentOS 7: Failed to Set Cloud-Init Automatic Start
- Symptom
After Cloud-Init is installed, run the following command to set Cloud-Init automatic start:
systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
Information similar to the following is displayed:
Figure 1 Failed to set Cloud-Init automatic start
- Solution
- Run the following command:
systemctl unmask cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
- Run the following commands to set automatic start again:
systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
- Run the following commands to check the Cloud-Init status:
systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
As shown in the following figures, failed is displayed and all services are in the inactive state.
This is because the address that the system uses to access Cloud-Init is redirected to /usr/bin/, but the actual installation path is /usr/local/bin.
Figure 2 Checking Cloud-Init status
Figure 3 Checking Cloud-Init status
- Run the cp /usr/local/cloud-init /usr/bin/ command to copy the cloud-init file to the usr/bin directory, and then run the following command to restart Cloud-Init:
# systemctl restart cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
Figure 4 Restarting Cloud-Init
- Run the following commands to check the Cloud-Init status:
systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
- Run the following command:
Ubuntu14.04: chkconfig and systemctl Not Installed
- Symptom
- Solution
Run the following commands to install chkconfig:
# apt-get update
# apt-get install sysv-rc-conf
# cp /usr/sbin/sysv-rc-conf /usr/sbin/chkconfig
After the installation completes, run the following command to query the Cloud-Init version:
cloud-init -v
Information similar to the following is displayed:
-bash:/usr/bin/cloud-init:not found this command
Solution: Run the following command to copy the cloud-init file to the usr/bin directory:
# cp /usr/local/bin/cloud-init /usr/bin/
Debian 9.5: Failed to Query the Cloud-Init Version and Set Automatic Start
- After Cloud-Init is installed, run the following command to query its version:
Information similar to the following is displayed:
-bash:/usr/bin/cloud-init:not found this command
Solution: Run the # cp /usr/local/bin/cloud-init /usr/bin/ command to copy the cloud-init file to the usr/bin directory.
- Run the cloud-init init --local command.
Information similar to the following is displayed:
Figure 5 Information returned when Cloud-Init automatic start is successfully set
Cause analysis: The compilation fails because the GNU compiler collection (GCC) is not installed.
Solution
After GCC is installed, run the following command to install Cloud-Init:
yum -y install gcc
- After Cloud-Init is installed, run the following command to set Cloud-Init automatic start:
systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
Information similar to the following is displayed:
Figure 6 Failed to set Cloud-Init automatic start
Solution
- Run the following command:
# systemctl unmask cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
- Run the following commands to set automatic start again:
# systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
- Run the following command to restart Cloud-Init:
# systemctl restart cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
Run the systemctl status command to check the Cloud-Init status. Information similar to the following is displayed:
Figure 7 Checking the Cloud-Init status
- Run the following command:
CentOS 7/Fedora 28: Required C Compiler Not Installed
- Symptom
After Cloud-Init is installed, run the following command:
cloud-init init --local
The following information is displayed:
/usr/lib/python2.5/site-packages/Cheetah/Compiler.py:1532: UserWarning: You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper. "\nYou don't have the C version of NameMapper installed!
- Possible Cause
This alarm is generated because the C version of NameMapper needs to be compiled when installing Cloud-Init. However, GCC is not installed in the system, and the compilation cannot be performed. As a result, the C version of NameMapper is missing.
- Solution
Run the following command to install GCC:
yum -y install gcc
Reinstall Cloud-Init.
CentOS 7/Fedora: Failed to Use the New Password to Log In to the Server Created from a Backup After Cloud-Init Is Successfully Installed
- Symptom
After Cloud-Init is installed, the new password cannot be used to start the new server. After logging in to the server using the old password, you find the NIC is not started.
Figure 8 NIC not started
- Solution
Log in to the server, open the DHCP configuration file /etc/sysconfig/network-scripts/ifcfg-ethX, and comment out HWADDR.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot