What Should I Do If Cloud-Init Does Not Work After Python Is Upgraded?
Symptom
Take an ECS running CentOS 6.8 as an example. After Python was upgraded from 2.6 to 2.7, Cloud-Init did not work. Data, such as the login password, key, and hostname could not be imported to the ECS using Cloud-Init.
After the cloud-init -v command was executed to view the Cloud-Init version, the system displayed errors, as shown in Figure 1.
Possible Causes
The Python version used by Cloud-Init was incorrect.
Solution
Change the Python version used by Cloud-Init to the source version. To do so, change the environment variable value of /usr/bin/cloud-init from the default value #!/usr/bin/python to #!/usr/bin/python2.6.
![Click to enlarge](https://support.huaweicloud.com/intl/en-us/ecs_faq/en-us_image_0123417484.jpg)
Key Pairs FAQs
- How Can I Obtain the Key Pair Used by My ECS?
- How Can I Use a Key Pair?
- Can I Download a Key Pair from My Phone?
- What Should I Do If a Key Pair Cannot Be Imported?
- Why Does the Login to My Linux ECS Using a Key File Fail?
- What Should I Do If I Cannot Download a Key Pair?
- Why Does a Key Pair Created Using puttygen.exe Fail to Be Imported on the Management Console?
- What Is the Cloudbase-Init Account in Windows ECSs Used for?
- What Should I Do If Cloud-Init Does Not Work After Python Is Upgraded?
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.
Chatbotmore