Feature: KVM: port isolation for guest VLANs on linux bridge (PVLAN-like isolation without OVS)

オープン
#14,712 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, linux

調査の方向性

Start by tracing InterfaceDef and the domain XML parser, then inspect BridgeVifDriver and the agent configuration that controls KVM networking. The issue describes the desired behavior and limitations, but leaves open whether isolation should be configured per host or through the network’s PVLAN setting. Done means user VM NICs on configured tagged VLANs are isolated, system VM NICs remain non-isolated, and the agent handles unsupported libvirt versions.

索引モデルが issue の本文から書いたものです。

説明

The required feature described as a wish

As having KVM hosts with linux bridge, I would like VMs on selected shared guest VLANs to be unable to reach each other, while still reaching the gateway and the virtual router.

Use case: advanced zone without security groups, plus a shared subnet where tenants must not talk to each other. PVLAN is the natural fit, but on KVM it is only implemented for OVS (the #13521 might be related).
On linux bridge there is no supported way to get this.

Today we work around it with a groovy agent hook that adds <port isolated='yes'/> to the NIC.
But that proven to be unreliable:

  • the hook only runs on VM start, so NIC hot-plug, replug and live NIC updates might
    produce non-isolated ports;
  • a failing hook is skipped and the VM starts without isolation;
  • the hook also isolates the virtual router's NIC.
Proposal

Use the kernel's bridge port isolation, which libvirt exposes as
<port isolated='yes'/>:

  1. InterfaceDef can emit the element, and the domain XML parser reads it back,
    so NIC definitions rebuilt from a running domain keep it.
  2. A new agent property, network.bridge.port.isolation.vlans, lists the guest
    VLANs to isolate. An entry is a VLAN ID, or label:vlan to match only the
    physical network with that KVM traffic label, e.g. cloudbr1:100,200.
  3. BridgeVifDriver plugs user VM guest NICs on those VLANs as isolated ports.
    System VM NICs stay non-isolated.
  4. The agent refuses to start if the property is set and libvirt is too old.

Isolation between hosts still relies on the uplink switch (e.g. PVLAN there).

Limitations / open questions
  • Configuration is per host, not per network. Would maintainers prefer this to
    be driven by the network's existing PVLAN setting instead? Part 1 above is
    needed either way.
  • Only isolated/promiscuous semantics; community PVLANs cannot be expressed.
  • Tagged VLAN guest networks only (no untagged, no VXLAN).

I have a working patch proposal (AI generated -- https://github.com/durdin85/cloudstack/tree/kvm-bridge-port-isolation ) and can open a PR if needed, but it would be good to have some human control over this.
Thank you.

主要言語
Java
スター
3.1k
フォーク
1.4k
平均マージ
7日 4時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/cloudstack のほかの issue

apache/cloudstack の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。