Skip to content

CLOUDSTACK-9801: IPSec VPN does not work after vRouter reboot or recreate - #1966

Merged
yadvr merged 1 commit into
apache:4.9from
Slair1:CLOUDSTACK-9801--IPSec-VPN-does-not-work-after-vRouter-reboot-or-recreate
Aug 4, 2017
Merged

CLOUDSTACK-9801: IPSec VPN does not work after vRouter reboot or recreate#1966
yadvr merged 1 commit into
apache:4.9from
Slair1:CLOUDSTACK-9801--IPSec-VPN-does-not-work-after-vRouter-reboot-or-recreate

Conversation

@Slair1

Copy link
Copy Markdown
Contributor

After a vRouter is recreated (e.g. reboot via CloudStack UI) and Remote Access VPN enabled, VPN won't work anymore. Here is the abbreviated output of "ipsec auto -status" while we were having the issue:

root@r-10-VM:~# ipsec auto --status
000 using kernel interface: netkey
000 interface lo/lo 127.0.0.1
000 interface lo/lo 127.0.0.1
000 interface eth0/eth0 169.254.1.45
000 interface eth0/eth0 169.254.1.45
000 %myid = (none)

After this commit, the following occurs and VPNs work:


root@r-10-VM:~# ipsec auto --status
000 using kernel interface: netkey
000 interface lo/lo 127.0.0.1
000 interface lo/lo 127.0.0.1
000 interface eth0/eth0 169.254.1.45
000 interface eth0/eth0 169.254.1.45
000 interface eth1/eth1 xxx.xxx.xxx.172
000 interface eth1/eth1 xxx.xxx.xxx.172
000 interface eth2/eth2 192.168.1.1
000 interface eth2/eth2 192.168.1.1
000 %myid = (none)

eth1 interface IP is masked, but now ipsec sees all the interfaces and VPN works.

Looks like this bug was introduced by Pull Request #1423

It added code to start ipsec (cloudstack/systemvm/patches/debian/config/opt/cloud/bin/configure.py)

if vpnconfig['create']:
logging.debug("Enabling remote access vpn on "+ public_ip)
CsHelper.start_if_stopped("ipsec")

@swill

Copy link
Copy Markdown
Contributor

I can't see what branch this is opened against on my phone. What version of ACS is this opened against and which version do you have a problem in. The reason I ask is because #1741 was added in master to upgrade from openswan to strongswan. . Thx...

@asfbot

Copy link
Copy Markdown

Sean Lair on dev@cloudstack.apache.org replies:
It is open against the 4.9 branch.

We are running 4.9.2.0, looks like it affects all 4.9.x.x

We haven't tested against 4.10 (strongswan) yet. But it could be a problem=
and will be worth testing. If strongswan starts before cloudstack adds th=
e nics to the VM it could have same issue.
=20
on of ACS is this opened against and which version do you have a problem in=
. The reason I ask is because #1741 was added in master to upgrade from ope=
nswan to strongswan. . Thx...=20
ur
e
se

@asfbot

Copy link
Copy Markdown

Will Stevens on dev@cloudstack.apache.org replies:
I ha e done pretty extensive testing of the strongswan implementation, but
would be happy for you to verify if the problem exists in 4.10.

@kiwiflyer

Copy link
Copy Markdown
Contributor

@Slair1@swill Gents, where do we stand on this PR? I know there is a whole bunch of stuff related to this in 4.10, but this was opened against 4.9.

@cloudmonger

Copy link
Copy Markdown

ACS CI BVT Run

Sumarry:
Build Number 760
Hypervisor xenserver
NetworkType Advanced
Passed=108
Failed=2
Skipped=12

Link to logs Folder (search by build_no):https://www.dropbox.com/sh/r2si930m8xxzavs/AAAzNrnoF1fC3auFrvsKo_8-a?dl=0

Failed tests:

  • test_list_ids_parameter.py

  • ContextSuite context=TestListIdsParams>:setup Failing since 21 runs

  • test_volumes.py

  • test_06_download_detached_volume Failed

