Add additional debug info for mac searching

Reporting the MAC address being looked for in the ARP table should help
determine why some machines pick up an address belonging to another
when starting multiple VM's in parallel.
This commit is contained in:
Darragh Bailey 2016-01-26 17:00:53 +00:00
parent c5266a4a25
commit e21465771d
3 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,7 @@ module VagrantPlugins
# connection was done via ssh.
env[:ip_address] = nil
env[:metrics]["instance_ip_time"] = Util::Timer.time do
@logger.debug("Searching for IP for MAC address: #{domain.mac}")
env[:ui].info(I18n.t("vagrant_libvirt.waiting_for_ip"))
retryable(:on => Fog::Errors::TimeoutError, :tries => 300) do
# If we're interrupted don't worry about waiting

View File

@ -21,5 +21,8 @@ shared_context "libvirt" do
# drivers also call vm_exists? during init;
allow(connection).to receive(:servers).with(kind_of(String)).
and_return(connection_result(result: nil))
# return some information for domain when needed
allow(domain).to receive(:mac).and_return("9C:D5:53:F1:5A:E7")
end
end

View File

@ -58,6 +58,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::WaitTillUp do
expect(ui).to receive(:info).with("Waiting for domain to get an IP address...")
expect(ui).to receive(:info).with("Waiting for SSH to become available...")
logger = subject.instance_variable_get(:@logger)
expect(logger).to receive(:debug).with(/Searching for IP for MAC address: .*/)
expect(logger).to receive(:info).with("Got IP address 192.168.121.2")
expect(logger).to receive(:info).with(/Time for getting IP: .*/)
expect(env[:machine].communicate).to_not receive(:ready?)