Skip to content

Commit

Permalink
drivers/kvm: Use ARP for retrieving interface ip addresses
Browse files Browse the repository at this point in the history
On platforms where dhcp lease status is not updated immediately after
domain creation it fails to list ip addresses until next refresh
happens resulting in the following error:

8<----------8<----------8<----------8<----------8<----------8<----------

Creating kvm2 VM (CPUs=2, Memory=4096MB, Disk=20480MB) ...
Failed to start kvm2 VM. Running "minikube delete" may fix it: creating
  host: create: Error creating machine: Error in driver during machine
  creation: IP not available after waiting: machine minikube didn't
  return IP after 1 minute

Exiting due to GUEST_PROVISION: Failed to start host: creating host:
  create: Error creating machine: Error in driver during machine
  creation: IP not available after waiting: machine minikube didn't
  return IP after 1 minute

8<----------8<----------8<----------8<----------8<----------8<----------

Using ARP instead of LEASE for ip address query is justifiable as
listing is done following the domain creation.

Fixes: #11459
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
  • Loading branch information
anoopcs9 committed Jan 25, 2022
1 parent fa5f67c commit 5cd9d78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/drivers/kvm/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func ifListFromAPI(conn *libvirt.Connect, domain string) ([]libvirt.DomainInterf
}
defer func() { _ = dom.Free() }()

ifs, err := dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE)
ifs, err := dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_ARP)
if err != nil {
return nil, fmt.Errorf("failed listing network interface addresses of domain %s: %w", domain, err)
}
Expand Down

0 comments on commit 5cd9d78

Please sign in to comment.