Ansible vmware_guest无法SSH进入vmware vSphere vCenter [英] Ansible vmware_guest cannot ssh into vmware vSphere vCenter

查看:167
本文介绍了Ansible vmware_guest无法SSH进入vmware vSphere vCenter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ansible设置虚拟机.但是,ansible始终卡在从模板部署来宾"任务上.

使用-vvv,我得到了以下日志.

当尝试通过ssh pubkey auth登录时:

TASK [Deploy guest from template] 


task path: /home/wilb/Development/vcenter_demo/vcenter_demo.yml:12
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_guest.py
<vcenter.mycompany.com> ESTABLISH SSH CONNECTION FOR USER: root
<vcenter.mycompany.com> SSH: EXEC ssh -C -o ControlMaster=auto 
  -o ControlPersist=60s -o KbdInteractiveAuthentication=no 
  -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
  -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 
  -o ControlPath=/home/wilb/.ansible/cp/982c3c15ab 
  vcenter.mycompany.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''

当我尝试使用--ask-pass时,它卡在这里:

TASK [Deploy guest from template] *******************************************************************************************************
task path: /home/wilb/Development/vcenter_demo/vcenter_demo.yml:14
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_guest.py
<vcenter.mycompany.com> ESTABLISH SSH CONNECTION FOR USER: root
<vcenter.mycompany.com> SSH: EXEC sshpass -d12 ssh -C 
  -o ControlMaster=auto -o ControlPersist=60s -o User=root 
  -o ConnectTimeout=10 
  -o ControlPath=/home/wilb/.ansible/cp/982c3c15ab 
  vcenter.mycompany.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''

我可以手动登录到vCenter.但是,要访问该外壳程序,我首先必须在vCenter中键入:"shell";默认情况下,这是一些奇怪的自定义提示.

我如何能够正确登录vcenter以自动部署VM?

系统

  • 控制器操作系统:Fedora 26
  • Ansible:2.4.1
  • vCenter:6.5.0.10

解决方案

Ansible vmware_guest无法连接到vmware vSphere vCenter

不应该.

您应该从本地计算机调用大多数云"模块.
看一下 vmware_guest 的示例:无处不在的delegate_to: localhost.

I'm trying to setup a virtual machine with ansible. However, ansible keeps getting stuck on the Deploy guest from template task.

Using -vvv, I got the following logs.

When attempting to log in via ssh pubkey auth:

TASK [Deploy guest from template] 


task path: /home/wilb/Development/vcenter_demo/vcenter_demo.yml:12
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_guest.py
<vcenter.mycompany.com> ESTABLISH SSH CONNECTION FOR USER: root
<vcenter.mycompany.com> SSH: EXEC ssh -C -o ControlMaster=auto 
  -o ControlPersist=60s -o KbdInteractiveAuthentication=no 
  -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
  -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 
  -o ControlPath=/home/wilb/.ansible/cp/982c3c15ab 
  vcenter.mycompany.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''

When I try to use --ask-pass, it gets stuck here:

TASK [Deploy guest from template] *******************************************************************************************************
task path: /home/wilb/Development/vcenter_demo/vcenter_demo.yml:14
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_guest.py
<vcenter.mycompany.com> ESTABLISH SSH CONNECTION FOR USER: root
<vcenter.mycompany.com> SSH: EXEC sshpass -d12 ssh -C 
  -o ControlMaster=auto -o ControlPersist=60s -o User=root 
  -o ConnectTimeout=10 
  -o ControlPath=/home/wilb/.ansible/cp/982c3c15ab 
  vcenter.mycompany.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''

I can login to the vCenter manually. However, to access the shell, I first have to type: "shell" in the vCenter; by default it's some weird customized prompt.

How can I get ansible to log into vcenter properly to automatically deploy a VM?

System

  • Controller OS: Fedora 26
  • Ansible: 2.4.1
  • vCenter: 6.5.0.1000

解决方案

Ansible vmware_guest cannot ssh into vmware vSphere vCenter

It should not.

You should call most of "cloud" modules from local machine.
Take a look at examples of vmware_guest: there's delegate_to: localhost everywhere.

这篇关于Ansible vmware_guest无法SSH进入vmware vSphere vCenter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