Bring up management network if it's not started yet

If I suspend using managedsave suspend_mode, then reboot the hypervisor,
and try to resume the box, then it fails because the management network
is not started (of course unless it's configured to autostart, which is
not the default behaviour).

This patch makes vagrant to start (and even recreate) the management
network if it's down.

Fixes vagrant-libvirt/vagrant-libvirt#761
This commit is contained in:
Ihar Hrachyshka
2017-04-13 13:25:19 -07:00
parent 6ddf16d24d
commit b56b97fd92

View File

@@ -76,6 +76,7 @@ module VagrantPlugins
b2.use Call, IsSuspended do |env2, b3|
# if vm is suspended resume it then exit
if env2[:result]
b3.use CreateNetworks
b3.use ResumeDomain
next
end
@@ -127,6 +128,7 @@ module VagrantPlugins
end
b2.use Call, IsSuspended do |env2, b3|
b3.use CreateNetworks if env2[:result]
b3.use ResumeDomain if env2[:result]
end
@@ -272,6 +274,7 @@ module VagrantPlugins
b3.use MessageNotSuspended
next
end
b3.use CreateNetworks
b3.use ResumeDomain
end
end