2016-07-22 71 views
0

以下api調用不會返回錯誤並且似乎可以正常工作,但vlan實際上並未獲得中繼。相反,我們必須手動接觸到SoftLayer,並讓它們將vlan中繼到指定的設備。SoftLayer對trunk vlan的API調用失敗

這是API調用,在Python,儘管它應該是其他語言的相似:

client['Network_Component'].addNetworkVlanTrunks([{'id': 121212}], id=565656) 

可悲的是,SoftLayer的是無法考證或通過其內部的票務系統在所有解決這個問題。相反,他們告訴我們在這裏發佈這個問題,因爲這顯然是他們的「API專家」在哪裏閒逛。

有沒有人有洞察力,他們可以分享有關這個API調用?

回答

0

您用於添加networkVlanTrunks的api調用工作正常。

如果要檢查是否已成功加入VLAN中繼,您應檢查上行分量及其networkVlanTrunks,因爲在這個環節上說:SoftLayer_Network_Component::addNetworkVlanTrunks

嘗試以下Python腳本它:

""" 
This script Retrieve the network component linking this object to parent and 
their network vlan trunks 

See below references for more details. 
Important manual pages: 
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Component/getUplinkComponent 
http://sldn.softlayer.com/article/object-masks 

@License: http://sldn.softlayer.com/article/License 
@Author: SoftLayer Technologies, Inc. <[email protected]> 
""" 
import SoftLayer 
from pprint import pprint as pp 

# Your SoftLayer username and apiKey 
user = 'set me' 
api = 'set me' 

# Connect to SoftLayer 
client = SoftLayer.create_client_from_env(username=user, api_key=api) 

# Define the network component Id 
networkComponentId = 916616 

# Define an object mask to get network vlan trunks 
mask = 'mask[networkVlanTrunks]' 

try: 
    result = client['SoftLayer_Network_Component'].getUplinkComponent(mask=mask, id=networkComponentId) 
    pp(result) 
except SoftLayer.SoftLayerAPIError as e: 
    print('Error faultCode=%s, faultString=%s' 
      % (e.faultCode, e.faultString)) 
    exit(1) 

我做了一些測試,我驗證了VLAN中繼成功添加。

我希望它有幫助。 請讓我知道任何疑問或評論。

+0

謝謝Ruber。但是我所說的是,API調用將VLAN標記爲中繼,並且報告它是中繼,而事實上中繼從未發生過。我們通過測試流量來驗證這一點,然後看到沒有收到VRRP廣告,然後通過與SL聯繫,經過一些故障排除後,發現VLAN實際上並沒有中繼,並且不得不手動中繼它 - 這違背了自動化的目的通過API。 我們打開了一張SoftLayer的門票,並被告知要問這裏(他們的api專家在哪裏),我們的門票已關閉。那麼解決方案的下一步是什麼? – pgra

+0

據我所知,vlan中繼的配置是通過第3層完成的。如果你想測試vlan,顯然你需要在第1層(爲你的vlan中繼配置你的服務器)中配置它,如果你需要更多的幫助有此問題或對此有任何疑問,請向softlayer(網絡)提交一張票。如果有必要,請附上此論壇。 –

+0

我明白了。我們的服務器配置正確,但正如我所說的,沒有執行中繼。這是問題,這是沒有人願意真正測試的部分。說它行得通,並且系統表示它做了中繼與測試它不一樣。在我們的生產集羣中,當集羣沒有完成時,事情就被打破了。我如何讓SoftLayer的某個人進行api調用,並手動驗證中繼是否可用? – pgra