4.23.0.0: restartVPC cleanup=true with public IPs on two VLANs fails with UnsupportedOperationException and leaves the VPC without a backup router

オープン 初心者向け
#14,430 コメント 4 件 リアクション 0 件 担当者 1 名 GitHub で見る

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

@bernardodemarco がすでに取り組んでいます。

2026年10月28日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java

調査の方向性

NetworkHelperImpl.javaの761行目付近を読み、次にpublicConfigの値を165行目付近のVpcNetworkHelperImpl.reallocateRouterNetworksまで追ってください。2つのVLANの設定とrestartVPC cleanup=trueを再現するか、変更可能なリストの動作を対象とした回帰テストを追加してください。ルーターのネットワーク再割り当てが両方のVLANを受け入れ、ローリング再起動がバックアップルーターを伴って完了すれば完了です。

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

説明

bug
problem

NetworkHelperImpl.java line 761 (4.23.0.0 and main) is:

publicConfig.put(publicNetworks.get(0), List.of(defaultNic));

List.of returns an immutable list. VpcNetworkHelperImpl.reallocateRouterNetworks (line 165) then calls addAll on it and throws UnsupportedOperationException (ImmutableCollections.addAll), through NetworkHelperImpl.deployRouterWithTemplates (line 542) and VpcManagerImpl.rollingRestartVpc (line 4046). 4.22.0.0 used new ArrayList(Arrays.asList(defaultNic)).

The API answers "Internal Server Error". The rolling restart has already destroyed the backup router, and the new router stays Stopped.

Related: #12621 (fixed by #12622 in 4.22) has the same setup but a different error ("cidr is not formatted correctly"). This one is a separate bug.

versions

CloudStack 4.23.0.0 and main. 4.22.0.0 is not affected. KVM.

The steps to reproduce the bug
  1. A zone with public IP ranges on two VLANs.
  2. A redundant VPC with its source NAT IP on the first VLAN.
  3. Acquire a second public IP from the second VLAN and enable static NAT on it to a VM in the VPC. (A bare IP with no NAT or rule does not reach this code path; see VpcManagerImpl.isIpAllocatedToVpc.)
  4. restartVPC cleanup=true.
What to do about it?

Use a mutable list again, for example:

publicConfig.put(publicNetworks.get(0), new ArrayList<>(List.of(defaultNic)));

We carry this one-line change. With it, the new routers get NICs on both VLANs and the restart succeeds.

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

環境構築

はじめの一歩

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

apache/cloudstack のほかの issue

apache/cloudstack の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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