-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community.vmware.vmware_cfg_backup failing #1383
Comments
Files identified in the description: If these files are inaccurate, please update the |
Thanks, @msilveirabr for reporting the issue!
If I understand correctly, this error occurs when network reachability has not. |
Hi, ansible -m ping all works as expected. I have many community.vmware modules in use in other playbooks working fine... so far, this is the very first possible bug I've found in cfg_backup. I tried playing around with DNS, A and PTR entries, matching the name to the hostname, etc... I believe this should work on a fresh provisioned ( absolutely no configuratio done, just out of the box dhcp / SSH communication and keys setup ), right? Since it is not happening on a production server, I'm available for patch testing. |
@sky-joker I think the error message is not really helpful. Could you please review PR #1388? This should add some more information that might help troubleshoot issues with |
Hi. Not sure if I should post this here or at #1388 ... here's the output:
|
@msilveirabr Your last comment looks like you've tested the code from my PR. Unfortunately, I don't see what argument caused the I've updated my PR to build the error message in three steps. This should help to identify the problematic argument. |
vmware_cfg_backup: Improve error message SUMMARY We've had two issues with vmware_cfg_backup recently and I think the error message could be improved to help us troubleshoot. ISSUE TYPE Feature Pull Request COMPONENT NAME vmware_cfg_backup ADDITIONAL INFORMATION #1270 and #1383 Reviewed-by: sky-joker <[email protected]>
The updated PR allowed me to narrow down the issue:
Some part of the code seems to get the FQDN from the ESXi host to assemble the URL to download the backup file. It looks like the whole process is tied to getting the ESXi host FQDN, according to the code: def find_host_system(self):
if self.esxi_hostname:
host_system_obj = self.find_hostsystem_by_name(host_name=self.esxi_hostname)
if host_system_obj:
return host_system_obj
else:
self.module.fail_json(msg="Failed to find ESXi %s" % self.esxi_hostname)
host_system = get_all_objs(self.content, [vim.HostSystem])
return list(host_system)[0] After some testing, I got to this conclusion: When esxi_hostname is set, and hostname is a vcenter appliance, the esxi_hostname must be the host name in the vCenter inventory, not necessarily its DNS name -> eg: I added a second host to my test vCenter using the host's IP address, added both A and PTR DNS entries to the domain, then changed the playbook using the FQDN as esxi_hostname. The backup failed using FQDN, but succeeded using IP address as esxi_hostname. When esxi_hostname is not set, and hostname is an ESXi host, esxi_hostname must match the ESXi host configured FQDN and the FQDN must be correctly configured, FQDN must resolve at the ansible host running the playbook. According to the save/restore code, it makes no sense on relying on vim.HostSystem[0].name on a standalone host. I'll open a PR with a proposed fix/improvement. |
The module tries to discover the download URL. But when connecting directly to an ESXi host, it answers with something like
Maybe it would be better to use the I didn't test this yet, but maybe changing the above line to
helps. That is, if you're connecting directly to an ESXi host. I'm not sure what happens if you connect to a vCenter, I'll have to test this. @sky-joker Thoughts? |
@mariolenz |
Proposed fixes for backup behavior #1383 Depends-On: ansible/ansible-zuul-jobs#1591 SUMMARY Proposed fix for Issue #1383 following PR #1388 ISSUE TYPE Bugfix Pull Request COMPONENT NAME vmware_cfg_backup ADDITIONAL INFORMATION Check if hostname is an ESXi host or a vCenter appliance, discard esxi_hostname if target is an ESXi host. Reviewed-by: Mario Lenz <[email protected]> Reviewed-by: sky-joker <[email protected]> Reviewed-by: Mauricio Silveira <None>
SUMMARY
Mixed results using the cfg_backup module:
I have tried this module with different servers, and actually, I can only get it working on one ESXi host.
I tried to perform the backup on 2 fresh installs and other production servers without success.
HOSTS details:
Working hosts:
Non working hosts:
This issue happens using ansible 2.9.27 and 2.12 too
Just wondering if I am doing something stupid. I'm going crazy trying to debug this.
PS: It doesn't matter if the dest file already exists or not.
ISSUE TYPE
COMPONENT NAME
community.vmware.vmware_cfg_backup
ANSIBLE VERSION
Fedora FC33:
Rocky Linux 8.5:
COLLECTION VERSION
FC33: same versions as Rocky Linux ( ansible 2.9 has no list parameter )
Rocky Linux:
CONFIGURATION
OS / ENVIRONMENT
Fedora FC33 (ansible 2.9.7) and Rocky Linux 8.5 (ansible 2.12)
STEPS TO REPRODUCE
ansible.cfg:
inventory:
simple_test.yml
EXPECTED RESULTS
To work on any ESXi 6.x HOST
ACTUAL RESULTS
Only works on 1 host
Working host:
Non working hosts:
Non working hosts verbose (-vvv) of "TASK [Saving to /tmp/configBundle.tgz]" :
The text was updated successfully, but these errors were encountered: