mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
CA-286342: SRIOV should be enabled on master when 2 NICs are not the … (#1998)
* CA-286342: SRIOV should be enabled on master when 2 NICs are not the same type Signed-off-by: Jisheng Xing <jisheng.xing@citrix.com> * set the ExpectDisruption as false after action finished
This commit is contained in:
parent
59ba1db95f
commit
a635c6e3f5
@ -56,10 +56,37 @@ namespace XenAdmin.Actions
|
||||
// Create the new network
|
||||
XenRef<XenAPI.Network> 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<XenAPI.Host>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user