Closed FF186 closed 4 years ago
Since this doesn't look like a bug or a feature request, I'll close it. Please don't open issues in this project for general usage questions... but I'll give you some hints.
Failed to connect to the host via ssh : ssh: Could not resolve hostname my_vm: Temporary failure in name resolution
1) The wait_for
(which is, by the way, not part of this collection) module can't resolve my_vm
. Do you have a DNS record for my_vm
?
2) You just create a VM, you don't install an OS; even if you have a correct DNS record, you get a running VM but without an OS you will never get an sshd to connect to.
Hi @mariolenz , I understand your comment 100%, but when I run tests using the Dynamic Inventory it fails.
I've tried this with the use of dynamic inventory, resulting in unreachable
, and I've tried this adding the host in a static inventory.
Could this be something?..
Can you ssh my_vm
successfully? From what you've told me, I'm pretty sure you can't... which means we're not talking about a problem with one of our modules.
Don't get me wrong, I'm not saying you don't have a valid question. But we're somewhat focused on fixing bugs and implementing new features, not about general usage issues.
Serverfault is a good place to ask questions about general usage issues, imho.
I can ssh into it, I can run playbooks, but what I cannot do: Is to turn a server which is in state poweredOFF
using the community.vmware.vmware_vm_inventory
. If I only use the dynamic inventory the play fails, but if I but the machine and it's ip in a static inventory it works. I've even tried to use refresh_inventory
without any success.
When I run the same playbook when the server is in state poweredON
it works...
Sure, I get your point. Thanks @mariolenz.
One last question @mariolenz, if you don't mind helping a useless kid.
I want to be able to refer to my VM, using the vm_name
in host_vars/
definition, but I want the inventory_hostname
or fqdn
to be vm_name + my_domain
SUMMARY
In my homelab I try to power on a VM which is turned off (
hw_power_status
== poweredOff) and do tasks on this machine. However, after the VM is powered on using thevmware_guest
module, and the use ofwait_for
and- meta: refresh_inventory
to get the newest information, the play fails and gives meUNREACHABLE
.I am not saying there's a problem with the dynamic inventory, but I'd like to get some feedback on my logic.
Thanks.
ISSUE TYPE
COMPONENT NAME
Module:
vmware_guest
Inventory:community.vmware.vmware_vm_inventory
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS