NetworkGarbageCollector releases a network's VLAN while it still has live NICs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- cloud, infrastructure, networking
Hướng nghiên cứu
Trace NetworkGarbageCollector and the PowerReportMissing recovery path, then inspect nics and op_networks state during the reproduction steps. Verify live-NIC detection, power-state reconciliation, and VirtualRouter accounting against the described scenario. Done means garbage collection cannot release a VLAN while an unremoved NIC remains live.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
problem
When a VM's domain is detected missing (PowerReportMissing) past the graceful period (vm.op.wait.interval), CloudStack releases its NIC (broadcast_uri/isolation_uri -> NULL, nics_count) and marks the VM Stopped. If the VM's power state later resyncs back to Running (domain restored, HA restart, etc.), the NIC is never re-reserved and nics_count is never restored.
Separately, op_networks.nics_count never counts the network's own VirtualRouter NIC, so it under-counts from network creation. Combined, a single NIC release event can drive nics_count to 0 while the network still has live NICs (including on a Running VM).
NetworkGarbageCollector trusts nics_count==0 (plus a check of CloudStack's own DB-tracked "no non-Stopped instances") without verifying against the actual nics table or hypervisor state, and proceeds to stop the VR and release the VLAN back to the dynamic allocation pool - while it may still be bridged to a live VM. In our environment, GC's cleanup step also removes the host-level bridge, making the VM unrecoverable via a normal restart.
versions
tested on 4.22 (Maybe be observed on older versions too)
The steps to reproduce the bug
- Deploy a VM on an isolated network - note the nics_count = 1 (instead of 2 for VM and VR)
- Disable HA on the VM (as HA masks the issue)
- Perform
virsh destroy <vm-name>to simulate domain loss - backup the dumpxmlvirsh dumpxml <vm-name> > backup.xml - After the graceful period, CloudStack releases the NIC and decrements
nics_countto 0. - Restore the domain via
virsh create <dumped-xml>. VM resyncs toRunning, but NIC stays unreserved, counter stays 0 - Lower
network.gc.interval/network.gc.waitto accelerate the scavenger; restart management server. virsh destroyagain to bring the VM's tracked state back toStopped- GC fires: stops the VR, releases the VLAN, network transitions to
Allocatedbroadcast_uri=NULL, despite 2 live NICs still present innics.
...
What to do about it?
- On VM power-state resync to
Runningafter a missing-VM event, reconcile the NIC (broadcast_uri/isolation_uri/state=Reserved) and restorenics_count. - Harden
NetworkGarbageCollectorto verify live NIC count from thenicstable (WHERE network_id=? AND removed IS NULL) before tearing down a network, instead of trusting the cached counter alone - Include the VirtualRouter's own NIC in
nics_countfrom network creation
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.4k
- Merge trung bình
- 7 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 28
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudstack
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Đang mởbug component:kubernetes
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14070 · 5 bình luận ·
-
component:backup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Đang mởbug component:ceph
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/cloudstack#13989 · 3 bình luận ·
-
component:UI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/cloudstack#13944 · 3 bình luận ·
Tất cả issue của apache/cloudstack
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
infinispan/infinispan#18150 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
opensearch-project/k-NN#3597 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100