You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Static routes can't be created on ROUTED VPCs #14786
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
Create a ROUTED VPC offering on the VPC virtual router with Static routing, and a VPC from it.
Add a private gateway, e.g. 100.64.0.1/30 with gateway 100.64.0.2.
createStaticRoute vpcid=<vpc> cidr=192.0.2.0/24 nexthop=100.64.0.2, or createStaticRoute gatewayid=<gateway> cidr=192.0.2.0/24.
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.
Activity