diff --git a/XenModel/Actions/Network/CreateSriovAction.cs b/XenModel/Actions/Network/CreateSriovAction.cs index 24c95123f..5194520ec 100644 --- a/XenModel/Actions/Network/CreateSriovAction.cs +++ b/XenModel/Actions/Network/CreateSriovAction.cs @@ -56,10 +56,37 @@ namespace XenAdmin.Actions // Create the new network XenRef networkRef = XenAPI.Network.create(Session, newNetwork); + PIF pifOnMaster =null; foreach (PIF thePif in selectedPifs) { - Network_sriov.async_create(Session, thePif.opaque_ref, networkRef); + Host host = thePif.Connection.Resolve(thePif.host); + if (host == null) + continue; + + if (host.IsMaster()) + { + pifOnMaster = thePif; + break; + } } + + Connection.ExpectDisruption = true; + + // Enable SR-IOV network on Pool Master + RelatedTask = Network_sriov.async_create(Session, pifOnMaster.opaque_ref, networkRef); + PollToCompletion(0, 100); + + // Enable SR-IOV network on Pool Slaves + selectedPifs.Remove(pifOnMaster); + foreach (PIF thePif in selectedPifs) + { + Network_sriov.create(Session, thePif.opaque_ref, networkRef); + } + } + + protected override void Clean() + { + Connection.ExpectDisruption = false; } } }