VMWARE_GUEST:从模板创建VM:创建虚拟机失败:无法访问虚拟机配置

时间:2018-11-02 14:08:59

标签: ansible vmware vsphere

我正在尝试使用ansible自动化基础架构中的VM部署。

因此,我使用了模块“ vmware_guest” https://docs.ansible.com/ansible/latest/modules/vmware_guest_module.html

我使用了与示例完全相同的剧本,这是我的剧本:

---
- name: Création d'une VM à partir d'un template
  hosts: localhost
  connection: local
  gather_facts: no
  tasks:
  - name: Clone du template
    vmware_guest:
      hostname: 192.168.102.XXX
      username: administrator@vsphere.local
      password: XXX
      validate_certs: False
      name: AnsibleTest
      template: Template_RH7.3
      datacenter: DataCenterUEM
      folder: /DataCenterUEM/vm/MLD/Linux
      state: present
      wait_for_ip_address: yes

我的配置还可以,因为借助“ clusters_facts”或“ guest_facts”模块,我可以从数据中心/ ESX /集群中获取一些信息。

这是我的错误:

PLAY [Création d'une VM à partir d'un template] ******************************************************************************************************************************************

TASK [Clone du template] *****************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to create a virtual machine : Unable to access the virtual machine configuration: Unable to access file [VMWUEM_01_Linux_1] Template_RH7.3/Template_RH7.3.vmtx"}
        to retry, use: --limit @/etc/ansible/ansible-vmware/vmware_create_infra.retry

PLAY RECAP *******************************************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1

剧本已正确检测到我的模板“ Template_RH7.3”的位置,原因是我能够在vSphere中找到该文件: See my file here

您知道出了什么问题吗?

我的Ansible版本:

ansible 2.7.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, May 23 2018, 14:21:55) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]

谢谢!

0 个答案:

没有答案
相关问题