Redundant VRouter guest network on wrong interface
ISSUE TYPE
- Bug Report
COMPONENT NAME
redundant VPC Offering
CLOUDSTACK VERSION
master
CONFIGURATION
Standard cluster deployment regarding this issue. No changes made to sytemvm or the offerings involved.
OS / ENVIRONMENT
Seems to work only with OvS bridges. KVM with OvS Projects with VPCs
SUMMARY
Redundant vRouter Offering doesn't work because guest network is on wrong interface in vRouter
STEPS TO REPRODUCE
- Add VPC; choose Redundant VPC Offering
- Create a guest network/instance to allow for redundancy to build up
- some network is created on the wrong interface:

EXPECTED RESULTS
The guest network should be added on eth1 because this is the interface where both vRouters share the MAC address.
ACTUAL RESULTS
Redundancy state of the redundant routers changes from UNKNOWN to FAILED because conntrackd and keepalived cannot establish the VRRP redundancy between the two vRouters.
@DennisKonrad @svenvogel I will create a PR when I test ok with VPC & RvR & linux bridge.
@weizhouapache Yes you are right:
the second function prepareNetworkElementCommand(final IpAssocVpcCommand cmd) does NOT work for normal setup (linux bridge), if we apply the change in #3179 (comment)
That's the reason why I asked about why you want to apply the change in https://github.com/apache/cloudstack/issues/3179.
We also thought about another bug beeing the root cause. A wrong MAC seems very plausible. I will help test the PR.
@DennisKonrad if you look at CommandSetupHelper.java, you may find that IpAssocVpcCommand is send to hypervisors when associate a public IP, if VPC does not have redundant VRs. However, for VPC with RvRs, it always send IpAssocCommand (in createRedundantAssociateIPCommands), which does not make any sense.
There should be some issues caused by it in the past, some of them have been fixed by different way, for example 6fc389a044288e8f12f41a651a711a1ab7113b86 . However, I insist that we should send IpAssocVpcCommand instead of IpAssocCommand , even it might lead to some issues.
@DennisKonrad I have set up a testing environment with OVS. I cannot reproduce this issue you mentioned. However, I found some issues in VPC and isolated networks with redundant VRs.
@ustcweizhou @weizhouapache thanks for the test. We encounter the problem in 2016 that VPC was working from outside but if we use a NAT with Public IP it was not working. Thats because Public Adress was not set on correct interface (dev id). this was the fixed from @fmaximus for the non-redundant router.
two questions:
You are sure thats working in your test environment with ovs? (NAT, Firewall ...) if its so then we need to test it without #2304
did you remove #2304 in your ovs test setup and used the change from #3179?
can you explain how this commit help 6fc389a in our actually problem?
did you test both redundant and non-redundant router?
However, I insist that we should send IpAssocVpcCommand instead of IpAssocCommand , even it might lead to some issues.
like @DennisKonrad wrote above. if we use "IpAssocVpcCommand" we get the issues with the VPC redundant router. they are start up and reboot immediately. that why he ask "Do you think it would be possible to write a mac address map based function for both (ovs and linux bridge)?" thats why we ask can you fix this problem?
`{"ip_address":[
{"public_ip":"172.20.20.12","source_nat":true,"add":true,"one_to_one_nat":false,"first_i_p":true,"gateway":"172.20.0.1","netmask":"255.255.0.0","vif_mac_address":"1e:00:d5:00:00:c2","new_nic":false,"nw_type":"Public"}],"type":"ips"}```
@svenvogel #2304 is helpful for VPC with single router. we do not need to revert it. we need to make similar change for OVS in LibvirtComputingResource.java. I have found some issues with isolated networks in my setup with OVS.
@weizhouapache Leaving https://github.com/apache/cloudstack/pull/2304 in place sounds good. To me it looks like the more stable approach.
Do you think the changes to get the isolated networks up to speed require some heavy lifting? If theres something to test I can do so.
@DennisKonrad There are many issues actually and all these issues are correlated.
we need to make sure all following settings are working
network/vpc type in cloudstack (1) vpc with single VR (2) network with single VR (3) vpc with RvR (4) network with RvR
network type on kvm (1) linux bridge (2) ovs
actions (1) associate public IP (same range as source nat) (2) release public IP (same range as source nat) (3) associate first /second/third... public ip (different range as source nat) (4) release first /second/third... public IP (different range as source nat)
It is not a easy fix.
I have made some bug fixes. see https://github.com/ustcweizhou/cloudstack/commits/4.14.0-vpc-vr-issues
@weizhouapache I'll setup a test environment to test the ovs part. It will take some days. I'll come back with feedback
@weizhouapache Just writing a short feedback so you know where I'm at. At the moment it seems the redundant VPC does not deploy with your changes.
After deployment of the first router, cloudstack management isn't able to connect to the agent running on that router. (The second VPC router never get's started because the first one fails.) My guess is that the APIPA address is the culprit.
I will setup a systemvm with password access so I can look into the VPC router and give you more information on that. The non-redundant VPC deploys just fine.
@weizhouapache After a first look into the router I can say the APIPA is not the problem. There's something else wrong. I will have a look and come back to report
@DennisKonrad it is still in progress. The issue you mentioned should be caused by the last commit. It is difficult to test all scenarios. I will write some test scripts at first.
@weizhouapache Ok, kindly give me a ping if there's something to test or help.
@DennisKonrad I have uploaded a commit to fix the regression issue. https://github.com/ustcweizhou/cloudstack/commits/4.14.0-vpc-vr-issues I am writing scripts for automation test.
@weizhouapache The first test looks promising. The issue with the agent is gone. Redundant routers are deploying fine now. Also it looks like the VRRP IP is on the right interface. The routers are negotiating BACKUP and Master.
I'll go on and test NAT and features. I'll report back when done.
@weizhouapache I tested multiple things that work fine (for redundant VPC offering):
- [x] NAT is working (one NAT ip)
- [x] Settings seem to go to both routers
- [x] Redundancy heals when one router dies
- [x] Failover of traffic works when one master dies
- [x] Adding multiple Guest Networks works
For things that do not work I have found:
At the moment it's only possible to deploy one VM in a GuestNet (when using redundant VPC with OvS). For the second VM an error occurs. If one deletes that one working VM it's possible to deploy again. But max 1 VM. Even if I try to deploy in another GuestNet (in the same VPC).
Management log only shows:
click to unfold
com.cloud.exception.InsufficientServerCapacityException: Unable to create a deployment for VM[User|i-4-18-VM]Scope=interface com.cloud.dc.DataCenter; id=1
at org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl.reserveVirtualMachine(VMEntityManagerImpl.java:215)
at org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl.reserve(VirtualMachineEntityImpl.java:200)
at com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:4676)
at com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:4231)
at com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:4221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:174)
at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:174)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy204.startVirtualMachine(Unknown Source)
at org.apache.cloudstack.api.command.user.vm.DeployVMCmd.execute(DeployVMCmd.java:588)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:156)
at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:583)
at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:531)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Also I noticed another error in the management log that could be related:
click to unfold
com.cloud.exception.ResourceUnavailableException: Resource [DataCenter:1] is unreachable: Can't find at least one router!
at com.cloud.network.element.VirtualRouterElement.removeDhcpEntry(VirtualRouterElement.java:961)
at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.cleanupNicDhcpDnsEntry(NetworkOrchestrator.java:3029)
at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.cleanupNics(NetworkOrchestrator.java:2023)
at com.cloud.vm.VirtualMachineManagerImpl.advanceExpunge(VirtualMachineManagerImpl.java:525)
at com.cloud.vm.VirtualMachineManagerImpl.advanceExpunge(VirtualMachineManagerImpl.java:490)
at com.cloud.vm.UserVmManagerImpl.expunge(UserVmManagerImpl.java:2191)
at com.cloud.vm.UserVmManagerImpl.destroyVm(UserVmManagerImpl.java:2876)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:174)
at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:174)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy204.destroyVm(Unknown Source)
at org.apache.cloudstack.api.command.user.vm.DestroyVMCmd.execute(DestroyVMCmd.java:137)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:156)
at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:583)
at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:531)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
@DennisKonrad thanks for feedback !
InsufficientServerCapacityException might be caused by two reasons (1) capacity on the platform (2) some issues when apply network rules in virtual routers. Can you see some Exception in the agent.log on the server where the VR is running ?
@ustcweizhou You are completely right. There was a ressource issue i failed to see. With that gone multiple VMs deploy just fine.
I will start testing multiple public IPs and address ranges
@DennisKonrad vpc looks good now. However I found an issue with isolated networks (rvr or non-rvr both)
@DennisKonrad do you use the network offering created by following http://docs.cloudstack.apache.org/en/latest/plugins/ovs-plugin.html ?