MitchDrage opened a new issue, #14786:
URL: https://github.com/apache/cloudstack/issues/14786
### problem
On a ROUTED VPC, createStaticRoute always fails with "Failed to create a
static route", with either nexthop or gatewayid. Nothing is sent to the VR and
nothing useful is logged.
It looks like `VpcManagerImpl.applyStaticRoutes` picks the provider by
asking for the VPC's StaticNat provider. ROUTED VPC offerings can't have
StaticNat, so `getProviderForServiceInVpc` throws
`UnsupportedServiceException`. The `finally` block in
`CreateStaticRouteCmd.execute()` then throws its own `ServerApiException`,
which hides the original exception.
The job result:
```
"jobresult":{"errorcode":530,"errortext":"Failed to create a static route"}
```
The management server log has nothing between these two lines for the job:
```
INFO [o.a.c.f.j.i.AsyncJobMonitor] (API-Job-Executor-5:[ctx-22b8d4b6,
job-47083]) Add job-47083 into job monitoring
INFO [o.a.c.f.j.i.AsyncJobMonitor] (API-Job-Executor-5:[ctx-22b8d4b6,
job-47083]) Remove job-47083 from job monitoring
```
### versions
CloudStack 4.22.1.1, KVM. The same code is in 4.20 and main.
### The steps to reproduce the bug
1. Create a ROUTED VPC offering on the VPC virtual router with Static
routing, and a VPC from it.
2. Add a private gateway, e.g. 100.64.0.1/30 with gateway 100.64.0.2.
3. `createStaticRoute vpcid=<vpc> cidr=192.0.2.0/24 nexthop=100.64.0.2`, or
`createStaticRoute gatewayid=<gateway> cidr=192.0.2.0/24`.
4. The job fails with error 530 "Failed to create a static route" and the
route is removed.
### What to do about it?
When the VPC has no StaticNat service, use the provider of the Gateway
service. ROUTED VPC offerings always map Gateway to VpcVirtualRouter. I'll
raise a PR against 4.20.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]