Bug 39708 - [Open vSwitch] Реализация OVSPatchPort
Summary: [Open vSwitch] Реализация OVSPatchPort
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: etcnet (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Mikhail Efremov
QA Contact: qa-sisyphus
URL:
Keywords: RS
Depends on:
Blocks:
 
Reported: 2021-02-20 15:26 MSK by Evgeniy Korneechev
Modified: 2022-02-11 22:29 MSK (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeniy Korneechev 2021-02-20 15:26:29 MSK
Если между двумя ovsbr необходимо поднять OVSPatchPort делаем два интерфейса:
# cat patch0/options 
TYPE=ovsport
BRIDGE=vmbr0
OVS_EXTRA="set port patch0 trunks=2,4,11 -- set interface patch0 type=patch options:peer=patch1"

# cat patch1/options 
TYPE=ovsport
BRIDGE=vmbr1
OVS_EXTRA="set port patch1 trunks=2,4,11 -- set interface patch1 type=patch options:peer=patch0"

Однако из-за того что в /etc/net/scripts/create-ovsport имеется строка:
iface_exists $NAME || INTERNAL_PORT="-- set interface $NAME type=internal "

Порт (при отсутствии интерфейс) создается с типом internal естественно:
# journarctl -u network
[...]
фев 20 15:09:04 altpve1.rs ovs-vsctl[28039]: ovs|00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl -t 10 -- --may-exist add-port vmbr0 patch0 -- set port patch0 trunks=2,4,11 -- set interface patch0 type=patch options:peer=patch1 -- set interface patch0 type=internal

Необходимо ввести в etcnet дополнительную переменную - аля OVS_PATCH=yes или OVS_PORT_TYPE=patch/internal, и чтобы скрипт create-ovsport мог проверить ее
Comment 1 Evgeniy Korneechev 2021-03-02 10:26:27 MSK
(Ответ для Evgeniy Korneechev на комментарий #0)
> Необходимо ввести в etcnet дополнительную переменную - аля OVS_PATCH=yes

Для данной реализации сделал патч:
# diff create-ovsport~ create-ovsport -u
--- create-ovsport~	2020-11-03 10:42:30.000000000 +0300
+++ create-ovsport	2021-03-02 10:22:14.445808312 +0300
@@ -9,6 +9,8 @@
 }
 
 iface_is_up $BRIDGE || $SCRIPTDIR/ifup $BRIDGE
-iface_exists $NAME || INTERNAL_PORT="-- set interface $NAME type=internal "
+iface_exists $NAME || PORT_TYPE="-- set interface $NAME type=internal "
 
-$OVS_VSCTL -t $OVS_VSCTL_TIMEOUT -- --may-exist add-port "$BRIDGE" "$NAME" ${VID+tag=$VID} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} $INTERNAL_PORT && print_progress
+[ -z $OVS_PATCH ] || PORT_TYPE="-- set interface $NAME type=patch "
+
+$OVS_VSCTL -t $OVS_VSCTL_TIMEOUT -- --may-exist add-port "$BRIDGE" "$NAME" ${VID+tag=$VID} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} $PORT_TYPE && print_progress
Comment 2 Repository Robot 2022-02-11 22:29:12 MSK
etcnet-0.9.22-alt1 -> sisyphus:

 Fri Feb 11 2022 Alexey Shabalin <shaba@altlinux> 0.9.22-alt1
 - ovsport: OVS_PATCH option (Closes: #39708).
 - ovsport: HOST must be set.
 - ovsport: BRIDGE must be set.
 - ovsbond: BRIDGE must be set.
 - ovsbond: support VLAN id (Closes: #39707).
 - openvswitch: remove interface before create (Closes: #39709).