安装ConVirt的时候到执行下面命令的时候报错了,在网上找了半天都没有找到解决办法.....也许是用汉化版本的少吧!不过好在总算解决了,汉化版本的问题。没有用英文版,不知道英文版是不是有同样的错误!顺便记录下,留给有同样错误的朋友。。

[root@CMS ~]# ./convirt-install/install/cms/scripts/setup_convirt
Setting up ConVirt with : /usr/local/convirt/tg2env/usr/local/convirt/tg2env/lib/python2.6/site-packages/PEAK_Rules-0.5a1.dev_r2582-py2.6.egg/peak/rules/indexing.py:220: DeprecationWarning: object.__new__() takes no parameters/usr/local/convirt/tg2env/lib/python2.6/site-packages/ToscaWidgets-0.9.4-py2.6.egg/tw/core/view.py:202: DeprecationWarning: object.__new__() takes no parameters  obj = object.__new__(cls, *args, **kw)Traceback (most recent call last):  File "/usr/local/convirt/tg2env/bin/paster", line 9, in <module>    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run    invoke(command, command_name, options, args[1:])  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke    exit_code = runner.run(args)  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 68, in run    return super(AbstractInstallCommand, self).run(new_args)  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run    result = self.command()  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 456, in command    self, config_file, section, self.sysconfig_install_vars(installer))  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 591, in setup_config    mod = import_string.try_import_module(mod_name)  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/Paste-1.7.2-py2.6.egg/paste/util/import_string.py", line 81, in try_import_module    return import_module(module_name)  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/Paste-1.7.2-py2.6.egg/paste/util/import_string.py", line 67, in import_module    mod = __import__(s)  File "/usr/local/convirt/src/convirt/web/convirt/convirt/websetup.py", line 124SyntaxError: Non-ASCII character '\xe6' in file /usr/local/convirt/src/convirt/web/convirt/convirt/websetup.py on line 124, but no encoding declared; see http://www.python.org/peps/pep-0263.html for detailsError setting up ConVirt. ERROR: running convirt-ctl setup.ERROR: Failed setting up convirt package.


——解决办法:

1)编辑convirt的解压目录的websetup.py文件,我的convirt的解压目录是在/usr/local目录下

将# -*- coding: utf-8 -*-这一行放到第一行,保存/退出。如下:

[root@CMS ~]# vi /usr/local/convirt/src/convirt/web/convirt/convirt/websetup.py
# -*- coding: utf-8 -*-#   ConVirt   -  Copyright (c) 2009 Convirture Corp.#   ======## ConVirt is a Virtualization management tool with a graphical user# interface that allows for performing the standard set of VM operations# (start, stop, pause, kill, shutdown, reboot, snapshot, etc...). It# also attempts to simplify various aspects of VM lifecycle management.### This software is subject to the GNU General Public License, Version 2 (GPLv2)# and for details, please consult it at##    http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt### author : ConVirt Team#"""Setup the convirt application"""


2)重新执行命令 [不知道跳过此命令,直接执行下面个命令的话是否会成功,没有测试。]

[root@CMS ~]# ./convirt-install/install/cms/scripts/setup_tg2
install common functions sourced.DISTRO RedHatVER 6.5CODENAME FinalKERNEL 2.6.32-431.el6.x86_64ARCH x86_64Info: Sourcing /root/convirt-install/install/cms/scripts/../../../common/scripts/RedHat_functionsInfo: Sourcing /root/convirt-install/install/cms/scripts/../common/RedHat_functionsNew python executable in /usr/local/convirt/tg2env/bin/pythonInstalling setuptools, pip...done.Searching for extremesBest match: Extremes 1.1.1Processing Extremes-1.1.1-py2.6.eggExtremes 1.1.1 is already the active version in easy-install.pth
Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/Extremes-1.1.1-py2.6.eggProcessing dependencies for extremesFinished processing dependencies for extremesSearching for mysql-pythonBest match: MySQL-python 1.2.5Processing MySQL_python-1.2.5-py2.6-linux-x86_64.eggMySQL-python 1.2.5 is already the active version in easy-install.pth
Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/MySQL_python-1.2.5-py2.6-linux-x86_64.eggProcessing dependencies for mysql-pythonFinished processing dependencies for mysql-pythonSearching for tg.devtoolsBest match: tg.devtools 2.0.2Processing tg.devtools-2.0.2-py2.6.eggtg.devtools 2.0.2 is already the active version in easy-install.pth
Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/tg.devtools-2.0.2-py2.6.eggProcessing dependencies for tg.devtoolsFinished processing dependencies for tg.devtoolsNo need to fix xen in tg2env.Searching for Beaker>=1.4Best match: Beaker 1.6.4Processing Beaker-1.6.4-py2.6.eggBeaker 1.6.4 is already the active version in easy-install.pth
Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/Beaker-1.6.4-py2.6.egg
Processing dependencies for Beaker>=1.4
Finished processing dependencies for Beaker>=1.4
Fixing /usr/local/convirt/tg2env/lib/python2.4/site-packages/Beaker-*py2.4.egg/beaker/ext/google.py for __future__ import problem.
TurboGears environmnet setup successfully.

