-
Notifications
You must be signed in to change notification settings - Fork 243
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
Obtaining the ip address of the guest and update address cache #4002
base: master
Are you sure you want to change the base?
Obtaining the ip address of the guest and update address cache #4002
Conversation
7daa004
to
d84eed9
Compare
Few of the times it is seen that the ip address is not being fetch and the avocado runs were failed with error "ERROR: Failures occurred while postprocess:\n\n: Guest virt-tests-vm1 dmesg verification failed: Login timeout expired (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC aa:bb:cc:dd:ee:ff') " To handle this error the patch has been sent. The patch helps in obtaining ip address of the guest using "virsh-net-dhcp-leases default" command. If the guest mac address is found in the command output, the mac ipv4 address is obatined and updated in the address.cache Signed-off-by: Tasmiya Nalatwad <[email protected]>
d84eed9
to
f04a5f8
Compare
@luckyh @lmr @yanglei-rh Requesting to please review this PR and let me know the valuable inputs. Thank you! |
Forwarding this to the maintainers who have better experience on libvirt use cases than me. @dzhengfy @chunfuwen @chloerh @Yingshun would you mind to help review this PR? thanks in advance! |
Hi @TasmiyaNalatwad Thanks for help sync this MR first, I am not a libvirt tester, so @luckyh mentioned user are more suitable candidate. |
I'll run some tests with this pr. |
Hi @chloerh Would like to know if you've had a chance to run the tests for the patch. Please let me know if there's any feedback or input you can share. Will work on it. Thanks! |
:return: return ip-address if found for given mac in the | ||
virsh-net-dhcp-leases default table, else return None | ||
""" | ||
output = virsh.net_dhcp_leases("default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function will get dhcp lease from network "default" only, which might not be the default setting for test vms, right?
return super()._get_address(index, ip_version, session, timeout) | ||
except virt_vm.VMIPAddressMissingError: | ||
mac = self.get_mac_address(index).lower() | ||
ipaddr = utils_net.obtain_guest_ip_from_dhcp_leases(mac) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have another concern: we have this scenario:
modifying interface type from network to bridge, but keep the mac address. Seems the dhcp-lease will not be deleted for a while, but the ip address of interface must change. There's a chance we're getting the 'old' ip address, right?
Hi @TasmiyaNalatwad I have finished the run, but met some error which I'm not sure was brought by this patch. I have left 2 comments, Please check. Thanks. |
Thanks @chloerh Will look into the comments. |
Few of the times it is seen that the ip address is not being fetch and the avocado runs were failed with error "ERROR: Failures occurred while postprocess:\n\n: Guest virt-tests-vm1 dmesg verification failed: Login timeout expired (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC aa:bb:cc:dd:ee:ff') "
To handle this error the patch has been sent. The patch helps in obtaining ip address of the guest using "virsh-net-dhcp-leases default" command. If the guest mac address is found in the command output, the mac ipv4 address is obatined and updated in the address.cache