VMware NSX network implementation can fail before backing DV port group is visible
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 1.4k
- 平均合并
- 6 天 19 小时
- 30 天内合并 PR
- 32
描述
### Problem
On VMware environments using the NSX integration, implementing a guest network can fail during `PlugNicCommand` even though `CreateNsxSegmentCommand` has already succeeded.
The NSX segment is created outside vCenter. Its backing distributed virtual port group can therefore take a short time to become visible through the vCenter API. `HypervisorHostHelper.prepareNetwork` currently performs only one immediate lookup for NSX networks and returns failure when that first lookup is empty.
Sanitized management-server sequence:
```text
CreateNsxSegmentCommand ... NsxAnswer result=true
Prepare network on vmwaredvs
Failed to create guest network
PlugNicAnswer result=false
```
The failure rolls back the NIC attachment and prevents the persistent VPC guest network from being implemented.
### Versions
- Apache CloudStack 4.22.1.0
- VMware vSphere / vCenter 8.0.3
- CloudStack NSX integration
### Steps to reproduce
1. Configure a VMware zone with the CloudStack NSX integration.
2. Create an NSX-backed VPC guest network.
3. Allow the NSX segment command to complete while the backing DV port group is not yet visible through vCenter.
4. Observe the immediate DV port group lookup fail in `HypervisorHostHelper.prepareNetwork`, followed by a failed `PlugNicCommand`.
### Expected behavior
After successful NSX segment creation, CloudStack should use its existing bounded DV port group readiness wait before attempting to attach the NIC. If the port group never becomes visible, the existing timeout should still fail the operation cleanly.
### Proposed fix
Enable the existing `waitForDvPortGroupReady` path for NSX broadcast domains and add a regression test covering an empty first vCenter lookup followed by a successful lookup.
贡献指南
调研方向
从 HypervisorHostHelper.prepareNetwork 开始,跟踪 PlugNicCommand 期间使用的现有 waitForDvPortGroupReady 路径。为第一次 vCenter 查找为空、随后查找成功的情况添加 issue 中描述的回归测试,并验证有界超时仍能处理永远不会出现的 port group。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- infrastructure, networking
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 25/100