Skipped tests:
test_vm_nic_adapter_vmxnet3
test_01_verify_libvirt
test_02_verify_libvirt_after_restart
test_03_verify_libvirt_attach_disk
test_04_verify_guest_lspci
test_05_change_vm_ostype_restart
test_06_verify_guest_lspci_again
test_static_role_account_acls
test_11_ss_nfs_version_on_ssvm
test_nested_virtualization_vmware
test_3d_gpu_support
test_deploy_vgpu_enabled_vm

Passed test suits:
test_deploy_vm_with_userdata.py
test_affinity_groups_projects.py
test_portable_publicip.py
test_vm_snapshots.py
test_over_provisioning.py
test_global_settings.py
test_scale_vm.py
test_service_offerings.py
test_routers_iptables_default_policy.py
test_loadbalance.py
test_routers.py
test_reset_vm_on_reboot.py
test_deploy_vms_with_varied_deploymentplanners.py
test_network.py
test_router_dns.py
test_non_contigiousvlan.py
test_login.py
test_deploy_vm_iso.py
test_public_ip_range.py
test_multipleips_per_nic.py
test_metrics_api.py
test_regions.py
test_affinity_groups.py
test_network_acl.py
test_pvlan.py
test_nic.py
test_deploy_vm_root_resize.py
test_resource_detail.py
test_secondary_storage.py
test_vm_life_cycle.py
test_routers_network_ops.py
test_disk_offerings.py

@Slair1

Copy link
Copy Markdown
ContributorAuthor

@kiwiflyer I'm not sure if this issue still exists in 4.10, but it is an issue in 4.9. We've been running this fix since February and it has fixed it. FYI, it is the same code/logic used on line 458. Let me know if you need anything on this

@yadvr

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-813

@yadvr

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1215)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37222 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1966-t1215-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Test completed. 46 look ok, 3 have error(s)

