2017-05-23 78 views
1

我一直在試圖讓SaltStack與IPMI一起工作,看源代碼我看到ipmi模塊使用pythons pyghmi,無論我嘗試什麼,我總是得到以下錯誤:python pyghmi(IPMI)無法連接到服務器

Insufficient resources to create new session (wait for existing sessions to timeout)

然而,使用IPMItool命令行(使用相同的用戶名和密碼)的作品很好,我能夠連接並執行命令。

而且我用一個簡單的python腳本嘗試:

from pyghmi.ipmi.private import session 


def _onlogon(response): 
    if 'error' in response: 
     raise Exception(response['error']) 

s = session.Session(bmc='10.0.0.100', 
        userid='USER', 
        password='PASS', 
        onlogon=_onlogon) 

但失敗,出現同樣的錯誤(試圖與Python 2.7和3.5):

Traceback (most recent call last): 
    File "/tmp/pycharm_project_858/main.py", line 15, in <module> 
    s.wait_for_rsp(timeout=1) 
    File "/usr/local/lib/python2.7/dist-packages/pyghmi/ipmi/private/session.py", line 1103, in wait_for_rsp 
    relsession.process_pktqueue() 
    File "/usr/local/lib/python2.7/dist-packages/pyghmi/ipmi/private/session.py", line 1194, in process_pktqueue 
    self._handle_ipmi_packet(pkt[0], sockaddr=pkt[1], qent=pkt) 
    File "/usr/local/lib/python2.7/dist-packages/pyghmi/ipmi/private/session.py", line 1261, in _handle_ipmi_packet 
    self._handle_ipmi2_packet(data) 
    File "/usr/local/lib/python2.7/dist-packages/pyghmi/ipmi/private/session.py", line 1283, in _handle_ipmi2_packet 
    return self._got_rmcp_response(data[16:]) 
    File "/usr/local/lib/python2.7/dist-packages/pyghmi/ipmi/private/session.py", line 1363, in _got_rmcp_response 
    self.onlogon({'error': errstr}) 
    File "/usr/local/lib/python2.7/dist-packages/pyghmi/ipmi/private/session.py", line 537, in onlogon 
    waiter(parameter) 
    File "/tmp/pycharm_project_858/main.py", line 6, in _onlogon 
    raise Exception(response['error']) 
Exception: Insufficient resources to create new session (wait for existing sessions to timeout) 

任何有識之士將受到歡迎,不幸的是我找不到有關pyghmi的任何文檔。

+0

你有ipmi的配置設置還是你將設置傳遞給模塊? https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.ipmi.html – gtmanfred

+0

我將設置傳遞給模塊'salt-call ipmi.fast_connect_test api_host =「10.0.0.100 「api_user =」USER「api_password =」PASS「' –

回答

0

從文檔看起來你應該使用的api_password

https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.ipmi.html#salt.modules.ipmi.fast_connect_test

api_host=127.0.0.1 
api_user=admin 
api_pass=example 
api_port=623 
api_kg=None 

所以api_pass代替。

+0

不幸的是,沒有幫助,我應該提到我嘗試連接一個簡單的Python腳本,我已經更新了我的問題。 –

+0

不幸的是,我會問https://ask.openstack.org/en/questions/,因爲這是他們的項目。 https://github.com/openstack/pyghmi – gtmanfred