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
vmware_guest - after cloning nic is not connected to network #45834
Comments
Files identified in the description: If these files are inaccurate, please update the |
Hi @arno1704, Thank you for the issue, just so you are aware we have a dedicated Working Group for vmware. |
Most likely VM Customization is failing on your host. You will need to find out why (there should be a log file on the server itself). VMWare disables the nic until customization completes and then re-enables it once done. This is all handled by VMWare and is not done by the module itself. |
Do you have any idea in which logfile i could find this info - i found nothing... |
A quick google tells me to look at |
Thanks for the tipp - but these logs get created after i power on the vm - thats too late - then the error allready happened. so the question still is: if this is a vmware bug - in wich logfile can i find this? must be someware on the vcenter or the esx hosts... but i think ansible is not setting the checkbox even i set "start_connected" to true my networks-section: |
i have a sam issue, nothing helps. If i do it manyally from vcenter it works ok, dont think this is a vmware bug. Also experience a lot of more issue with linux template where after clone, it wont boot and get me error "you need to load the kernel first". This is very frustrating.. :( pls help |
I too am experiencing this issue. I have an Ubuntu 18.04 template and when I use ansible to clone the template I am left with the "Connect At Power On" box un-checked under settings -> network adapter 1 for the new VM. When I use vCenter to clone from the template this is not a problem and the "Connect At Power On" box remains checked under settings -> network adapter 1 for the new VM. However, I use ansible to clone from a Red Hat 7 template, that I use frequently, that has no problems what so ever. |
@scottsisco What vCenter version? (different versions of VCenter only support specific OSes) Do you have open-vm-tools and perl installed? Have you checked the vmware tools log on the new VM? |
When i check the vmTools log there is nothing - but can there be anything in the logs? Since the checkbox is missing even if i don't turn on the vm - so vmware-tools are not running at this time. The error happens before switching on the machine - right at the clone-process |
@arno1704 That comment was for scottsisco's issue, not yours. For yours, customization will not happen until the VM powers on and VMWare Tools loads, so if you aren't turning it on, then it will not check the box. That is a requirement by VMWare's Customization spec not us. |
yes - i know that this was for scottisco |
@arno1704 I've had similar/same issue for a while now. Only workaround I've found is below (these are the manual steps, which of course I automated):
The issue in my case I think is the VM has no NIC to finish customization with since template had NIC removed when it was inside another hypervisor. Hope that helps. |
As others have said, this appears to be caused by a failure within the VMware tools Guest Customization. However there are two issues with this:
I can help with the second one by describing what I did to track down a very similar issue. The process I used:
Enable VMware tools debuggingThe general process is here: https://kb.vmware.com/s/article/1007873 I was debugging Linux guests, so I used this in
To get that in the template I converted it to a VM, booted it, changed the above file, shut it down, then converted it from a VM back to a template. Deploy the template to a test VMEasy! Just use your existing Ansible playbook for this. Check the debug logs on the test VMOK, there's a lot of data in /tmp now. The important bits for guest customization will be labelled
In my specific case, I saw the first message but not the second on my nonworking server. I also saw this message only on the nonworking server:
Google only showed me the source code as hits on this specific error. That's when you know it's not going to be a good day. https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/lib/rpcChannel/rpcChannel.c However, I did notice in my case that some of the follow-up logs on my working server related to Probably because none of the HGFS VMware tools packages were installed. So in my case, installing those packages resolved the guest customization issue. However, I hope that the above techniques and methods are useful for more possible cases of brokenness than just my specific HGFS issue. And it would be REALLY nice if Ansible could tell when the guest customization has failed and report this as a failure. |
It might be a useful workaround install govmomi/toolbox Go package into VM Template. For instance, I'm not getting any issue after adding these tasks during VM Template creation (before Someone has tried with this approach? OS / ENVIRONMENT Playbook VM Templates
|
What I have been noticing a lot, is that when I do too many cloning asynchronously, that is when my things break, and NICs don't connect. When I go 1 by 1, that really doesn't happen as much. And what I also noticed when I was going 1 by 1, is that the only machines that fail, are the ones that have "A newer version of VMware Tools is available for this virtual machine." as a warning. I have encountered this on multiple occasions, and what is wired is that this warning might appear on only some of the machines, even though all of the machines are clones. |
Look, this might be your issue: https://kb.vmware.com/s/article/59444 |
Thanks for the link @rjouhann but I have the same issue without having NSX-T in my environment |
Hi @arno1704, network adapter not connected might caused by guest customization in OS failed at some step. Here are some suggestions:
(2) there is a new parameter "wait_for_customization" added in Ansible 2.8 to check customization succeed event, you can have a try. Thanks. |
I had been trying to resolve the same issue myself, but I have found a solution: Note that these are my experiences with using Ansible to clone a Windows 2016 Server guest. As has been mentioned in this post, the issue is to do with VMware customisation and not Ansible itself. I found that the VMware image customisation was failing, and thanks to the post from @Tomorrow9 above, it gave me some useful pointers for troubleshooting. The source template I was cloning from had already been sysprepped, and as a result, VMware customisation was failing when the machine was was spun up from this template - which I found from the logs in %WINDIR%\Temp\vmware-imc*.log. To resolve this, I converted the source template into a VM and booted it, let it run through the setup steps, then when it was done and back up, I shut it down and converted it back into a template so it was effectively a non-sysprepped image. I then re-ran my playbook to create a VM from this template and all was well, the server came up, VMware Image customisation ran (which runs sysprep on Windows), and once it was finished and rebooted I had a network-connected VM with the correct NIC configuration. I have yet to deploy from a Linux template - but that is next, and obviously sysprep wont be part of this deployment. Thanks for the previous posts above which helped me in finding the cause. I hope this helps some people out as it was massively frustrating me! |
Have seen this also. Have you guys tried the following? Seems to be more successful for me:
Still testing, but this is what I'm finding works reliably. I see MAC Address conflicts in vCenter if I don't remove the NIC from vCenter. I see device can not be started in Event Viewer Kernel-PNP log if I don't use E1000E type NIC. |
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
For further information, please see: |
SUMMARY
When cloning a Template in the created VM the checkbox for "Connect at power on" of the NIC is not set - so the VM boots without working network
ISSUE TYPE
COMPONENT NAME
vmware_guest
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
vCenter 6.7 - using distributed swtiches
ESXi 6.7 and 6.0U3
Template-OS: Windows Server 2016 Core
VMWare Tools: 10304 (10.2.0)
STEPS TO REPRODUCE
Executed the Playbook i attached...
EXPECTED RESULTS
A Cloned VM with working network-connections joining the domain
ACTUAL RESULTS
VM gets cloned correctly - NICs are alle on the right vSwitch. But the checkbox for "Connect at PowerOn" is not set - so when the vm start it gets no network-connection and the task fails.
If i set state: poweredoff - check "Connect at PowerOn" at the NIC and boot the VM - everything works as expected
No difference if a NIC is present in the template or not - same result
The text was updated successfully, but these errors were encountered: