-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debian_hypervisor: synchronize team0_x port state with OVS
On hypervisor shutdown, OVS is stopped a long time before the team0_x ports are shutdown as well. In the meantime: * The switching done by OVS is stopped * The corosync totem stops circulating and nodes are disconnected from the pacemake cluster which leads to resources being stopped. * After a while, RTSP detects this and change ports configuration to avoid the shutdown node and corosync/pacemaker start back with the left nodes. To avoid this, use systemd services to shutdown team0_x ports as soon as OVS is stopped to signal RTSP to change the configuration "instantly" and thus, avoid the corosync totem timeout. Signed-off-by: Yoann Congal <[email protected]>
- Loading branch information
1 parent
e7523b2
commit 528e561
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Systemd unit wrapping around team0_* ports. | ||
# This can be used to synchronize ports link state with the service that use | ||
# them. | ||
|
||
[Unit] | ||
After=network.target | ||
DefaultDependencies=false | ||
Conflicts=shutdown.target | ||
Before=shutdown.target | ||
StopWhenUnneeded=true | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=networkctl up %i | ||
ExecStop=networkctl down %i | ||
|
||
[Install] | ||
# empty: This unit must be activated via Wants/Requires of other units that need | ||
# it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,9 +210,17 @@ | |
group: root | ||
mode: 0644 | ||
register: ovsvswitchd | ||
- name: Copy [email protected] file | ||
ansible.builtin.copy: | ||
src: [email protected] | ||
dest: /etc/systemd/system/[email protected] | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
register: team0_x_service | ||
- name: Restart ovs-vswitchd | ||
ansible.builtin.systemd: | ||
state: restarted | ||
daemon_reload: yes | ||
name: ovs-vswitchd | ||
when: ovsvswitchd.changed | ||
when: ovsvswitchd.changed or team0_x_service.changed |
4 changes: 4 additions & 0 deletions
4
roles/debian_hypervisor/templates/ovs-vswitchd_override.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
[Service] | ||
Slice=ovs.slice | ||
|
||
[Unit] | ||
Requires=team0_x@{{team0_0}}.service | ||
Requires=team0_x@{{team0_1}}.service |