TestResultTime (s)Test File
test_04_rvpc_privategw_static_routesFailure441.94test_privategw_acl.py
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80Failure288.56test_internal_lb.py
test_02_list_snapshots_with_removed_data_storeError0.04test_snapshots.py
test_01_vpc_site2site_vpnSuccess150.21test_vpc_vpn.py
test_01_vpc_remote_access_vpnSuccess66.24test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpnSuccess276.32test_vpc_vpn.py
test_02_VPC_default_routesSuccess260.44test_vpc_router_nics.py
test_01_VPC_nics_after_destroySuccess633.17test_vpc_router_nics.py
test_05_rvpc_multi_tiersSuccess500.04test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nicsSuccess1371.53test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routersSuccess584.17test_vpc_redundant.py
test_02_redundant_VPC_default_routesSuccess790.52test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACLSuccess1384.74test_vpc_redundant.py
test_09_delete_detached_volumeSuccess151.61test_volumes.py
test_08_resize_volumeSuccess156.50test_volumes.py
test_07_resize_failSuccess161.54test_volumes.py
test_06_download_detached_volumeSuccess156.41test_volumes.py
test_05_detach_volumeSuccess145.77test_volumes.py
test_04_delete_attached_volumeSuccess146.29test_volumes.py
test_03_download_attached_volumeSuccess151.32test_volumes.py
test_02_attach_volumeSuccess79.23test_volumes.py
test_01_create_volumeSuccess768.04test_volumes.py
test_deploy_vm_multipleSuccess292.95test_vm_life_cycle.py
test_deploy_vmSuccess0.03test_vm_life_cycle.py
test_advZoneVirtualRouterSuccess0.02test_vm_life_cycle.py
test_10_attachAndDetach_isoSuccess27.09test_vm_life_cycle.py
test_09_expunge_vmSuccess125.19test_vm_life_cycle.py
test_08_migrate_vmSuccess141.61test_vm_life_cycle.py
test_07_restore_vmSuccess0.12test_vm_life_cycle.py
test_06_destroy_vmSuccess130.88test_vm_life_cycle.py
test_03_reboot_vmSuccess125.86test_vm_life_cycle.py
test_02_start_vmSuccess10.20test_vm_life_cycle.py
test_01_stop_vm_forcedSuccess5.14test_vm_life_cycle.py
test_01_stop_vmSuccess30.27test_vm_life_cycle.py
test_CreateTemplateWithDuplicateNameSuccess136.04test_templates.py
test_08_list_system_templatesSuccess0.04test_templates.py
test_07_list_public_templatesSuccess0.04test_templates.py
test_05_template_permissionsSuccess0.06test_templates.py
test_04_extract_templateSuccess5.22test_templates.py
test_03_delete_templateSuccess5.10test_templates.py
test_02_edit_templateSuccess90.13test_templates.py
test_01_create_templateSuccess80.69test_templates.py
test_10_destroy_cpvmSuccess161.44test_ssvm.py
test_09_destroy_ssvmSuccess224.19test_ssvm.py
test_08_reboot_cpvmSuccess101.56test_ssvm.py
test_07_reboot_ssvmSuccess133.19test_ssvm.py
test_06_stop_cpvmSuccess131.71test_ssvm.py
test_05_stop_ssvmSuccess133.52test_ssvm.py
test_04_cpvm_internalsSuccess1.01test_ssvm.py
test_03_ssvm_internalsSuccess2.98test_ssvm.py
test_02_list_cpvm_vmSuccess0.14test_ssvm.py
test_01_list_sec_storage_vmSuccess0.17test_ssvm.py
test_01_snapshot_root_diskSuccess11.17test_snapshots.py
test_04_change_offering_smallSuccess205.23test_service_offerings.py
test_03_delete_service_offeringSuccess0.04test_service_offerings.py
test_02_edit_service_offeringSuccess0.08test_service_offerings.py
test_01_create_service_offeringSuccess0.12test_service_offerings.py
test_02_sys_template_readySuccess0.13test_secondary_storage.py
test_01_sys_vm_startSuccess0.19test_secondary_storage.py
test_09_reboot_routerSuccess30.29test_routers.py
test_08_start_routerSuccess25.43test_routers.py
test_07_stop_routerSuccess10.16test_routers.py
test_06_router_advancedSuccess0.06test_routers.py
test_05_router_basicSuccess0.04test_routers.py
test_04_restart_network_wo_cleanupSuccess5.57test_routers.py
test_03_restart_network_cleanupSuccess55.54test_routers.py
test_02_router_internal_advSuccess1.26test_routers.py
test_01_router_internal_basicSuccess0.67test_routers.py
test_router_dns_guestipquerySuccess73.88test_router_dns.py
test_router_dns_externalipquerySuccess0.08test_router_dns.py
test_router_dhcphostsSuccess279.49test_router_dhcphosts.py
test_router_dhcp_optsSuccess21.90test_router_dhcphosts.py
test_01_updatevolumedetailSuccess0.12test_resource_detail.py
test_01_reset_vm_on_rebootSuccess130.99test_reset_vm_on_reboot.py
test_createRegionSuccess0.04test_regions.py
test_create_pvlan_networkSuccess5.22test_pvlan.py
test_dedicatePublicIpRangeSuccess0.47test_public_ip_range.py
test_03_vpc_privategw_restart_vpc_cleanupSuccess530.89test_privategw_acl.py
test_02_vpc_privategw_static_routesSuccess466.67test_privategw_acl.py
test_01_vpc_privategw_aclSuccess127.50test_privategw_acl.py
test_01_primary_storage_nfsSuccess35.89test_primary_storage.py
test_createPortablePublicIPRangeSuccess15.21test_portable_publicip.py
test_createPortablePublicIPAcquireSuccess15.56test_portable_publicip.py
test_isolate_network_password_serverSuccess59.74test_password_server.py
test_UpdateStorageOverProvisioningFactorSuccess0.13test_over_provisioning.py
test_oobm_zchange_passwordSuccess30.80test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownershipSuccess16.37test_outofbandmanagement.py
test_oobm_issue_power_statusSuccess10.28test_outofbandmanagement.py
test_oobm_issue_power_softSuccess10.35test_outofbandmanagement.py
test_oobm_issue_power_resetSuccess15.38test_outofbandmanagement.py
test_oobm_issue_power_onSuccess15.37test_outofbandmanagement.py
test_oobm_issue_power_offSuccess15.36test_outofbandmanagement.py
test_oobm_issue_power_cycleSuccess10.35test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzonesSuccess87.78test_outofbandmanagement.py
test_oobm_enable_feature_validSuccess5.18test_outofbandmanagement.py
test_oobm_enable_feature_invalidSuccess0.11test_outofbandmanagement.py
test_oobm_disable_feature_validSuccess5.19test_outofbandmanagement.py
test_oobm_disable_feature_invalidSuccess0.11test_outofbandmanagement.py
test_oobm_configure_invalid_driverSuccess0.09test_outofbandmanagement.py
test_oobm_configure_default_driverSuccess0.09test_outofbandmanagement.py
test_oobm_background_powerstate_syncSuccess18.67test_outofbandmanagement.py
test_extendPhysicalNetworkVlanSuccess15.35test_non_contigiousvlan.py
test_01_nicSuccess389.18test_nic.py
test_releaseIPSuccess207.91test_network.py
test_reboot_routerSuccess414.15test_network.py
test_public_ip_user_accountSuccess10.29test_network.py
test_public_ip_admin_accountSuccess40.32test_network.py
test_network_rules_acquired_public_ip_3_Load_Balancer_RuleSuccess67.05test_network.py
test_network_rules_acquired_public_ip_2_nat_ruleSuccess61.90test_network.py
test_network_rules_acquired_public_ip_1_static_nat_ruleSuccess121.64test_network.py
test_delete_accountSuccess368.37test_network.py
test_02_port_fwd_on_non_src_natSuccess55.74test_network.py
test_01_port_fwd_on_src_natSuccess111.97test_network.py
test_nic_secondaryip_add_removeSuccess227.76test_multipleips_per_nic.py
test_list_zones_metricsSuccess0.26test_metrics_api.py
test_list_volumes_metricsSuccess5.47test_metrics_api.py
test_list_vms_metricsSuccess257.21test_metrics_api.py
test_list_pstorage_metricsSuccess0.35test_metrics_api.py
test_list_infrastructure_metricsSuccess0.43test_metrics_api.py
test_list_hosts_metricsSuccess0.41test_metrics_api.py
test_list_clusters_metricsSuccess0.36test_metrics_api.py
login_test_saml_userSuccess19.32test_login.py
test_assign_and_removal_lbSuccess134.53test_loadbalance.py
test_02_create_lb_rule_non_natSuccess187.79test_loadbalance.py
test_01_create_lb_rule_src_natSuccess208.22test_loadbalance.py
test_03_list_snapshotsSuccess0.08test_list_ids_parameter.py
test_02_list_templatesSuccess0.04test_list_ids_parameter.py
test_01_list_volumesSuccess0.03test_list_ids_parameter.py
test_07_list_default_isoSuccess0.07test_iso.py
test_05_iso_permissionsSuccess0.07test_iso.py
test_04_extract_IsoSuccess5.17test_iso.py
test_03_delete_isoSuccess95.15test_iso.py
test_02_edit_isoSuccess0.09test_iso.py
test_01_create_isoSuccess21.02test_iso.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfacesSuccess344.20test_internal_lb.py
test_03_vpc_internallb_haproxy_stats_on_all_interfacesSuccess183.06test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80Success648.05test_internal_lb.py
test_dedicateGuestVlanRangeSuccess10.29test_guest_vlan_range.py
test_UpdateConfigParamWithScopeSuccess0.14test_global_settings.py
test_rolepermission_lifecycle_updateSuccess6.23test_dynamicroles.py
test_rolepermission_lifecycle_listSuccess6.19test_dynamicroles.py
test_rolepermission_lifecycle_deleteSuccess5.92test_dynamicroles.py
test_rolepermission_lifecycle_createSuccess5.90test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updatesSuccess6.04test_dynamicroles.py
test_role_lifecycle_update_role_inuseSuccess5.92test_dynamicroles.py
test_role_lifecycle_updateSuccess11.00test_dynamicroles.py
test_role_lifecycle_listSuccess5.92test_dynamicroles.py
test_role_lifecycle_deleteSuccess11.00test_dynamicroles.py
test_role_lifecycle_createSuccess5.91test_dynamicroles.py
test_role_inuse_deletionSuccess5.87test_dynamicroles.py
test_role_account_acls_multiple_mgmt_serversSuccess8.23test_dynamicroles.py
test_role_account_aclsSuccess8.64test_dynamicroles.py
test_default_role_deletionSuccess6.08test_dynamicroles.py
test_04_create_fat_type_disk_offeringSuccess0.08test_disk_offerings.py
test_03_delete_disk_offeringSuccess0.05test_disk_offerings.py
test_02_edit_disk_offeringSuccess0.05test_disk_offerings.py
test_02_create_sparse_type_disk_offeringSuccess0.07test_disk_offerings.py
test_01_create_disk_offeringSuccess0.11test_disk_offerings.py
test_deployvm_userdispersingSuccess20.63test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userconcentratedSuccess20.61test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_firstfitSuccess116.35test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userdata_postSuccess45.59test_deploy_vm_with_userdata.py
test_deployvm_userdataSuccess226.83test_deploy_vm_with_userdata.py
test_02_deploy_vm_root_resizeSuccess5.97test_deploy_vm_root_resize.py
test_01_deploy_vm_root_resizeSuccess6.04test_deploy_vm_root_resize.py
test_00_deploy_vm_root_resizeSuccess252.80test_deploy_vm_root_resize.py
test_deploy_vm_from_isoSuccess202.70test_deploy_vm_iso.py
test_DeployVmAntiAffinityGroupSuccess106.34test_affinity_groups.py
test_03_delete_vm_snapshotsSkipped0.00test_vm_snapshots.py
test_02_revert_vm_snapshotsSkipped0.00test_vm_snapshots.py
test_01_create_vm_snapshotsSkipped0.00test_vm_snapshots.py
test_06_copy_templateSkipped0.00test_templates.py
test_static_role_account_aclsSkipped0.03test_staticroles.py
test_01_scale_vmSkipped0.00test_scale_vm.py
test_01_primary_storage_iscsiSkipped0.04test_primary_storage.py
test_06_copy_isoSkipped0.00test_iso.py
test_deploy_vgpu_enabled_vmSkipped0.01test_deploy_vgpu_enabled_vm.py

@yadvr

Copy link
Copy Markdown
Member

Regression tests have no new error (except known intermittent failures)
@Slair1@swill@kiwiflyer any comment, can this break if we fwd-merge on 4.10+? Has anyone tested this, advise on merging this?

@yadvr

Copy link
Copy Markdown
Member

I'm not in position to decide merging this one, needs an additional review from one of the VPN gurus @swill@JayapalUradi and others

@yadvr

yadvr commented Aug 2, 2017

Copy link
Copy Markdown
Member

Ping, any discussions/reviews?

@Slair1

Copy link
Copy Markdown
ContributorAuthor

It's the same code/logic used on line 458, so should be safe

@yadvr

yadvr commented Aug 4, 2017

Copy link
Copy Markdown
Member

LGTM, merging based on your feedback @Slair1 and my assessment of the code, and test results.

@yadvr
yadvr merged commit a577813 into apache:4.9Aug 4, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@Slair1@swill@asfbot@kiwiflyer@cloudmonger@yadvr@blueorangutan