在centos上安裝xe命令行的作用就不用多說了。首先在xenserver的安裝iso中找到xe命令的rpm包(在client_install這個(gè)目錄下),然后拷貝到centos上。如果直接用rpm命令安裝xe-cli-6.1.0-59235p.i686.rpm這個(gè)包,會(huì)提示依賴錯(cuò)誤。這時(shí)改用yum命令來安裝,它會(huì)自動(dòng)幫我們處理依賴。
[root@cloudstack-ms ~]# rpm -ivh xe-cli-6.1.0-59235p.i686.rpm
error: Failed dependencies:
libc.so.6 is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.0) is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.1) is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.1.2) is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.2) is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.3) is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.3.2) is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.3.4) is needed by xapi-xe-0.2-5181.i686
libc.so.6(GLIBC_2.4) is needed by xapi-xe-0.2-5181.i686
libdl.so.2 is needed by xapi-xe-0.2-5181.i686
libdl.so.2(GLIBC_2.0) is needed by xapi-xe-0.2-5181.i686
libdl.so.2(GLIBC_2.1) is needed by xapi-xe-0.2-5181.i686
libm.so.6 is needed by xapi-xe-0.2-5181.i686
libm.so.6(GLIBC_2.0) is needed by xapi-xe-0.2-5181.i686
libpthread.so.0 is needed by xapi-xe-0.2-5181.i686
libpthread.so.0(GLIBC_2.0) is needed by xapi-xe-0.2-5181.i686
libpthread.so.0(GLIBC_2.1) is needed by xapi-xe-0.2-5181.i686
libpthread.so.0(GLIBC_2.2) is needed by xapi-xe-0.2-5181.i686
libpthread.so.0(GLIBC_2.3.2) is needed by xapi-xe-0.2-5181.i686
[root@cloudstack-ms ~]#
這時(shí)我們改用yum來安裝,它會(huì)自動(dòng)幫我們處理依賴問題
yum install xe-cli-6.1.0-59235p.i686.rpm
安裝好后,執(zhí)行xe命令如果報(bào)錯(cuò)
Unhandled exception
File "stunnel.ml", line 137,characters 20-25: Pattern matching failed
這時(shí)需要安裝stunnel包,使用如下命令安裝
yum install stunnel
都安裝好后,可以正常執(zhí)行xe命令,基本用法如下
xe -s ip -u username -pw password command param
-s選項(xiàng)指明xenserver服務(wù)器的IP地址
-u選項(xiàng)指明XenServer服務(wù)器的用戶名
-pw選項(xiàng)指明用戶密碼
command是xe子命令,如host-list等
param是命令的參數(shù),如uuid=xxxxx等