HuaweiSwitch / CloudEngine-Ansible

Ansible modules to automate HUAWEI CloudEngine switches
GNU General Public License v3.0
144 stars 51 forks source link

unable to open shell when using ce_command #49

Closed gx6666 closed 6 years ago

gx6666 commented 6 years ago

您好,我有三种不同的交换机,分别是S5700 V200R003C00SPC300,CE5855EI V100R005C10SPC200以及CE6855HI V200R002C20SPC016T。 我尝试使用ce_command去控制这三台交换机,结果只有s5700这个交换机能被控制其他两台设备都是报了无法打开shell的错误。 在运行ansible之前我已按照《通过Ansible和CE系列交换机实现网络自动化部署.pdf》里所述对交换机进行配置。 详细报错信息如下: 9046 1532594026.04660: starting run 9046 1532594026.16299: Loading CacheModule 'memory' from /usr/lib/python2.7/site-packages/ansible/plugins/cache/memory.py 9046 1532594026.21835: Loading CallbackModule 'minimal' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/minimal.py 9046 1532594026.21957: Loading CallbackModule 'actionable' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/actionable.py (found_in_cache=False, class_only=True) 9046 1532594026.21975: Loading CallbackModule 'context_demo' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/context_demo.py (found_in_cache=False, class_only=True) 9046 1532594026.21991: Loading CallbackModule 'debug' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/debug.py (found_in_cache=False, class_only=True) 9046 1532594026.22018: Loading CallbackModule 'default' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/default.py (found_in_cache=False, class_only=True) 9046 1532594026.22051: Loading CallbackModule 'dense' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/dense.py (found_in_cache=False, class_only=True) 9046 1532594026.22082: Loading CallbackModule 'foreman' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/foreman.py (found_in_cache=False, class_only=True) 9046 1532594026.22554: Loading CallbackModule 'hipchat' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/hipchat.py (found_in_cache=False, class_only=True) 9046 1532594026.22579: Loading CallbackModule 'jabber' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/jabber.py (found_in_cache=False, class_only=True) 9046 1532594026.22598: Loading CallbackModule 'json' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/json.py (found_in_cache=False, class_only=True) 9046 1532594026.22630: Loading CallbackModule 'junit' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/junit.py (found_in_cache=False, class_only=True) 9046 1532594026.22649: Loading CallbackModule 'log_plays' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/log_plays.py (found_in_cache=False, class_only=True) 9046 1532594026.22686: Loading CallbackModule 'logentries' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.py (found_in_cache=False, class_only=True) 9046 1532594026.22719: Loading CallbackModule 'logstash' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/logstash.py (found_in_cache=False, class_only=True) 9046 1532594026.23097: Loading CallbackModule 'mail' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/mail.py (found_in_cache=False, class_only=True) 9046 1532594026.23105: Loading CallbackModule 'minimal' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/minimal.py (found_in_cache=False, class_only=True) 9046 1532594026.23123: Loading CallbackModule 'oneline' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/oneline.py (found_in_cache=False, class_only=True) 9046 1532594026.23154: Loading CallbackModule 'osx_say' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/osx_say.py (found_in_cache=False, class_only=True) 9046 1532594026.23178: Loading CallbackModule 'profile_tasks' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/profile_tasks.py (found_in_cache=False, class_only=True) 9046 1532594026.23202: Loading CallbackModule 'selective' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/selective.py (found_in_cache=False, class_only=True) 9046 1532594026.23219: Loading CallbackModule 'skippy' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/skippy.py (found_in_cache=False, class_only=True) 9046 1532594026.23251: Loading CallbackModule 'slack' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/slack.py (found_in_cache=False, class_only=True) 9046 1532594026.23333: Loading CallbackModule 'syslog_json' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/syslog_json.py (found_in_cache=False, class_only=True) 9046 1532594026.23352: Loading CallbackModule 'timer' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/timer.py (found_in_cache=False, class_only=True) 9046 1532594026.23371: Loading CallbackModule 'tree' from /usr/lib/python2.7/site-packages/ansible/plugins/callback/tree.py (found_in_cache=False, class_only=True) 9046 1532594026.23376: in VariableManager get_vars() 9046 1532594026.23390: done with get_vars() 9046 1532594026.27108: Loading StrategyModule 'linear' from /usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.py 9046 1532594026.27313: getting the remaining hosts for this loop 9046 1532594026.27319: done getting the remaining hosts for this loop 9046 1532594026.27325: building list of next tasks for hosts 9046 1532594026.27329: getting the next task for host localhost 9046 1532594026.27335: done getting next task for host localhost 9046 1532594026.27339: ^ task is: TASK: meta (flush_handlers) 9046 1532594026.27343: ^ state is: HOST STATE: block=1, task=1, rescue=0, always=0, run_state=ITERATING_TASKS, fail_state=FAILED_NONE, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 9046 1532594026.27346: done building task lists 9046 1532594026.27349: counting tasks in each state of execution 9046 1532594026.27352: done counting tasks in each state of execution: num_setups: 0 num_tasks: 1 num_rescue: 0 num_always: 0 9046 1532594026.27356: advancing hosts in ITERATING_TASKS 9046 1532594026.27358: starting to advance hosts 9046 1532594026.27361: getting the next task for host localhost 9046 1532594026.27365: done getting next task for host localhost 9046 1532594026.27371: ^ task is: TASK: meta (flush_handlers) 9046 1532594026.27377: ^ state is: HOST STATE: block=1, task=1, rescue=0, always=0, run_state=ITERATING_TASKS, fail_state=FAILED_NONE, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 9046 1532594026.27383: done advancing hosts to next task 9046 1532594026.28117: done queuing things up, now waiting for results queue to drain 9046 1532594026.28127: results queue empty 9046 1532594026.28134: checking for any_errors_fatal 9046 1532594026.28141: done checking for any_errors_fatal 9046 1532594026.28147: checking for max_fail_percentage 9046 1532594026.28154: done checking for max_fail_percentage 9046 1532594026.28160: checking to see if all hosts have failed and the running result is not ok 9046 1532594026.28166: done checking to see if all hosts have failed 9046 1532594026.28171: getting the remaining hosts for this loop 9046 1532594026.28178: done getting the remaining hosts for this loop 9046 1532594026.28188: building list of next tasks for hosts 9046 1532594026.28194: getting the next task for host localhost 9046 1532594026.28209: done getting next task for host localhost 9046 1532594026.28215: ^ task is: TASK: ce_command 9046 1532594026.28219: ^ state is: HOST STATE: block=2, task=1, rescue=0, always=0, run_state=ITERATING_TASKS, fail_state=FAILED_NONE, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 9046 1532594026.28222: done building task lists 9046 1532594026.28225: counting tasks in each state of execution 9046 1532594026.28228: done counting tasks in each state of execution: num_setups: 0 num_tasks: 1 num_rescue: 0 num_always: 0 9046 1532594026.28232: advancing hosts in ITERATING_TASKS 9046 1532594026.28235: starting to advance hosts 9046 1532594026.28238: getting the next task for host localhost 9046 1532594026.28242: done getting next task for host localhost 9046 1532594026.28246: ^ task is: TASK: ce_command 9046 1532594026.28250: ^ state is: HOST STATE: block=2, task=1, rescue=0, always=0, run_state=ITERATING_TASKS, fail_state=FAILED_NONE, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 9046 1532594026.28253: done advancing hosts to next task 9046 1532594026.28259: getting variables 9046 1532594026.28263: in VariableManager get_vars() 9046 1532594026.28291: done with get_vars() 9046 1532594026.28302: done getting variables 9046 1532594026.28307: sending task start callback, copying the task so we can template it temporarily 9046 1532594026.28309: done copying, going to template now 9046 1532594026.28313: done templating 9046 1532594026.28315: here goes the callback... 9046 1532594026.28320: sending task start callback 9046 1532594026.28323: entering _queue_task() for localhost/ce_command 9046 1532594026.28326: Creating lock for ce_command 9046 1532594026.28421: worker is 1 (out of 1 available) 9046 1532594026.28464: exiting _queue_task() for localhost/ce_command 9046 1532594026.28482: done queuing things up, now waiting for results queue to drain 9046 1532594026.28489: waiting for pending results... 9054 1532594026.28772: running TaskExecutor() for localhost/TASK: ce_command 9054 1532594026.28825: in run() 9054 1532594026.28880: calling self._execute() 9054 1532594026.29479: Loading Connection 'local' from /usr/lib/python2.7/site-packages/ansible/plugins/connection/local.py 9054 1532594026.29541: Loading ShellModule 'csh' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/csh.py 9054 1532594026.29576: Loading ShellModule 'fish' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/fish.py 9054 1532594026.29612: Loading ShellModule 'powershell' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/powershell.py 9054 1532594026.29631: Loading ShellModule 'sh' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/sh.py 9054 1532594026.29653: Loading ShellModule 'sh' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/sh.py (found_in_cache=True, class_only=False) 9054 1532594026.29667: in VariableManager get_vars() 9054 1532594026.29702: done with get_vars() 9054 1532594026.33584: Loading ActionModule 'ce' from /usr/lib/python2.7/site-packages/ansible/plugins/action/ce.py 9054 1532594026.33599: starting attempt loop 9054 1532594026.33604: running the handler 9054 1532594026.33687: Loading Connection 'persistent' from /usr/lib/python2.7/site-packages/ansible/plugins/connection/persistent.py 9054 1532594026.33709: Loading ShellModule 'csh' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/csh.py (found_in_cache=True, class_only=False) 9054 1532594026.33716: Loading ShellModule 'fish' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/fish.py (found_in_cache=True, class_only=False) 9054 1532594026.33720: Loading ShellModule 'powershell' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/powershell.py (found_in_cache=True, class_only=False) 9054 1532594026.33726: Loading ShellModule 'sh' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/sh.py (found_in_cache=True, class_only=False) 9054 1532594026.33732: Loading ShellModule 'sh' from /usr/lib/python2.7/site-packages/ansible/plugins/shell/sh.py (found_in_cache=True, class_only=False) 9054 1532594026.33792: Loading Connection 'ssh' from /usr/lib/python2.7/site-packages/ansible/plugins/connection/ssh.py (found_in_cache=False, class_only=True) 9054 1532594056.56313: handler run complete 9054 1532594056.56332: attempt loop complete, returning result 9054 1532594056.56340: _execute() done 9054 1532594056.56344: dumping result to json 9054 1532594056.56350: done dumping result, returning 9054 1532594056.56360: done running TaskExecutor() for localhost/TASK: ce_command 9054 1532594056.56370: sending task result 9054 1532594056.56444: done sending task result 9054 1532594056.56471: WORKER PROCESS EXITING 9046 1532594056.56519: marking localhost as failed 9046 1532594056.56534: marking host localhost failed, current state: HOST STATE: block=2, task=1, rescue=0, always=0, run_state=ITERATING_TASKS, fail_state=FAILED_NONE, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 9046 1532594056.56544: ^ failed state is now: HOST STATE: block=2, task=1, rescue=0, always=0, run_state=ITERATING_COMPLETE, fail_state=FAILED_TASKS, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 9046 1532594056.56550: getting the next task for host localhost 9046 1532594056.56554: host localhost is done iterating, returning localhost | FAILED! => { "changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255 } 9046 1532594056.56579: no more pending results, returning what we have 9046 1532594056.56584: results queue empty 9046 1532594056.56587: checking for any_errors_fatal 9046 1532594056.56589: done checking for any_errors_fatal 9046 1532594056.56592: checking for max_fail_percentage 9046 1532594056.56594: done checking for max_fail_percentage 9046 1532594056.56598: checking to see if all hosts have failed and the running result is not ok 9046 1532594056.56600: done checking to see if all hosts have failed 9046 1532594056.56603: getting the remaining hosts for this loop 9046 1532594056.56606: done getting the remaining hosts for this loop 9046 1532594056.56611: building list of next tasks for hosts 9046 1532594056.56616: getting the next task for host localhost 9046 1532594056.56621: host localhost is done iterating, returning 9046 1532594056.56624: done building task lists 9046 1532594056.56626: counting tasks in each state of execution 9046 1532594056.56629: done counting tasks in each state of execution: num_setups: 0 num_tasks: 0 num_rescue: 0 num_always: 0 9046 1532594056.56632: all hosts are done, so returning None's for all hosts 9046 1532594056.56635: done queuing things up, now waiting for results queue to drain 9046 1532594056.56639: results queue empty 9046 1532594056.56642: checking for any_errors_fatal 9046 1532594056.56644: done checking for any_errors_fatal 9046 1532594056.56647: checking for max_fail_percentage 9046 1532594056.56649: done checking for max_fail_percentage 9046 1532594056.56651: checking to see if all hosts have failed and the running result is not ok 9046 1532594056.56653: done checking to see if all hosts have failed 9046 1532594056.56657: getting the next task for host localhost 9046 1532594056.56660: host localhost is done iterating, returning 9046 1532594056.56664: running handlers 9046 1532594056.56716: RUNNING CLEANUP

justbiaoliu commented 6 years ago

你好,《通过Ansible和CE系列交换机实现网络自动化部署.pdf》=====里面有一些问题,我们在support已经卸载了,需要看下环境排查,最新白皮书预计8月份出来。如果方便,能否预约一起看下?

gx6666 commented 6 years ago

没问题,您方便怎样联系?

justbiaoliu commented 6 years ago

Phone:15051880264. QQ:292080543 桌面共享

justbiaoliu commented 6 years ago

ansible.cfg 的host_key_checking设置成False