openstack在从images创建实例的时候报错
openstack server create --flavor 0f29be3e-089d-4339-88c1-28b4edf3778b --image df4a76af-1dad-43cc-95c5-6700fee1374d --security-group 1e4171d0-52b9-486b-bb6f-50993ab69603 --key-name mima --user-data cloudinit.file myCirrosServer时报错
'ascii' codec can't decode byte 0xe6 in position 10: ordinal not in range(128)
问题原因,ascii编码方式不能编码其他的内容
解决:更换编码方式
在 cd /usr/lib/python2.7/site-packages/目录下新建一个文件sitecustomize.py
内容为
# sitecustomize.py
# this file can be anywhere in your Python path,
# but it usually goes in ${pythondir}/lib/site-packages/
import sys
sys.setdefaultencoding('utf-8')
再创建实例就行了