显示成功。可以执行下一步了......

[root@CMS ~]# ./convirt-install/install/cms/scripts/setup_convirt install common functions sourced.DISTRO RedHatVER 6.5CODENAME FinalKERNEL 2.6.32-431.el6.x86_64ARCH x86_64Info: Sourcing /root/convirt-install/install/cms/scripts/../../../common/scripts/RedHat_functionsInfo: Sourcing /root/convirt-install/install/cms/scripts/../common/RedHat_functionsrunning developNot found: tg.devtoolsrunning egg_info
......
......
......
......
ConVirt Setup Done...Generting ssh identity for CMS.Generating public/private rsa key pair.Created directory '/root/.ssh'.Enter passphrase (empty for no passphrase):  [ssh密码可以为空]Enter same passphrase again: Your identification has been saved in /root/.ssh/cms_id_rsa.Your public key has been saved in /root/.ssh/cms_id_rsa.pub.The key fingerprint is:30:70:e1:f0:8c:08:71:0b:68:03:f5:b9:cd:8a:86:02 root@CMSThe key's randomart p_w_picpath is:
+--[ RSA 2048]----+
|Boo o o.         |
|.* + X           |
|. + + *          |
|     + o         |
|E   . o S        |
|.. . .           |
|o o .            |
|..               |
|                 |
+-----------------+
     ConVirt Management Server (CMS) setup complete.
     To start CMS, give the following commands.
       cd /usr/local/convirt 
       ./convirt-ctl start

     By default the CMS listens on 8081 port. So make sure that your firewall
     allows TCP 8081 port
     Typically this can be achieved by using the following command as root user
       iptables -I INPUT -p tcp --dport 8081 -j ACCEPT 

      Once done, you should be able to access ConVirt application using 
http://CMS:8081/

——这里又碰到一个挺郁闷的小问题,如果要启动convirt-ctl的必须进入安装目录才能启动,不然会报错、不知道是不是人品问题......

两个情况启动,如下:

 1)直接使用路径启动

[root@CMS ~]# /usr/local/convirt/convirt-ctl startTrying to source /usr/local/convirt/tg2env/bin/activatevirtualenv set to /usr/local/convirt/tg2env
Using  /root/.ssh/cms_id_rsaAgent pid 3689Identity added: /root/.ssh/cms_id_rsa (/root/.ssh/cms_id_rsa)ssh key added to agent.Starting ConVirt using virtualenv : /usr/local/convirt/tg2envDefault character encoding is utf-8Entering daemon modeFailed to start ConVirt. Please see paster.log for details.
2)进入安装目录启动
[root@CMS ~]# cd /usr/local/convirt/[root@CMS convirt]# ./convirt-ctl startTrying to source ./tg2env/bin/activatevirtualenv set to /usr/local/convirt/tg2env
Using  /root/.ssh/cms_id_rsaAgent pid 3720Identity added: /root/.ssh/cms_id_rsa (/root/.ssh/cms_id_rsa)ssh key added to agent.Starting ConVirt using virtualenv : /usr/local/convirt/tg2envDefault character encoding is utf-8Entering daemon modeServer running in PID 3730ConVirt Started.