Did you find a resolution to this by chance? I just ran into the issue when I changed datastores. I was using a general datastore holding templates but the goal was to use the same datastore of the Content library and use those templates.
"msg": "Failed to create a virtual machine : Unable to access the virtual machine configuration: Unable to access file [<datastore_name>] W2K19_STD/W2K19_STD.vmtx"} Thanks. On Tuesday, February 8, 2022 at 9:04:58 AM UTC-7 [email protected] wrote: > Forgot to mention I have a issue opened here: vmware_guest error: > Unable to access the virtual machine configuration: Unable to access file · > Issue #1201 · ansible-collections/community.vmware · GitHub > <https://github.com/ansible-collections/community.vmware/issues/1201> > > On Tuesday, February 8, 2022 at 9:03:52 AM UTC-7 Jason B wrote: > >> SUMMARY >> >> When attempting to provision a new vmware VM using the vmware_guest >> module to VSAN storage, I am getting the following error: >> >> ```msg": "Failed to create a virtual machine : Unable to access the >> virtual machine configuration: Unable to access file >> [some_other_non_vsan_storage_cluster_not_connected_to_ESXI_Cluster] >> Linux_Base_Template/Linux_Base_Template.vmtx".``` >> >> Same problem documented in: Ansible Issue: 28649 --- I have attempted the >> fix that is documented there by added a disk section ( see above ) with the >> datastore variable ( we have many datastores ). The templates live on a >> separate storage system NOT connected to ESXi Clusters that are configured >> for VSAN. * This works perfectly by manually cloning via vCenter to the >> target ESXi Cluster. * This works perfectly if I am provisioning to ESXi >> clusters that have the >> "[some_other_non_vsan_storage_cluster_not_connected_to_ESXI_Cluster] " >> connected to it. * This works perfectly by executing vmware powercli NEW-VM >> command here is the code for that: >> https://thesleepyadmins.com/2018/09/08/deploy-multiple-vms-using-powercli-and-vmware-template >> >> Code: >> >> ``` >> >> msg": "Failed to create a virtual machine : Unable to access the virtual >> machine configuration: Unable to access file >> [some_other_non_vsan_storage_cluster_not_connected_to_ESXI_Cluster] >> Linux_Base_Template/Linux_Base_Template.vmtx". "invocation": { >> "module_args": { "name": "TMPBLDLNXLL0001", "hostname": "vCenterServer", >> "username": "XXXXXXXXXX", "password": >> "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "annotation": "Test VSAN >> provisioning", "template": "Linux-8_Base_Template", "datacenter": >> "devnulldc", "folder": "devnulldc/vm/Sandbox", "cluster": "CL-03", "disk": >> [ { "size_gb": 50, "type": "thin", "datastore": "['vSAN']", >> "autoselect_datastore": null, "controller_number": null, "controller_type": >> null, "disk_mode": null, "filename": null, "size": null, "size_kb": null, >> "size_mb": null, "size_tb": null, "unit_number": null } ], "hardware": { >> "num_cpus": 2, "memory_mb": 4096, "num_cpu_cores_per_socket": 2, >> "hotadd_cpu": false, "hotremove_cpu": false, "hotadd_memory": false, >> "nested_virt": false, "scsi": "paravirtual", "boot_firmware": null, >> "cpu_limit": null, "cpu_reservation": null, "max_connections": null, >> "mem_limit": null, "mem_reservation": null, "memory_reservation_lock": >> null, "secure_boot": null, "version": null, "virt_based_security": null, >> "iommu": null }, "networks": [ { "name": "BlackholeNet", "type": "static", >> "ip": "987.65.43.21", "netmask": "255.255.255.0", "gateway": "987.65.43.1", >> "device_type": "vmxnet3", "dvswitch_name": "vDSwitch", "start_connected": >> true } *** Truncated *** >> >> ``` >> >> ** Note obviously I have masked a lot of information ( like IP address, >> etc ) *** >> > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9c8e7c38-8884-4506-9cf7-977dbaeea812n%40googlegroups.com.
