Skip to content

Commit

Permalink
msi: add ovs-vswitchd trigger info
Browse files Browse the repository at this point in the history
This patch changes the service ovs-vswitchd from "auto" execution to
"demand" start.

This patch also introduces a custom action for the ovs-vswitchd service
in which the following command will be executed before the service startup:

sc triggerinfo ovs-vswitchd \
start/strcustom/6066F867-7CA1-4418-85FD-36E3F9C0600C/VmmsWmiEventProvider

The above command is a service trigger available since Windows 7.
More on the topic:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd405513%28v=vs.85%29.aspx

In out case we will wait until Microsoft-Windows-Hyper-V-VMMS has triggered
that the WMI provider: VmmsWmiEventProvider has started.

The change is needed because the network service inside VMMS starts slower than
ovs-vswitchd, which will cause a race condition because we check if the OVS
extension is enabled on a single switch.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
  • Loading branch information
Alin Serdean authored and shettyg committed Feb 27, 2017
1 parent 9ab5390 commit 7a98303
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions windows/ovs-windows-installer/CustomActions.wxs
Expand Up @@ -63,5 +63,11 @@
<CustomAction Id="ChangeOvsVSwitchdService"
BinaryKey="OVSActions"
JScriptCall="changeServiceAction" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="AddTriggerToOvsVswitchdService_Prop" Property="AddTriggerToOvsVswitchdService"
Value='"[System64Folder]sc.exe" triggerinfo ovs-vswitchd "start/strcustom/6066F867-7CA1-4418-85FD-36E3F9C0600C/VmmsWmiEventProvider"|0|failed to add triggerinfo to ovs-vswitchd service'
Execute="immediate" />
<CustomAction Id="AddTriggerToOvsVswitchdService"
BinaryKey="OVSActions"
JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />
</Fragment>
</Wix>
4 changes: 3 additions & 1 deletion windows/ovs-windows-installer/Product.wxs
Expand Up @@ -83,6 +83,8 @@
<Custom Action="InitializeDB_Prop" After="CostFinalize"><![CDATA[REMOVE <> "ALL" AND (&OpenvSwitchDriver = 3)]]></Custom>
<Custom Action="InitializeDB" After="ChangeOvsdbServerService" ><![CDATA[REMOVE <> "ALL" AND (&OpenvSwitchDriver = 3)]]></Custom>

<Custom Action="AddTriggerToOvsVswitchdService_Prop" After="CostFinalize"><![CDATA[NOT Installed AND (&OpenvSwitchDriver = 3)]]></Custom>
<Custom Action="AddTriggerToOvsVswitchdService" Before="ChangeOvsVSwitchdService"><![CDATA[NOT Installed AND (&OpenvSwitchDriver = 3)]]></Custom>
<Custom Action="StartOvsVSwitchdService_Prop" After="CostFinalize"><![CDATA[NOT Installed AND (&OpenvSwitchDriver = 3)]]></Custom>
<Custom Action="RestartOvsVSwitchdService_Prop" After="CostFinalize"><![CDATA[Installed AND REMOVE <> "ALL" AND (&OpenvSwitchDriver = 3)]]></Custom>
<Custom Action="ChangeOvsVSwitchdService" Before="InstallFinalize"><![CDATA[REMOVE <> "ALL" AND (&OpenvSwitchDriver = 3)]]></Custom>
Expand Down Expand Up @@ -207,7 +209,7 @@
Name="ovs-vswitchd"
DisplayName="Open vSwitch Service"
Description="Open vSwitch Service"
Start="auto"
Start="demand"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no">
Expand Down

0 comments on commit 7a98303

Please sign in to comment.