You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by jayapalu <gi...@git.apache.org> on 2017/01/17 09:57:56 UTC

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

GitHub user jayapalu opened a pull request:

    https://github.com/apache/cloudstack/pull/1908

    CLOUDSTACK-9317: Fixed disable static nat on leaving ips on interface

    FIxed issue in disabling multiple static  nat simultaneously.
    
    This patch has taken changes from the PR 1450 and added the missing parts
    https://github.com/apache/cloudstack/pull/1450

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Accelerite/cloudstack staticnat

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1908.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1908
    
----
commit 7e9c436c904dd7e21844aa34177854eda42a82ee
Author: Jayapal <ja...@accelerite.com>
Date:   2017-01-17T09:50:16Z

    CLOUDSTACK-9317: Fixed disable static nat on leaving ips on interface

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r106855504
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---
    @@ -1764,9 +1765,12 @@ protected ExecutionResult cleanupNetworkElementCommand(final IpAssocCommand cmd)
                     }
                     nicNum = broadcastUriAllocatedToVM.get(ip.getBroadcastUri());
     
    -                if (numOfIps == 1 && !ip.isAdd()) {
    -                    vifHotUnPlug(conn, routerName, ip.getVifMacAddress());
    -                    networkUsage(routerIp, "deleteVif", "eth" + nicNum);
    +                if (lastIp != null && lastIp.equalsIgnoreCase("true") && !ip.isAdd()) {
    --- End diff --
    
    `StringUtils.equalsIgnoreCase` can check both null and the value.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110082657
  
    --- Diff: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java ---
    @@ -625,15 +627,20 @@ protected ExecutionResult cleanupNetworkElementCommand(final IpAssocCommand cmd)
     
                     // there is only one ip in this public vlan and removing it, so
                     // remove the nic
    -                if (ipsCount == 1 && !ip.isAdd()) {
    -                    removeVif = true;
    +                if (lastIp != null && lastIp.equalsIgnoreCase("true") && !ip.isAdd()) {
    --- End diff --
    
    In CitrixresourceBase StringUtils is used from the  com.cloud.utils.StringUtils. So using  StringUtils from java.lang will be ambiguous.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110112007
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -848,13 +849,37 @@ public int compare(final PublicIpAddress o1, final PublicIpAddress o2) {
                     associatedWithNetworkId = ipAddrList.get(0).getNetworkId();
                 }
     
    +            // for network if the ips does not have any rules, then only last ip
    +            List<IPAddressVO> userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null);
    +
    +            int ipsWithrules = 0;
    +            int ipsStaticNat = 0;
    +            for (IPAddressVO ip : userIps) {
    +                if ( _rulesDao.countRulesByIpIdAndState(ip.getId(), FirewallRule.State.Active) > 0 ) {
    +                    ipsWithrules++;
    +                }
    +
    +                // check onetoonenat and also check if the ip "add":false. If there are 2 PF remove 1 static nat add
    +                if (ip.isOneToOneNat() && ip.getRuleState() == null) {
    +                    ipsStaticNat++;
    +                }
    +            }
    +
                 final IpAssocCommand cmd = new IpAssocCommand(ipsToSend);
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, _routerControlHelper.getRouterIpInNetwork(associatedWithNetworkId, router.getId()));
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
                 final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
                 cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString());
     
    +            // if there 1 static nat then it will be checked for remove at the resource
    +            if (ipsWithrules == 0 && ipsStaticNat == 0 ) {
    --- End diff --
    
    If we check the ipsStaticNat=1 then we will miss the case of disabling static nat on  network with 1 with static nat.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    @jayapalu can you change the PR base branch to 4.9?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by cloudmonger <gi...@git.apache.org>.
Github user cloudmonger commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    ### ACS CI BVT Run
     **Sumarry:**
     Build Number 3
     Hypervisor xenserver
     NetworkType Advanced
     Passed=623
     Failed=290
     Skipped=58
    
    _Link to logs Folder (search by build_no):_ https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0
    
    
    **Failed tests:**
    * test_dhcp_dns_offload.py
    
     * ContextSuite context=TestDeployVMs>:setup Failed
    
    * test_affinity_groups_projects.py
    
     * test_01_deploy_vm_anti_affinity_group Failed
    
     * test_02_deploy_vm_anti_affinity_group_fail_on_not_enough_hosts Failed
    
     * test_01_list_aff_grps_for_vm Failed
    
     * test_02_list_multiple_aff_grps_for_vm Failed
    
     * test_01_update_aff_grp_by_ids Failed
    
    * test_ps_domain_limits.py
    
     * test_04_create_template_snapshot Failed
    
    * test_ss_domain_limits.py
    
     * test_04_create_template_delete_account Failed
    
     * test_04_create_template_delete_account Failing since 2 runs
    
     * test_01_multiple_domains_secondary_storage_limits Failed
    
     * test_01_multiple_domains_secondary_storage_limits Failing since 2 runs
    
     * test_02_multiple_domains_secondary_storage_counts Failed
    
    * test_deploy_vm_userdata_multi_nic.py
    
     * test_deployvm_multinic Failed
    
    * test_vpn_service.py
    
     * test_01_VPN_service Failed
    
    * test_organization_states.py
    
     * ContextSuite context=TestOrganizationStates>:setup Failed
    
    * test_escalations_snapshots.py
    
     * ContextSuite context=TestSnapshots>:setup Failed
    
    * test_dynamic_compute_offering.py
    
     * test_max_account_memory_scale_VM_1_ADMIN_ACCOUNT Failed
    
     * test_max_account_memory_scale_VM_2_USER_ACCOUNT Failed
    
     * test_deploy_VM_with_affinity_group_1_ADMIN_ACCOUNT Failed
    
     * test_deploy_VM_with_affinity_group_2_USER_ACCOUNT Failed
    
     * ContextSuite context=TestDynamicServiceOffering>:setup Failed
    
     * test_change_so_running_vm_dynamic_to_dynamic_1_ADMIN_ACCOUNT Failed
    
     * test_change_so_running_vm_dynamic_to_dynamic_2_USER_ACCOUNT Failed
    
     * test_change_so_running_vm_dynamic_to_static_1_ADMIN_ACCOUNT Failed
    
     * test_change_so_running_vm_dynamic_to_static_2_USER_ACCOUNT Failed
    
     * test_change_so_running_vm_static_to_dynamic_1_ADMIN_ACCOUNT Failed
    
     * test_change_so_running_vm_static_to_dynamic_2_USER_ACCOUNT Failed
    
     * test_change_so_running_vm_static_to_static_1_ADMIN_ACCOUNT Failed
    
     * test_change_so_running_vm_static_to_static_2_USER_ACCOUNT Failed
    
     * test_change_so_stopped_vm_dynamic_to_dynamic_1_ADMIN_ACCOUNT Failed
    
     * test_change_so_stopped_vm_dynamic_to_dynamic_2_USER_ACCOUNT Failed
    
     * test_change_so_stopped_vm_dynamic_to_static_1_ADMIN_ACCOUNT Failed
    
     * test_change_so_stopped_vm_dynamic_to_static_2_USER_ACCOUNT Failed
    
     * test_change_so_stopped_vm_static_to_dynamic_1_ADMIN_ACCOUNT Failed
    
     * test_change_so_stopped_vm_static_to_dynamic_2_USER_ACCOUNT Failed
    
     * test_change_so_stopped_vm_static_to_static_1_ADMIN_ACCOUNT Failed
    
    * test_ps_resource_limits_volume.py
    
     * test_attach_volume_exceeding_primary_limits Failed
    
    * test_vpc.py
    
     * test_07_restart_network_vm_running Failed
    
     * test_08_delete_vpc Failed
    
     * test_11_deploy_vm_wo_network_netdomain Failed
    
     * test_13_deploy_vm_with_vpc_netdomain Failed
    
     * test_14_deploy_vm_1 Failed
    
     * test_15_deploy_vm_2 Failed
    
     * test_16_deploy_vm_for_user_by_admin Failed
    
     * test_21_deploy_vm_with_gateway_ip Failed
    
     * test_22_vpn_customer_gw_with_hostname Failed
    
    * test_non_contiguous_vlan.py
    
     * test_01_add_non_contiguous_ranges Failed
    
    * test_project_usage.py
    
     * ContextSuite context=TestLBRuleUsage>:setup Failed
    
     * ContextSuite context=TestNatRuleUsage>:setup Failed
    
     * ContextSuite context=TestPublicIPUsage>:setup Failed
    
     * ContextSuite context=TestSnapshotUsage>:setup Failed
    
     * ContextSuite context=TestVmUsage>:setup Failed
    
     * ContextSuite context=TestVolumeUsage>:setup Failed
    
     * ContextSuite context=TestVpnUsage>:setup Failed
    
    * test_ps_max_limits.py
    
     * test_01_deploy_vm_domain_limit_reached Failed
    
     * test_02_deploy_vm_account_limit_reached Failed
    
     * test_03_deploy_vm_project_limit_reached Failed
    
    * test_project_resources.py
    
     * test_07_associate_public_ip Failed
    
    * test_vpc_network_staticnatrule.py
    
     * test_01_VPC_StaticNatRuleCreateStoppedState Failed
    
     * test_03_VPC_StopCreateMultipleStaticNatRuleStopppedState Failed
    
     * test_04_VPC_CreateMultipleStaticNatRule Failed
    
     * test_05_network_services_VPC_DeleteAllPF Failed
    
     * test_06_network_services_VPC_DeleteAllMultiplePF Failed
    
    * test_redundant_router_services.py
    
     * test_enableVPNOverRvR Failed
    
    * test_resource_limits.py
    
     * test_01_vm_per_account Failed
    
     * test_02_publicip_per_account Failed
    
     * test_03_snapshots_per_account Failed
    
     * test_04_volumes_per_account Failed
    
     * test_05_templates_per_account Failed
    
    * test_escalations_vpncustomergateways.py
    
     * test_01_list_vpncustomergateways_pagination Failed
    
     * test_02_update_vpncustomergateways Failed
    
    * test_multiple_public_interfaces.py
    
     * test_iptable_rules Failed
    
     * ContextSuite context=TestPortForwarding>:setup Failing since 8 runs
    
     * ContextSuite context=TestRouting>:setup Failed
    
     * ContextSuite context=TestStaticNat>:setup Failed
    
     * test_network_services_VPC_CreatePF Failed
    
     * test_network_services_VPC_CreatePF Failing since 2 runs
    
    * test_cpu_project_limits.py
    
     * test_01_project_counts_start_stop_instance Failed
    
     * test_02_project_counts_migrate_instance Failed
    
     * test_03_project_counts_delete_instance Failed
    
    * test_routers.py
    
     * test_01_RouterStopCreateFW Failed
    
    * test_overcommit.py
    
     * test_01_cluster_settings Failed
    
     * test_02_Overcommit_factor Failed
    
     * test_03_cluste_capacity_check Failed
    
     * test_04_zone_capacity_check Failed
    
    * test_custom_hostname.py
    
     * test_01_custom_hostname_instancename_false Failed
    
    * test_snapshots.py
    
     * test_01_createVM_snapshotTemplate Failed
    
     * ContextSuite context=TestSnapshotEvents>:setup Failed
    
     * test_01_volume_from_snapshot Failed
    
     * test_02_snapshot_data_disk Failed
    
     * test_03_snapshot_detachedDisk Failed
    
     * test_04_delete_snapshot Failed
    
     * test_07_template_from_snapshot Failed
    
    * test_egress_fw_rules.py
    
     * test_01_1_egress_fr1 Failed
    
     * test_01_2_egress_fr1 Failed
    
     * test_01_egress_fr1 Failed
    
     * test_02_1_egress_fr2 Failed
    
     * test_02_2_egress_fr2 Failed
    
     * test_02_egress_fr2 Failed
    
     * test_03_1_egress_fr3 Failed
    
     * test_03_egress_fr3 Failed
    
     * test_04_1_egress_fr4 Failed
    
     * test_04_egress_fr4 Failed
    
     * test_06_1_egress_fr6 Failed
    
     * test_06_egress_fr6 Failed
    
     * test_07_1_egress_fr7 Failed
    
     * test_07_egress_fr7 Failed
    
     * test_09_1_egress_fr9 Failed
    
    * test_redundant_router_cleanups.py
    
     * test_restart_network_with_destroyed_masterVR Failed
    
    * test_ss_max_limits.py
    
     * test_01_deploy_vm_domain_limit_reached Failing since 2 runs
    
     * test_02_deploy_vm_account_limit_reached Failing since 2 runs
    
     * test_03_deploy_vm_project_limit_reached Failing since 2 runs
    
    * test_ss_project_limits.py
    
     * test_01_register_template_with_project Failed
    
    * test_memory_limits.py
    
     * test_01_stop_start_instance Failed
    
     * test_02_migrate_instance Failed
    
     * test_03_delete_instance Failed
    
     * test_01_stop_start_instance Failing since 2 runs
    
     * test_02_migrate_instance Failing since 2 runs
    
    * test_vpc_network_pfrules.py
    
     * test_01_network_services_VPC_StopCreatePF Failed
    
     * test_02_network_services_VPC_CreatePF Failed
    
     * test_03_network_services_VPC_StopCreateMultiplePF Failed
    
     * test_04_network_services_VPC_CreateMultiplePF Failed
    
     * test_05_network_services_VPC_StopDeletePF Failed
    
     * test_06_network_services_VPC_DeletePF Failed
    
     * test_07_network_services_VPC_StopDeleteAllPF Failed
    
     * test_08_network_services_VPC_DeleteAllPF Failed
    
     * test_09_network_services_VPC_StopDeleteAllMultiplePF Failed
    
     * test_10_network_services_VPC_DeleteAllMultiplePF Failed
    
    * test_ip_reservation.py
    
     * test_reservation_after_router_restart Failed
    
     * test_vm_create_after_reservation Failed
    
     * test_vm_create_outside_cidr_after_reservation Failed
    
     * test_ip_reservation_in_multiple_networks_same_account Failed
    
     * test_nat_rules_1_nat_rule Failed
    
     * test_nat_rules_2_static_nat_rule Failed
    
     * test_update_cidr_multiple_vms_not_all_inclusive Failed
    
     * test_update_cidr_single_vm_not_inclusive Failed
    
     * test_vm_create_after_reservation Failing since 2 runs
    
     * test_vm_create_outside_cidr_after_reservation Failing since 2 runs
    
     * test_restart_network_with_cleanup_1_True Failed
    
    * test_vpc_vms_deployment.py
    
     * test_01_deploy_vms_in_network Failed
    
     * test_02_deploy_vms_delete_network Failed
    
     * test_03_deploy_vms_delete_add_network Failed
    
     * test_04_deploy_vms_delete_add_network_noLb Failed
    
     * test_05_create_network_max_limit Failed
    
     * test_06_delete_network_vm_running Failed
    
     * test_07_delete_network_with_rules Failed
    
    * test_vpc_network.py
    
     * ContextSuite context=TestVPCNetworkGc>:setup Failed
    
    * test_mm_project_limits.py
    
     * test_01_project_vmlifecycle_start_stop_instance Failed
    
     * test_02_project_vmlifecycle_migrate_instance Failed
    
     * test_03_project_vmlifecycle_delete_instance Failed
    
    * test_escalations_instances.py
    
     * test_13_attach_detach_iso Failed
    
     * test_14_vm_snapshot_pagination Failed
    
     * test_15_revert_vm_to_snapshot Failed
    
     * test_16_list_vm_volumes_pagination Failed
    
     * test_18_stopped_vm_change_service Failed
    
     * test_19_create_reset_vm_sshkey Failed
    
     * test_20_update_vm_displayname_group Failed
    
     * test_21_restore_vm Failed
    
     * test_22_deploy_vm_multiple_networks Failed
    
     * test_24_deploy_vm_with_static_ip_ES1662 Failed
    
     * test_25_ip_reallocation_ES1377 Failed
    
     * test_27_VM_restore_ES3467 Failed
    
     * test_28_VM_restore_ES3467 Failed
    
     * test_01_list_instances_pagination Failed
    
     * test_02_list_Running_vm Failed
    
     * test_03_list_Stopped_vm Failed
    
     * test_04_list_Destroyed_vm Failed
    
     * test_05_list_vm_by_id Failed
    
     * test_06_list_vm_by_name Failed
    
     * test_07_list_vm_by_name_state Failed
    
     * test_10_list_vm_by_zone_name_state Failed
    
     * test_11_register_reset_vm_sshkey Failed
    
     * test_12_running_vm_change_service Failed
    
     * test_13_vm_nics Failed
    
    * test_acl_isolatednetwork.py
    
     * ContextSuite context=TestIsolatedNetwork>:setup Failed
    
    * test_cpu_domain_limits.py
    
     * test_01_multiple_core_vm_start_stop_instance Failed
    
     * test_02_multiple_core_vm_migrate_instance Failed
    
     * test_03_multiple_core_vm_delete_instance Failed
    
     * test_04_deploy_multiple_vm_with_multiple_core Failed
    
     * test_01_multiple_child_domains Failed
    
    * test_escalations_networks.py
    
     * test_03_list_vpc_pagination Failed
    
     * test_04_create_vpc_with_networkdomain Failed
    
     * test_06_create_network_in_vpc Failed
    
     * test_10_list_networks_in_vpc Failed
    
     * test_11_update_vpc Failed
    
     * test_12_list_create_delete_networkACL Failed
    
     * test_19_create_list_reset_delete_vpnconnections Failed
    
    * test_accounts.py
    
     * ContextSuite context=TestAddVmToSubDomain>:setup Failed
    
     * test_DeleteDomain Failed
    
     * test_forceDeleteDomain Failed
    
     * test_01_user_remove_VM_running Failed
    
     * ContextSuite context=TestTemplateHierarchy>:setup Failed
    
     * test_LoginApiDomain Failed
    
     * test_LoginApiUuidResponse Failed
    
    * test_ps_limits.py
    
     * test_create_template_snapshot_1_root_domain_admin Failed
    
     * test_create_template_snapshot_2_child_domain_admin Failed
    
    * test_mm_max_limits.py
    
     * test_02_deploy_vm_account_limit_reached Failing since 3 runs
    
     * test_04_deployVm__account_limit_reached Failed
    
    * test_cpu_max_limits.py
    
     * test_02_deploy_vm_account_limit_reached Failing since 4 runs
    
     * test_04_deployVm__account_limit_reached Failing since 2 runs
    
    * test_escalation_listTemplateDomainAdmin.py
    
     * test_listtemplate Failed
    
    * test_portable_ip.py
    
     * test_associate_ip_address_services_enable_disable Failed
    
     * test_list_portable_ip_range_non_root_admin Failed
    
    * test_affinity_groups.py
    
     * test_03_delete_aff_grp_with_vms Failed
    
     * test_01_deploy_vm_without_aff_grp Failed
    
     * test_02_deploy_vm_by_aff_grp_name Failed
    
     * test_03_deploy_vm_by_aff_grp_id Failed
    
     * test_04_deploy_vm_anti_affinity_group Failed
    
     * test_05_deploy_vm_by_id Failed
    
     * test_08_deploy_vm_multiple_aff_grps Failed
    
     * test_09_deploy_vm_multiple_aff_grps Failed
    
     * test_01_list_aff_grps_for_vm Failing since 2 runs
    
     * test_02_list_multiple_aff_grps_for_vm Failing since 2 runs
    
     * test_07_list_all_vms_in_aff_grp Failed
    
     * test_02_update_aff_grp_by_names Failed
    
     * test_03_update_aff_grp_for_vm_with_no_aff_grp Failed
    
     * test_05_update_aff_grp_on_running_vm Failed
    
    * test_acl_listvolume.py
    
     * ContextSuite context=TestVolumeList>:setup Failed
    
    * test_mm_domain_limits.py
    
     * test_01_change_service_offering Failed
    
     * test_02_migrate_vm Failed
    
     * test_03_delete_vm Failed
    
     * test_04_deploy_multiple_vm Failed
    
     * test_01_multiple_child_domains Failing since 2 runs
    
    * test_blocker_bugs.py
    
     * ContextSuite context=TestDataPersistency>:setup Failed
    
     * ContextSuite context=TestNATRules>:setup Failed
    
     * ContextSuite context=TestRouterRestart>:setup Failed
    
     * test_01_list_routers_admin Failed
    
     * test_01_create_template Failed
    
    * test_vpc_network_internal_lbrules.py
    
     * test_02_internallb_rules_traffic Failed
    
     * test_03_internallb_rules_vpc_network_restarts_traffic Failed
    
     * test_04_internallb_appliance_operations_traffic Failed
    
    * test_add_remove_network.py
    
     * ContextSuite context=TestAddNetworkToVirtualMachine>:setup Failed
    
     * ContextSuite context=TestFailureScenariosAddNetworkToVM>:setup Failed
    
     * ContextSuite context=TestFailureScenariosRemoveNicFromVM>:setup Failed
    
     * ContextSuite context=TestFailureScenariosUpdateVirtualMachineNIC>:setup Failed
    
     * ContextSuite context=TestRemoveNetworkFromVirtualMachine>:setup Failed
    
     * ContextSuite context=TestUpdateVirtualMachineNIC>:setup Failed
    
    * test_escalations_ipaddresses.py
    
     * test_11_create_delete_firewallrule Failed
    
    * test_lb_secondary_ip.py
    
     * test_01_lb_rule_for_primary_ip Failed
    
     * test_02_lb_rule_for_primary_ip Failed
    
     * test_03_lb_rule_for_primary_and_secondary_ip Failed
    
     * test_04_lb_rule_primary_secondary_multiple_vms Failed
    
     * test_05_lb_rule_wrong_vm_id Failed
    
     * test_06_lb_rule_wrong_vm_ip Failed
    
     * test_08_lb_rule_remove_used_ip Failed
    
     * test_11_ssh_to_secondary_ip Failed
    
     * test_13_delete_lb_rule Failed
    
     * test_14_remove_lb_rule_secondary_ip Failed
    
     * test_15_remove_lb_rule_primary_ip Failed
    
     * test_16_delete_vm_from_lb_rule Failed
    
     * test_20_destroy_recover_vm Failed
    
     * test_21_modify_lb_rule_algorithm Failed
    
     * test_09_lbvmips_true Failed
    
     * test_10_lbvmips_false Failed
    
     * test_17_restart_router Failed
    
     * test_18_restart_network_cleanup_true Failed
    
     * test_19_restart_network_cleanup_false Failed
    
     * test_22_network_gc Failed
    
    * test_volumes.py
    
     * test_01_volume_attach_detach Failed
    
     * test_01_volume_attach_detach Failing since 2 runs
    
     * test_02_root_volume_attach_detach Failed
    
     * ContextSuite context=TestAttachVolume>:setup Failed
    
     * ContextSuite context=TestAttachVolumeISO>:setup Failed
    
     * ContextSuite context=TestMigrateVolume>:setup Failed
    
     * ContextSuite context=TestVolumes>:setup Failing since 12 runs
    
    * test_acl_listsnapshot.py
    
     * ContextSuite context=TestSnapshotList>:setup Failed
    
    * test_stopped_vm.py
    
     * test_deploy_vm_password_enabled Failed
    
    * test_snapshot_limits.py
    
     * ContextSuite context=TestSnapshotLimit>:setup Failed
    
    * test_escalations_templates.py
    
     * test_01_list_templates_pagination Failed
    
     * test_02_download_template Failed
    
     * test_03_edit_template_details Failed
    
    * test_ss_limits.py
    
     * test_01_register_template_1_root_domain_admin Failed
    
     * test_01_register_template_2_child_domain_admin Failed
    
    * test_ps_resize_volume.py
    
     * test_02_increase_volume_size_above_account_limit Failed
    
     * test_03_increase_volume_size_above_domain_limit Failed
    
    * test_usage.py
    
     * ContextSuite context=TestLBRuleUsage>:setup Failing since 2 runs
    
     * ContextSuite context=TestNatRuleUsage>:setup Failing since 2 runs
    
     * ContextSuite context=TestPublicIPUsage>:setup Failing since 2 runs
    
     * ContextSuite context=TestSnapshotUsage>:setup Failing since 2 runs
    
     * ContextSuite context=TestVmUsage>:setup Failing since 2 runs
    
     * ContextSuite context=TestVolumeUsage>:setup Failing since 2 runs
    
     * ContextSuite context=TestVpnUsage>:setup Failing since 2 runs
    
    * test_vpc_vm_life_cycle.py
    
     * test_06_migrate_instance_in_network Failed
    
     * test_07_migrate_instance_in_network Failed
    
    * test_project_limits.py
    
     * test_06_volumes_per_project Failed
    
     * test_07_templates_per_project Failed
    
    * test_templates.py
    
     * test_01_create_template Failing since 2 runs
    
    * test_assign_vm.py
    
     * test_13_move_across_subdomain_vm_snapshot Failed
    
     * test_15_move_across_subdomain_account_limit Failed
    
     * test_16_move_across_subdomain_volume_and_account_limit Failed
    
    
    **Skipped tests:**
    test_03_copy_template
    ContextSuite context=TestvGPUWindowsVm>:setup
    ContextSuite context=TestTemplateUsage>:setup
    test_02_create_vpc_from_offering_with_regionlevelvpc_service_capability
    test_03_deploy_vms_in_vpc_with_regionlevelvpc
    test_02_cancel_host_maintenace_with_migration_jobs
    ContextSuite context=TestInstanceNameFlagTrue>:setup
    test_04_deploy_multiple_vm_with_multiple_cpus
    test_05_1_egress_fr5
    test_05_egress_fr5
    test_08_1_egress_fr8
    test_08_egress_fr8
    test_04_vpn_tag
    ContextSuite context=TestAffinityRules>:setup
    ContextSuite context=TestAntiAffinityRules>:setup
    test_02_create_vpc_from_offering_with_distributedrouter_service_capability
    test_03_deploy_vms_in_vpc_with_distributedrouter
    test_04_deploy_multiple_vm
    ContextSuite context=TestProjectCreationNegative>:setup
    ContextSuite context=TestProjectInviteRequiredTrue>:setup
    ContextSuite context=TestProjectInviteTimeout>:setup
    test_RVR_network
    test_01_create_network_2_network_offering_vpcns
    test_02_create_network_fail_2_network_offering_vpcns
    test_04_create_multiple_networks_with_lb_1_network_offering
    test_04_create_multiple_networks_with_lb_2_network_offering_vpcns
    test_06_create_network_with_rvr
    test_09_create_network_shared_nwoff_2_network_offering_vpcns
    test_01_create_network_outside_range_2_network_offering_vpcns
    test_03_create_network_inside_range_2_network_offering_vpcns
    test_04_create_network_overlapping_range_2_network_offering_vpcns
    test_05_create_network_diff_account_2_network_offering_vpcns
    test_02_concurrent_snapshot_global_limit
    test_01_migrate_vm_with_volume
    test_02_migrate_volume
    test_02_migrate_vm
    test_03_delete_vm
    test_01_deploy_vm_with_implicit_planner
    test_destroy_recover_vm_1_root_domain_admin
    test_destroy_recover_vm_2_child_domain_admin
    test_04_copy_iso
    test_04_update_aff_grp_remove_all
    test_01_host_ha_with_nfs_storagepool_with_vm
    test_02_host_ha_with_local_storage_and_nfs
    test_03_host_ha_with_only_local_storage
    ContextSuite context=TestTemplates>:setup
    test_07_lb_rule_used_ip
    test_12_ssh_to_primary_secondary_ip
    test_09_stop_vm_migrate_vol
    test_04_copy_template
    test_04_copy_template_1_root_domain_admin
    test_04_copy_template_2_child_domain_admin
    test1_attach_volume_ide
    test2_attach_ISO_in_CentOSVM
    ContextSuite context=TestTemplateUsage>:setup
    test_createSharedNetwork_usedVlan
    test_01_addLdapConfiguration
    ContextSuite context=TestTemplates>:setup
    
    **Passed test suits:**
    None
    test_redundant_router_upgrades.py
    test_VirtualRouter_alerts.py
    test_regions_accounts.py
    test_acl_isolatednetwork_delete.py
    test_invalid_gw_nm.py
    test_haproxy.py
    test_vpc_offerings.py
    test_snapshots_improvement.py
    test_vpn_users.py
    test_vpc_routers.py
    test_acl_listvm.py
    test_simultaneous_volume_attach.py
    test_deploy_vm_userdata_reg.py
    test_escalations_routers.py
    test_vpc_network_lbrules.py
    test_update_vm.py
    test_escalations_volumes.py
    test_regions.py
    test_projects.py
    test_acl_sharednetwork.py
    test_allocation_states.py
    test_snapshot_gc.py
    test_vm_passwdenabled.py
    test_network_offering.py
    None


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110848709
  
    --- Diff: setup/db/db/schema-4920to41000.sql ---
    @@ -230,5 +230,11 @@ JOIN `cloud`.`vm_snapshots` s ON (s.service_offering_id = o.id AND s.vm_id = v.i
     WHERE (o.cpu is null AND o.speed IS NULL AND o.ram_size IS NULL) AND
     (d.name = 'cpuNumber' OR d.name = 'cpuSpeed' OR d.name = 'memory');
     
    +<<<<<<< 1c48deefe9b534198cad19b5528ce0dcfa8d04a5
    --- End diff --
    
    It seems you got a conflict stuck in the file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110113725
  
    --- Diff: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java ---
    @@ -625,15 +627,20 @@ protected ExecutionResult cleanupNetworkElementCommand(final IpAssocCommand cmd)
     
                     // there is only one ip in this public vlan and removing it, so
                     // remove the nic
    -                if (ipsCount == 1 && !ip.isAdd()) {
    -                    removeVif = true;
    +                if (lastIp != null && lastIp.equalsIgnoreCase("true") && !ip.isAdd()) {
    --- End diff --
    
    True, but a lot of the other code is already using StringUtils or is moving to it. Reviewers in other PRs tend to recommend it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    I'm looking at the `DataBag` code, and it seems that it loads information from the data located at `/etc/cloudstack/` and therefore 1907 should work fine with this, ASSUMING that is smart enough to recognize that the IP should no longer be there.
    
    I think this is a scenario that should definitely be tested as it has the potential to break the whole PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110818988
  
    --- Diff: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java ---
    @@ -625,15 +627,20 @@ protected ExecutionResult cleanupNetworkElementCommand(final IpAssocCommand cmd)
     
                     // there is only one ip in this public vlan and removing it, so
                     // remove the nic
    -                if (ipsCount == 1 && !ip.isAdd()) {
    -                    removeVif = true;
    +                if (lastIp != null && lastIp.equalsIgnoreCase("true") && !ip.isAdd()) {
    --- End diff --
    
    @ProjectMoon  
    Updated to use org.apache.commons.lang.StringUtils
    Can you please review it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110854097
  
    --- Diff: setup/db/db/schema-4920to41000.sql ---
    @@ -230,5 +230,11 @@ JOIN `cloud`.`vm_snapshots` s ON (s.service_offering_id = o.id AND s.vm_id = v.i
     WHERE (o.cpu is null AND o.speed IS NULL AND o.ram_size IS NULL) AND
     (d.name = 'cpuNumber' OR d.name = 'cpuSpeed' OR d.name = 'memory');
     
    +<<<<<<< 1c48deefe9b534198cad19b5528ce0dcfa8d04a5
     -- CLOUDSTACK-9827: Storage tags stored in multiple places
     DROP VIEW IF EXISTS `cloud`.`storage_tag_view`;
    +
    +ALTER TABLE `user_ip_address` ADD COLUMN `rule_state` VARCHAR(32) COMMENT 'static  rule state while removing';
    +=======
    --- End diff --
    
    Corrected


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    Hi, that's great news.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110849362
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -848,13 +849,38 @@ public int compare(final PublicIpAddress o1, final PublicIpAddress o2) {
                     associatedWithNetworkId = ipAddrList.get(0).getNetworkId();
                 }
     
    +            // for network if the ips does not have any rules, then only last ip
    +            List<IPAddressVO> userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null);
    +
    +            int ipsWithrules = 0;
    +            int ipsStaticNat = 0;
    +            for (IPAddressVO ip : userIps) {
    +                if ( _rulesDao.countRulesByIpIdAndState(ip.getId(), FirewallRule.State.Active) > 0 ) {
    --- End diff --
    
    Inconsistent formatting of the parentheses in the `if`. A bit nitpicky, but the code has to adhere to format.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    Thanks for adding the missing parts. Here is the PR that was open against 4.8 for this, which I guess can be closed now: https://github.com/apache/cloudstack/pull/1623
    
    I guess the comment from @jburwell still applies to this.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r99469241
  
    --- Diff: core/src/com/cloud/agent/api/routing/NetworkElementCommand.java ---
    @@ -38,6 +38,7 @@
         public static final String VPC_PRIVATE_GATEWAY = "vpc.gateway.private";
         public static final String FIREWALL_EGRESS_DEFAULT = "firewall.egress.default";
         public static final String ROUTER_MONITORING_ENABLE = "router.monitor.enable";
    +    public static final String NETWORK_PUB_LAST_IP = "newtork.public.last.ip";
    --- End diff --
    
    typo?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r105130816
  
    --- Diff: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java ---
    @@ -625,15 +627,20 @@ protected ExecutionResult cleanupNetworkElementCommand(final IpAssocCommand cmd)
     
                     // there is only one ip in this public vlan and removing it, so
                     // remove the nic
    -                if (ipsCount == 1 && !ip.isAdd()) {
    -                    removeVif = true;
    +                if (lastIp != null && !ip.isAdd()) {
    --- End diff --
    
    Maybe it would make sense to check the value of `lastIp` being something instead of just checking if it's not null? It works the way it is, but perhaps checking specifically for a value like `"true"` would make sense. Would prevent someone from updating code later to send `"false"` for whatever reason and then causing something unexpected. Relying on not null as a truth value is a bit obtuse in my opinion.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r106857110
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -848,13 +849,37 @@ public int compare(final PublicIpAddress o1, final PublicIpAddress o2) {
                     associatedWithNetworkId = ipAddrList.get(0).getNetworkId();
                 }
     
    +            // for network if the ips does not have any rules, then only last ip
    +            List<IPAddressVO> userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null);
    +
    +            int ipsWithrules = 0;
    +            int ipsStaticNat = 0;
    +            for (IPAddressVO ip : userIps) {
    +                if ( _rulesDao.countRulesByIpIdAndState(ip.getId(), FirewallRule.State.Active) > 0 ) {
    +                    ipsWithrules++;
    +                }
    +
    +                // check onetoonenat and also check if the ip "add":false. If there are 2 PF remove 1 static nat add
    +                if (ip.isOneToOneNat() && ip.getRuleState() == null) {
    --- End diff --
    
    Similar to the comments about checking if `lastIp` isn't null, I find that checking rule state to be null is a bit ... obscure. What is null supposed to mean in this context? It seems the `rule_state` column is only changed to `Releasing` when releasing an IP and nothing else. I guess that's intentional?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    @ProjectMoon 
    I have today this PR after rebasing latest master. I did not observe the add:true for the removed ip.
    Here is output from the ips.json and ip addr show output.
    
    Here is the output:
    
    4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 06:f6:cc:00:00:0e brd ff:ff:ff:ff:ff:ff
        inet 10.147.46.102/24 brd 10.147.46.255 scope global eth2
        inet 10.147.46.112/24 brd 10.147.46.255 scope global secondary eth2
    
        "eth2": [
            {
                "add": true, 
                "broadcast": "10.147.46.255", 
                "cidr": "10.147.46.102/24", 
                "device": "eth2", 
                "first_i_p": true, 
                "gateway": "10.147.46.1", 
                "netmask": "255.255.255.0", 
                "network": "10.147.46.0/24", 
                "new_nic": false, 
                "nic_dev_id": 2, 
                "nw_type": "public", 
                "one_to_one_nat": false, 
                "public_ip": "10.147.46.102", 
                "size": "24", 
                "source_nat": true, 
                "vif_mac_address": "06:4a:54:00:00:0e"
            }, 
            {
                "add": false, 
                "broadcast": "10.147.46.255", 
                "cidr": "10.147.46.107/24", 
                "device": "eth2", 
                "first_i_p": true, 
                "gateway": "10.147.46.1", 
                "netmask": "255.255.255.0", 
                "network": "10.147.46.0/24", 
                "new_nic": false, 
                "nic_dev_id": 2, 
                "nw_type": "public", 
                "one_to_one_nat": true, 
                "public_ip": "10.147.46.107", 
                "size": "24", 
                "source_nat": true, 
                "vif_mac_address": "06:b5:36:00:00:13"
            }, 
            {
                "add": false, 
                "broadcast": "10.147.46.255", 
                "cidr": "10.147.46.108/24", 
                "device": "eth2", 
                "first_i_p": true, 
                "gateway": "10.147.46.1", 
                "netmask": "255.255.255.0", 
                "network": "10.147.46.0/24", 
                "new_nic": false, 
                "nic_dev_id": 2, 
                "nw_type": "public", 
                "one_to_one_nat": true, 
                "public_ip": "10.147.46.108", 
                "size": "24", 
                "source_nat": true, 
                "vif_mac_address": "06:6d:c8:00:00:14"
            }, 
            {
                "add": false, 
                "broadcast": "10.147.46.255", 
                "cidr": "10.147.46.111/24", 
                "device": "eth2", 
                "first_i_p": true, 
                "gateway": "10.147.46.1", 
                "netmask": "255.255.255.0", 
                "network": "10.147.46.0/24", 
                "new_nic": false, 
                "nic_dev_id": 2, 
                "nw_type": "public", 
                "one_to_one_nat": true, 
                "public_ip": "10.147.46.111", 
                "size": "24", 
                "source_nat": true, 
                "vif_mac_address": "06:32:90:00:00:17"
            }, 
            {
                "add": true, 
                "broadcast": "10.147.46.255", 
                "cidr": "10.147.46.112/24", 
                "device": "eth2", 
                "first_i_p": true, 
                "gateway": "10.147.46.1", 
                "netmask": "255.255.255.0", 
                "network": "10.147.46.0/24", 
                "new_nic": false, 
                "nic_dev_id": 2, 
                "nw_type": "public", 
                "one_to_one_nat": true, 
                "public_ip": "10.147.46.112", 
                "size": "24", 
                "source_nat": true, 
                "vif_mac_address": "06:83:68:00:00:18"
            }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    @ProjectMoon  The ip issue can be worked as separate ticket/PR. It is an isolated issue, it is not having any dependency with this PR. So we will get this PR in and create a separate ticket for the ip issue. What do you say ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110854129
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -848,13 +849,38 @@ public int compare(final PublicIpAddress o1, final PublicIpAddress o2) {
                     associatedWithNetworkId = ipAddrList.get(0).getNetworkId();
                 }
     
    +            // for network if the ips does not have any rules, then only last ip
    +            List<IPAddressVO> userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null);
    +
    +            int ipsWithrules = 0;
    +            int ipsStaticNat = 0;
    +            for (IPAddressVO ip : userIps) {
    +                if ( _rulesDao.countRulesByIpIdAndState(ip.getId(), FirewallRule.State.Active) > 0 ) {
    --- End diff --
    
    Updated


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    @ProjectMoon  Jenkins and CI is passed, Can you please give LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110848750
  
    --- Diff: setup/db/db/schema-4920to41000.sql ---
    @@ -230,5 +230,11 @@ JOIN `cloud`.`vm_snapshots` s ON (s.service_offering_id = o.id AND s.vm_id = v.i
     WHERE (o.cpu is null AND o.speed IS NULL AND o.ram_size IS NULL) AND
     (d.name = 'cpuNumber' OR d.name = 'cpuSpeed' OR d.name = 'memory');
     
    +<<<<<<< 1c48deefe9b534198cad19b5528ce0dcfa8d04a5
     -- CLOUDSTACK-9827: Storage tags stored in multiple places
     DROP VIEW IF EXISTS `cloud`.`storage_tag_view`;
    +
    +ALTER TABLE `user_ip_address` ADD COLUMN `rule_state` VARCHAR(32) COMMENT 'static  rule state while removing';
    +=======
    --- End diff --
    
    Conflict line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    @ProjectMoon  Can you please review it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r106856634
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -848,13 +849,37 @@ public int compare(final PublicIpAddress o1, final PublicIpAddress o2) {
                     associatedWithNetworkId = ipAddrList.get(0).getNetworkId();
                 }
     
    +            // for network if the ips does not have any rules, then only last ip
    +            List<IPAddressVO> userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null);
    +
    +            int ipsWithrules = 0;
    +            int ipsStaticNat = 0;
    +            for (IPAddressVO ip : userIps) {
    +                if ( _rulesDao.countRulesByIpIdAndState(ip.getId(), FirewallRule.State.Active) > 0 ) {
    +                    ipsWithrules++;
    +                }
    +
    +                // check onetoonenat and also check if the ip "add":false. If there are 2 PF remove 1 static nat add
    +                if (ip.isOneToOneNat() && ip.getRuleState() == null) {
    +                    ipsStaticNat++;
    +                }
    +            }
    +
                 final IpAssocCommand cmd = new IpAssocCommand(ipsToSend);
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, _routerControlHelper.getRouterIpInNetwork(associatedWithNetworkId, router.getId()));
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
                 final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
                 cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString());
     
    +            // if there 1 static nat then it will be checked for remove at the resource
    +            if (ipsWithrules == 0 && ipsStaticNat == 0 ) {
    --- End diff --
    
    There's an extraneous space between the `0` and the `)` here. Also, this is probably just me misunderstanding the code, but wouldn't you want to check if `ipsStaticNat` equals `1` in this case? Or maybe you're checking for both to be `0` because if both are 0 we're generating a removal command?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by cloudmonger <gi...@git.apache.org>.
Github user cloudmonger commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    ### ACS CI BVT Run
     **Sumarry:**
     Build Number 5
     Hypervisor xenserver
     NetworkType Advanced
     Passed=464
     Failed=341
     Skipped=53
    
    _Link to logs Folder (search by build_no):_ https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0
    
    
    **Failed tests:**
    * test_dhcp_dns_offload.py
    
     * ContextSuite context=TestDeployVMs>:setup Failing since 2 runs
    
    * test_affinity_groups_projects.py
    
     * test_01_deploy_vm_anti_affinity_group Failing since 2 runs
    
     * test_02_deploy_vm_anti_affinity_group_fail_on_not_enough_hosts Failing since 2 runs
    
     * test_01_list_aff_grps_for_vm Failing since 3 runs
    
     * test_02_list_multiple_aff_grps_for_vm Failing since 3 runs
    
     * test_07_list_all_vms_in_aff_grp Failing since 2 runs
    
     * test_01_update_aff_grp_by_ids Failed
    
    * test_ps_domain_limits.py
    
     * test_04_create_template_snapshot Failing since 2 runs
    
    * test_VirtualRouter_alerts.py
    
     * test_01_VRServiceFailureAlerting Failed
    
    * test_ss_domain_limits.py
    
     * test_04_create_template_delete_account Failing since 3 runs
    
     * test_04_create_template_delete_account Failing since 4 runs
    
     * test_01_multiple_domains_secondary_storage_limits Failing since 3 runs
    
     * test_02_multiple_domains_secondary_storage_counts Failing since 2 runs
    
    * test_deploy_vm_userdata_multi_nic.py
    
     * test_deployvm_multinic Failing since 2 runs
    
    * test_vpn_service.py
    
     * test_01_VPN_service Failing since 2 runs
    
    * test_organization_states.py
    
     * ContextSuite context=TestOrganizationStates>:setup Failing since 2 runs
    
    * test_escalations_snapshots.py
    
     * ContextSuite context=TestSnapshots>:setup Failing since 2 runs
    
    * test_haproxy.py
    
     * test_01_create_sticky_policy_default_values Failed
    
     * test_02_create_sticky_policy_custom_values Failed
    
     * test_03_supported_policies_by_network Failed
    
     * test_04_delete_lb_rule Failed
    
     * test_05_error_alerts_after_create Failed
    
     * test_06_release_ip Failed
    
     * test_07_delete_account Failed
    
     * test_08_create_policy_router_stopped Failed
    
     * test_09_create_policy_router_destroy Failed
    
     * test_10_create_policy_enable_disable_vpn Failed
    
     * test_11_invalid_params Failed
    
    * test_dynamic_compute_offering.py
    
     * test_max_account_cpus_scale_VM_1_ADMIN_ACCOUNT Failed
    
     * test_max_account_cpus_scale_VM_2_USER_ACCOUNT Failed
    
     * test_max_account_memory_scale_VM_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_max_account_memory_scale_VM_2_USER_ACCOUNT Failing since 2 runs
    
     * test_deploy_VM_with_affinity_group_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_deploy_VM_with_affinity_group_2_USER_ACCOUNT Failing since 2 runs
    
     * ContextSuite context=TestDynamicServiceOffering>:setup Failing since 2 runs
    
     * test_change_so_running_vm_dynamic_to_dynamic_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_running_vm_dynamic_to_dynamic_2_USER_ACCOUNT Failing since 2 runs
    
     * test_change_so_running_vm_dynamic_to_static_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_running_vm_dynamic_to_static_2_USER_ACCOUNT Failing since 2 runs
    
     * test_change_so_running_vm_static_to_dynamic_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_running_vm_static_to_dynamic_2_USER_ACCOUNT Failing since 2 runs
    
     * test_change_so_running_vm_static_to_static_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_running_vm_static_to_static_2_USER_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_dynamic_to_dynamic_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_dynamic_to_dynamic_2_USER_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_dynamic_to_static_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_dynamic_to_static_2_USER_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_static_to_dynamic_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_static_to_dynamic_2_USER_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_static_to_static_1_ADMIN_ACCOUNT Failing since 2 runs
    
     * test_change_so_stopped_vm_static_to_static_2_USER_ACCOUNT Failed
    
    * test_ps_resource_limits_volume.py
    
     * test_attach_volume_exceeding_primary_limits Failing since 2 runs
    
    * test_vpc.py
    
     * test_07_restart_network_vm_running Failing since 2 runs
    
     * test_08_delete_vpc Failing since 2 runs
    
     * test_11_deploy_vm_wo_network_netdomain Failing since 2 runs
    
     * test_13_deploy_vm_with_vpc_netdomain Failing since 2 runs
    
     * test_14_deploy_vm_1 Failing since 2 runs
    
     * test_15_deploy_vm_2 Failing since 2 runs
    
     * test_16_deploy_vm_for_user_by_admin Failing since 2 runs
    
     * test_21_deploy_vm_with_gateway_ip Failing since 2 runs
    
     * test_22_vpn_customer_gw_with_hostname Failing since 2 runs
    
    * test_non_contiguous_vlan.py
    
     * test_01_add_non_contiguous_ranges Failing since 2 runs
    
     * test_05_remove_used_range Failed
    
    * test_project_usage.py
    
     * ContextSuite context=TestLBRuleUsage>:setup Failing since 3 runs
    
     * ContextSuite context=TestNatRuleUsage>:setup Failing since 3 runs
    
     * ContextSuite context=TestPublicIPUsage>:setup Failing since 3 runs
    
     * ContextSuite context=TestSnapshotUsage>:setup Failing since 3 runs
    
     * ContextSuite context=TestVmUsage>:setup Failing since 3 runs
    
     * ContextSuite context=TestVolumeUsage>:setup Failing since 3 runs
    
     * ContextSuite context=TestVpnUsage>:setup Failing since 3 runs
    
    * test_ps_max_limits.py
    
     * test_01_deploy_vm_domain_limit_reached Failed
    
     * test_02_deploy_vm_account_limit_reached Failing since 5 runs
    
     * test_03_deploy_vm_project_limit_reached Failed
    
    * test_project_resources.py
    
     * test_07_associate_public_ip Failing since 2 runs
    
    * test_vpc_network_staticnatrule.py
    
     * test_01_VPC_StaticNatRuleCreateStoppedState Failing since 2 runs
    
     * test_02_VPC_CreateStaticNatRule Failed
    
     * test_03_VPC_StopCreateMultipleStaticNatRuleStopppedState Failing since 2 runs
    
     * test_04_VPC_CreateMultipleStaticNatRule Failing since 2 runs
    
     * test_05_network_services_VPC_DeleteAllPF Failing since 2 runs
    
     * test_06_network_services_VPC_DeleteAllMultiplePF Failing since 2 runs
    
    * test_redundant_router_services.py
    
     * test_enableVPNOverRvR Failing since 2 runs
    
    * test_resource_limits.py
    
     * test_01_vm_per_account Failing since 2 runs
    
     * test_02_publicip_per_account Failing since 2 runs
    
     * test_03_snapshots_per_account Failing since 2 runs
    
     * test_04_volumes_per_account Failing since 2 runs
    
     * test_05_templates_per_account Failing since 2 runs
    
     * test_01_publicip_per_domain Failed
    
     * test_01_vm_per_domain Failed
    
     * test_03_snapshots_per_domain Failed
    
     * test_04_volumes_per_domain Failed
    
     * test_05_templates_per_domain Failed
    
    * test_escalations_vpncustomergateways.py
    
     * test_01_list_vpncustomergateways_pagination Failing since 2 runs
    
     * test_02_update_vpncustomergateways Failing since 2 runs
    
    * test_snapshots_improvement.py
    
     * test_01_concurrent_snapshots_live_migrate Failed
    
     * test_02_stop_vm_concurrent_snapshots Failed
    
     * test_03_concurrent_snapshots_create_template Failed
    
     * test_04_concurrent_snapshots_create_volume Failed
    
     * test_01_snapshot_on_rootVolume Failed
    
    * test_multiple_public_interfaces.py
    
     * ContextSuite context=TestIptables>:setup Failed
    
     * ContextSuite context=TestPortForwarding>:setup Failing since 9 runs
    
     * ContextSuite context=TestRouting>:setup Failing since 2 runs
    
     * ContextSuite context=TestStaticNat>:setup Failing since 2 runs
    
     * test_network_services_VPC_CreatePF Failing since 3 runs
    
     * test_network_services_VPC_CreatePF Failing since 4 runs
    
    * test_vpn_users.py
    
     * test_01_VPN_user_limit Failed
    
     * test_02_use_vpn_port Failed
    
     * test_03_enable_vpn_use_port Failed
    
     * test_04_add_new_users Failed
    
     * test_05_add_duplicate_user Failed
    
     * test_06_add_VPN_user_global_admin Failed
    
     * test_07_add_VPN_user_domain_admin Failed
    
     * test_08_add_TCP_PF_Rule_In_VPN Failed
    
    * test_cpu_project_limits.py
    
     * test_01_project_counts_start_stop_instance Failing since 2 runs
    
     * test_02_project_counts_migrate_instance Failing since 2 runs
    
     * test_03_project_counts_delete_instance Failing since 2 runs
    
    * test_routers.py
    
     * ContextSuite context=TestRouterServices>:setup Failing since 11 runs
    
     * ContextSuite context=TestRouterStopCreateFW>:setup Failed
    
     * ContextSuite context=TestRouterStopCreateLB>:setup Failed
    
     * ContextSuite context=TestRouterStopCreatePF>:setup Failed
    
    * test_overcommit.py
    
     * test_01_cluster_settings Failing since 2 runs
    
     * test_02_Overcommit_factor Failing since 2 runs
    
     * test_03_cluste_capacity_check Failing since 2 runs
    
     * test_04_zone_capacity_check Failing since 2 runs
    
    * test_custom_hostname.py
    
     * test_01_custom_hostname_instancename_false Failing since 2 runs
    
    * test_snapshots.py
    
     * test_01_createVM_snapshotTemplate Failing since 2 runs
    
     * ContextSuite context=TestSnapshotEvents>:setup Failing since 2 runs
    
     * test_01_volume_from_snapshot Failing since 2 runs
    
     * test_02_snapshot_data_disk Failing since 2 runs
    
     * test_03_snapshot_detachedDisk Failing since 2 runs
    
     * test_04_delete_snapshot Failing since 2 runs
    
     * test_07_template_from_snapshot Failing since 2 runs
    
    * test_egress_fw_rules.py
    
     * test_01_1_egress_fr1 Failing since 2 runs
    
     * test_01_2_egress_fr1 Failing since 2 runs
    
     * test_01_egress_fr1 Failing since 2 runs
    
     * test_02_1_egress_fr2 Failing since 2 runs
    
     * test_02_2_egress_fr2 Failing since 2 runs
    
     * test_02_egress_fr2 Failing since 2 runs
    
     * test_03_1_egress_fr3 Failing since 2 runs
    
     * test_03_egress_fr3 Failing since 2 runs
    
     * test_04_1_egress_fr4 Failing since 2 runs
    
     * test_04_egress_fr4 Failing since 2 runs
    
     * test_06_1_egress_fr6 Failing since 2 runs
    
     * test_06_egress_fr6 Failing since 2 runs
    
     * test_07_1_egress_fr7 Failing since 2 runs
    
     * test_07_egress_fr7 Failing since 2 runs
    
     * test_09_1_egress_fr9 Failing since 2 runs
    
     * test_09_egress_fr9 Failed
    
     * test_10_1_egress_fr10 Failed
    
     * test_10_egress_fr10 Failed
    
     * test_11_1_egress_fr11 Failed
    
     * test_11_egress_fr11 Failed
    
     * test_12_1_egress_fr12 Failed
    
     * test_12_egress_fr12 Failed
    
     * test_13_1_egress_fr13 Failed
    
     * test_13_egress_fr13 Failed
    
    * test_tags.py
    
     * ContextSuite context=TestResourceTags>:setup Failed
    
    * test_redundant_router_cleanups.py
    
     * test_network_gc Failed
    
     * test_restart_network_with_destroyed_masterVR Failing since 2 runs
    
     * test_restart_ntwk_no_cleanup Failed
    
     * test_restart_ntwk_with_cleanup Failed
    
    * test_ss_max_limits.py
    
     * test_01_deploy_vm_domain_limit_reached Failing since 2 runs
    
     * test_02_deploy_vm_account_limit_reached Failing since 6 runs
    
     * test_03_deploy_vm_project_limit_reached Failing since 2 runs
    
    * test_ss_project_limits.py
    
     * test_01_register_template_with_project Failing since 2 runs
    
    * test_deploy_vm_userdata_reg.py
    
     * test_deployvm_userdata_post Failed
    
    * test_memory_limits.py
    
     * test_01_stop_start_instance Failing since 1 runs
    
     * test_02_migrate_instance Failing since 1 runs
    
     * test_03_delete_instance Failed
    
     * test_01_stop_start_instance Failing since 2 runs
    
     * test_02_migrate_instance Failing since 2 runs
    
     * test_03_delete_instance Failing since 2 runs
    
     * test_04_deploy_multiple_vm Failing since 2 runs
    
    * test_vpc_network_pfrules.py
    
     * test_01_network_services_VPC_StopCreatePF Failing since 2 runs
    
     * test_02_network_services_VPC_CreatePF Failing since 2 runs
    
     * test_03_network_services_VPC_StopCreateMultiplePF Failing since 2 runs
    
     * test_04_network_services_VPC_CreateMultiplePF Failing since 2 runs
    
     * test_05_network_services_VPC_StopDeletePF Failing since 2 runs
    
     * test_06_network_services_VPC_DeletePF Failing since 2 runs
    
     * test_07_network_services_VPC_StopDeleteAllPF Failing since 2 runs
    
     * test_08_network_services_VPC_DeleteAllPF Failing since 2 runs
    
     * test_09_network_services_VPC_StopDeleteAllMultiplePF Failing since 2 runs
    
     * test_10_network_services_VPC_DeleteAllMultiplePF Failing since 2 runs
    
    * test_ip_reservation.py
    
     * test_reservation_after_router_restart Failed
    
     * test_vm_create_after_reservation Failing since 3 runs
    
     * test_vm_create_outside_cidr_after_reservation Failing since 3 runs
    
     * test_ip_reservation_in_multiple_networks_same_account Failing since 2 runs
    
     * test_nat_rules_1_nat_rule Failing since 2 runs
    
     * test_nat_rules_2_static_nat_rule Failing since 2 runs
    
     * test_update_cidr_multiple_vms_not_all_inclusive Failing since 2 runs
    
     * test_update_cidr_single_vm_not_inclusive Failing since 2 runs
    
     * test_vm_create_after_reservation Failing since 4 runs
    
     * test_vm_create_outside_cidr_after_reservation Failing since 4 runs
    
     * test_restart_network_with_cleanup_1_True Failing since 2 runs
    
     * test_restart_network_with_cleanup_2_False Failed
    
     * test_destroy_recreate_router Failed
    
     * test_reservation_after_router_restart Failing since 2 runs
    
     * test_update_network_guestvmcidr_1_existingVmInclusive Failed
    
     * test_update_network_guestvmcidr_2_existingVmExclusive Failed
    
    * test_vpc_vms_deployment.py
    
     * test_01_deploy_vms_in_network Failing since 2 runs
    
     * test_02_deploy_vms_delete_network Failing since 2 runs
    
     * test_03_deploy_vms_delete_add_network Failing since 2 runs
    
     * test_04_deploy_vms_delete_add_network_noLb Failing since 2 runs
    
     * test_05_create_network_max_limit Failing since 2 runs
    
     * test_06_delete_network_vm_running Failing since 2 runs
    
     * test_07_delete_network_with_rules Failing since 2 runs
    
    * test_vpc_network.py
    
     * ContextSuite context=TestVPCNetworkGc>:setup Failing since 2 runs
    
    * test_mm_project_limits.py
    
     * test_01_project_vmlifecycle_start_stop_instance Failing since 2 runs
    
     * test_02_project_vmlifecycle_migrate_instance Failing since 2 runs
    
     * test_03_project_vmlifecycle_delete_instance Failing since 2 runs
    
    * test_escalations_instances.py
    
     * test_13_attach_detach_iso Failing since 2 runs
    
     * test_14_vm_snapshot_pagination Failing since 2 runs
    
     * test_15_revert_vm_to_snapshot Failing since 2 runs
    
     * test_16_list_vm_volumes_pagination Failing since 2 runs
    
     * test_18_stopped_vm_change_service Failing since 2 runs
    
     * test_19_create_reset_vm_sshkey Failing since 2 runs
    
     * test_20_update_vm_displayname_group Failing since 2 runs
    
     * test_21_restore_vm Failing since 2 runs
    
     * test_22_deploy_vm_multiple_networks Failing since 2 runs
    
     * test_24_deploy_vm_with_static_ip_ES1662 Failing since 2 runs
    
     * test_25_ip_reallocation_ES1377 Failing since 2 runs
    
     * test_27_VM_restore_ES3467 Failing since 2 runs
    
     * test_28_VM_restore_ES3467 Failing since 2 runs
    
     * test_01_list_instances_pagination Failing since 2 runs
    
     * test_02_list_Running_vm Failing since 2 runs
    
     * test_03_list_Stopped_vm Failing since 2 runs
    
     * test_04_list_Destroyed_vm Failing since 2 runs
    
     * test_05_list_vm_by_id Failing since 2 runs
    
     * test_06_list_vm_by_name Failing since 2 runs
    
     * test_07_list_vm_by_name_state Failing since 2 runs
    
     * test_10_list_vm_by_zone_name_state Failing since 2 runs
    
     * test_11_register_reset_vm_sshkey Failing since 2 runs
    
     * test_12_running_vm_change_service Failing since 2 runs
    
     * test_13_vm_nics Failing since 2 runs
    
    * test_acl_isolatednetwork.py
    
     * ContextSuite context=TestIsolatedNetwork>:setup Failing since 2 runs
    
    * test_cpu_domain_limits.py
    
     * test_01_multiple_core_vm_start_stop_instance Failing since 2 runs
    
     * test_02_multiple_core_vm_migrate_instance Failing since 2 runs
    
     * test_03_multiple_core_vm_delete_instance Failing since 2 runs
    
     * test_04_deploy_multiple_vm_with_multiple_core Failing since 2 runs
    
     * test_01_multiple_child_domains Failing since 3 runs
    
    * test_escalations_networks.py
    
     * test_03_list_vpc_pagination Failing since 2 runs
    
     * test_04_create_vpc_with_networkdomain Failing since 2 runs
    
     * test_06_create_network_in_vpc Failing since 2 runs
    
     * test_10_list_networks_in_vpc Failing since 2 runs
    
     * test_11_update_vpc Failing since 2 runs
    
     * test_12_list_create_delete_networkACL Failing since 2 runs
    
     * test_19_create_list_reset_delete_vpnconnections Failing since 2 runs
    
    * test_storage_motion.py
    
     * ContextSuite context=TestStorageMotion>:setup Failed
    
    * test_accounts.py
    
     * ContextSuite context=TestAddVmToSubDomain>:setup Failing since 2 runs
    
     * test_DeleteDomain Failing since 2 runs
    
     * test_forceDeleteDomain Failing since 2 runs
    
     * test_01_user_remove_VM_running Failing since 2 runs
    
     * ContextSuite context=TestTemplateHierarchy>:setup Failing since 2 runs
    
     * test_LoginApiDomain Failing since 2 runs
    
     * test_LoginApiUuidResponse Failing since 2 runs
    
    * test_escalations_routers.py
    
     * test_01_FTPModulesInVR Failed
    
    * test_ps_limits.py
    
     * test_create_template_snapshot_1_root_domain_admin Failing since 2 runs
    
     * test_create_template_snapshot_2_child_domain_admin Failing since 2 runs
    
    * test_mm_max_limits.py
    
     * test_02_deploy_vm_account_limit_reached Failing since 7 runs
    
     * test_04_deployVm__account_limit_reached Failing since 3 runs
    
    * test_cpu_max_limits.py
    
     * test_02_deploy_vm_account_limit_reached Failing since 8 runs
    
     * test_04_deployVm__account_limit_reached Failing since 4 runs
    
    * test_escalation_listTemplateDomainAdmin.py
    
     * test_listtemplate Failing since 2 runs
    
    * test_projects.py
    
     * test_09_project_suspend Failed
    
     * test_10_project_activation Failed
    
    * test_portable_ip.py
    
     * test_associate_ip_address_services_enable_disable Failing since 2 runs
    
     * test_list_portable_ip_range_non_root_admin Failed
    
    * test_affinity_groups.py
    
     * test_03_delete_aff_grp_with_vms Failing since 2 runs
    
     * test_01_deploy_vm_without_aff_grp Failing since 2 runs
    
     * test_02_deploy_vm_by_aff_grp_name Failing since 2 runs
    
     * test_03_deploy_vm_by_aff_grp_id Failing since 2 runs
    
     * test_04_deploy_vm_anti_affinity_group Failing since 2 runs
    
     * test_05_deploy_vm_by_id Failing since 2 runs
    
     * test_08_deploy_vm_multiple_aff_grps Failing since 2 runs
    
     * test_09_deploy_vm_multiple_aff_grps Failing since 2 runs
    
     * test_01_list_aff_grps_for_vm Failing since 4 runs
    
     * test_02_list_multiple_aff_grps_for_vm Failing since 4 runs
    
     * test_07_list_all_vms_in_aff_grp Failing since 3 runs
    
     * test_01_update_aff_grp_by_ids Failing since 2 runs
    
     * test_02_update_aff_grp_by_names Failing since 2 runs
    
     * test_03_update_aff_grp_for_vm_with_no_aff_grp Failing since 2 runs
    
     * test_05_update_aff_grp_on_running_vm Failing since 2 runs
    
    * test_acl_listvolume.py
    
     * ContextSuite context=TestVolumeList>:setup Failing since 2 runs
    
    * test_mm_domain_limits.py
    
     * test_01_change_service_offering Failing since 2 runs
    
     * test_02_migrate_vm Failing since 2 runs
    
     * test_03_delete_vm Failing since 2 runs
    
     * test_04_deploy_multiple_vm Failing since 3 runs
    
     * test_01_multiple_child_domains Failing since 4 runs
    
    * test_blocker_bugs.py
    
     * ContextSuite context=TestDataPersistency>:setup Failing since 2 runs
    
     * ContextSuite context=TestNATRules>:setup Failing since 2 runs
    
     * ContextSuite context=TestRouterRestart>:setup Failing since 2 runs
    
     * test_01_list_routers_admin Failing since 2 runs
    
     * test_01_create_template Failing since 3 runs
    
    * test_vpc_network_internal_lbrules.py
    
     * test_02_internallb_rules_traffic Failing since 2 runs
    
     * test_03_internallb_rules_vpc_network_restarts_traffic Failing since 2 runs
    
     * test_04_internallb_appliance_operations_traffic Failing since 2 runs
    
    * test_add_remove_network.py
    
     * ContextSuite context=TestAddNetworkToVirtualMachine>:setup Failing since 2 runs
    
     * ContextSuite context=TestFailureScenariosAddNetworkToVM>:setup Failing since 2 runs
    
     * ContextSuite context=TestFailureScenariosRemoveNicFromVM>:setup Failing since 2 runs
    
     * ContextSuite context=TestFailureScenariosUpdateVirtualMachineNIC>:setup Failing since 2 runs
    
     * ContextSuite context=TestRemoveNetworkFromVirtualMachine>:setup Failing since 2 runs
    
     * ContextSuite context=TestUpdateVirtualMachineNIC>:setup Failing since 2 runs
    
    * test_escalations_ipaddresses.py
    
     * test_11_create_delete_firewallrule Failing since 2 runs
    
    * test_volumes.py
    
     * ContextSuite context=TestAttachDetachVolume>:setup Failed
    
     * ContextSuite context=TestAttachVolume>:setup Failing since 2 runs
    
     * ContextSuite context=TestAttachVolumeISO>:setup Failing since 2 runs
    
     * ContextSuite context=TestMigrateVolume>:setup Failing since 2 runs
    
     * ContextSuite context=TestVolumes>:setup Failing since 13 runs
    
    * test_acl_listsnapshot.py
    
     * ContextSuite context=TestSnapshotList>:setup Failing since 2 runs
    
    * test_stopped_vm.py
    
     * test_deploy_vm_password_enabled Failing since 2 runs
    
    * test_escalations_templates.py
    
     * test_01_list_templates_pagination Failing since 2 runs
    
     * test_02_download_template Failing since 2 runs
    
     * test_03_edit_template_details Failing since 2 runs
    
    * test_ss_limits.py
    
     * test_01_register_template_1_root_domain_admin Failing since 2 runs
    
     * test_01_register_template_2_child_domain_admin Failing since 2 runs
    
     * test_02_create_template_snapshot_1_root_domain_admin Failed
    
     * test_02_create_template_snapshot_2_child_domain_admin Failed
    
    * test_ps_resize_volume.py
    
     * test_01_increase_volume_size_within_account_limit Failed
    
     * test_02_increase_volume_size_above_account_limit Failing since 2 runs
    
     * test_03_increase_volume_size_above_domain_limit Failing since 2 runs
    
    * test_vm_passwdenabled.py
    
     * ContextSuite context=TestVMPasswordEnabled>:setup Failed
    
    * test_usage.py
    
     * ContextSuite context=TestLBRuleUsage>:setup Failing since 4 runs
    
     * ContextSuite context=TestNatRuleUsage>:setup Failing since 4 runs
    
     * ContextSuite context=TestPublicIPUsage>:setup Failing since 4 runs
    
     * ContextSuite context=TestSnapshotUsage>:setup Failing since 4 runs
    
     * ContextSuite context=TestVmUsage>:setup Failing since 4 runs
    
     * ContextSuite context=TestVolumeUsage>:setup Failing since 4 runs
    
     * ContextSuite context=TestVpnUsage>:setup Failing since 4 runs
    
    * test_vpc_vm_life_cycle.py
    
     * test_02_deploy_vm_vpcvr_stopped Failed
    
     * ContextSuite context=TestVMLifeCycleDiffHosts>:setup Failed
    
     * ContextSuite context=TestVMLifeCycleSharedNwVPC>:setup Failed
    
     * ContextSuite context=TestVMLifeCycleStoppedVPCVR>:setup Failed
    
     * ContextSuite context=TestVMLifeCycleVPC>:setup Failed
    
    * test_project_limits.py
    
     * test_03_vm_per_project Failed
    
     * test_04_publicip_per_project Failed
    
     * test_05_snapshots_per_project Failed
    
     * test_06_volumes_per_project Failing since 2 runs
    
     * test_07_templates_per_project Failing since 2 runs
    
    * test_templates.py
    
     * test_01_create_template Failing since 4 runs
    
    * test_assign_vm.py
    
     * test_13_move_across_subdomain_vm_snapshot Failing since 2 runs
    
     * test_15_move_across_subdomain_account_limit Failing since 2 runs
    
     * test_16_move_across_subdomain_volume_and_account_limit Failing since 2 runs
    
    
    **Skipped tests:**
    test_03_copy_template
    ContextSuite context=TestvGPUWindowsVm>:setup
    ContextSuite context=TestTemplateUsage>:setup
    test_02_create_vpc_from_offering_with_regionlevelvpc_service_capability
    test_03_deploy_vms_in_vpc_with_regionlevelvpc
    test_02_cancel_host_maintenace_with_migration_jobs
    ContextSuite context=TestInstanceNameFlagTrue>:setup
    test_04_deploy_multiple_vm_with_multiple_cpus
    test_05_1_egress_fr5
    test_05_egress_fr5
    test_08_1_egress_fr8
    test_08_egress_fr8
    ContextSuite context=TestAffinityRules>:setup
    ContextSuite context=TestAntiAffinityRules>:setup
    test_02_create_vpc_from_offering_with_distributedrouter_service_capability
    test_03_deploy_vms_in_vpc_with_distributedrouter
    test_04_deploy_multiple_vm
    ContextSuite context=TestProjectCreationNegative>:setup
    ContextSuite context=TestProjectInviteRequiredTrue>:setup
    ContextSuite context=TestProjectInviteTimeout>:setup
    test_RVR_network
    test_01_create_network_2_network_offering_vpcns
    test_02_create_network_fail_2_network_offering_vpcns
    test_04_create_multiple_networks_with_lb_1_network_offering
    test_04_create_multiple_networks_with_lb_2_network_offering_vpcns
    test_06_create_network_with_rvr
    test_09_create_network_shared_nwoff_2_network_offering_vpcns
    test_01_create_network_outside_range_2_network_offering_vpcns
    test_03_create_network_inside_range_2_network_offering_vpcns
    test_04_create_network_overlapping_range_2_network_offering_vpcns
    test_05_create_network_diff_account_2_network_offering_vpcns
    test_02_concurrent_snapshot_global_limit
    test_01_VM_start_stop
    test_02_migrate_vm
    test_03_delete_vm
    test_01_deploy_vm_with_implicit_planner
    test_destroy_recover_vm_1_root_domain_admin
    test_destroy_recover_vm_2_child_domain_admin
    test_04_copy_iso
    test_04_update_aff_grp_remove_all
    test_01_host_ha_with_nfs_storagepool_with_vm
    test_02_host_ha_with_local_storage_and_nfs
    test_03_host_ha_with_only_local_storage
    ContextSuite context=TestTemplates>:setup
    test_09_stop_vm_migrate_vol
    test_04_copy_template
    test_04_copy_template_1_root_domain_admin
    test_04_copy_template_2_child_domain_admin
    test1_attach_volume_ide
    test2_attach_ISO_in_CentOSVM
    ContextSuite context=TestTemplateUsage>:setup
    test_01_addLdapConfiguration
    ContextSuite context=TestTemplates>:setup
    
    **Passed test suits:**
    None
    test_redundant_router_upgrades.py
    test_regions_accounts.py
    test_acl_isolatednetwork_delete.py
    test_invalid_gw_nm.py
    test_vpc_offerings.py
    test_vpc_routers.py
    test_acl_listvm.py
    test_simultaneous_volume_attach.py
    test_update_vm.py
    test_escalations_volumes.py
    test_regions.py
    test_acl_sharednetwork.py
    test_allocation_states.py
    test_snapshot_gc.py
    test_network_offering.py
    None


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r106855300
  
    --- Diff: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java ---
    @@ -625,15 +627,20 @@ protected ExecutionResult cleanupNetworkElementCommand(final IpAssocCommand cmd)
     
                     // there is only one ip in this public vlan and removing it, so
                     // remove the nic
    -                if (ipsCount == 1 && !ip.isAdd()) {
    -                    removeVif = true;
    +                if (lastIp != null && lastIp.equalsIgnoreCase("true") && !ip.isAdd()) {
    --- End diff --
    
    `StringUtils.equalsIgnoreCase` can replace checking both null and the value: https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringUtils.html#equalsIgnoreCase(java.lang.String, java.lang.String)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110854055
  
    --- Diff: setup/db/db/schema-4920to41000.sql ---
    @@ -230,5 +230,11 @@ JOIN `cloud`.`vm_snapshots` s ON (s.service_offering_id = o.id AND s.vm_id = v.i
     WHERE (o.cpu is null AND o.speed IS NULL AND o.ram_size IS NULL) AND
     (d.name = 'cpuNumber' OR d.name = 'cpuSpeed' OR d.name = 'memory');
     
    +<<<<<<< 1c48deefe9b534198cad19b5528ce0dcfa8d04a5
    --- End diff --
    
    My bad, on multiple times rebase some how I missed it. Corrected now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    We have been testing this PR internally for some time now, and we have seen some strange `arping` issues. We have seen that `/etc/cloudstack/ips.json` on the router has IPs on them that aren't cleaned up. Since #1908 is now merged, I'm worried that the changes in this PR will not play well with #1908.
    
    Specifically, we have seen that IPs left over in the `ips.json` file can be stuck on `"add": true` even if the IP is no longer on the account. 
    
    Thus, the code that was added in PR 1907 concerns me:
    
    ```
     if not address['add'] and not ip.configured():
        logging.info("Skipping %s as the add flag is set to %s " % (address['public_ip'], address['add']))
        continue
    ```
    
    The `if` condition fails in a case we've been investigating. Because our IP is `"add": true`, but `configured()` returns `False`, the IP gets reconfigured anyway. This doesn't add the IP to the router's interface, but it _does_ run an `arping` command (see CsAddress.py). Essentially, if this PR is merged as-is, we might wind up with a regression on CLOUDSTACK-9500. 
    
    I will do a bit of manual testing combining both #1908 and #1907 to see what happens. It may just be that after restarting the network (and thus cleaning the router), these issues will vanish.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    Jenkins got timed out. I am force pushing again to trigger jenkins.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r100535848
  
    --- Diff: setup/db/db/schema-4920to41000.sql ---
    @@ -62,3 +62,4 @@ INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`,
     INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 3, 'createSnapshotFromVMSnapshot', 'ALLOW', 302) ON DUPLICATE KEY UPDATE rule=rule;
     INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 4, 'createSnapshotFromVMSnapshot', 'ALLOW', 260) ON DUPLICATE KEY UPDATE rule=rule;
     
    +ALTER TABLE `user_ip_address` ADD COLUMN `staticnat_state` VARCHAR(32) COMMENT 'static  rule state while removing'
    --- End diff --
    
    This column name does not match the name of the column in the VO (`rule_state`).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110082664
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---
    @@ -1764,9 +1765,12 @@ protected ExecutionResult cleanupNetworkElementCommand(final IpAssocCommand cmd)
                     }
                     nicNum = broadcastUriAllocatedToVM.get(ip.getBroadcastUri());
     
    -                if (numOfIps == 1 && !ip.isAdd()) {
    -                    vifHotUnPlug(conn, routerName, ip.getVifMacAddress());
    -                    networkUsage(routerIp, "deleteVif", "eth" + nicNum);
    +                if (lastIp != null && lastIp.equalsIgnoreCase("true") && !ip.isAdd()) {
    --- End diff --
    
    In CitrixresourceBase StringUtils is used from the  com.cloud.utils.StringUtils. So using  StringUtils from java.lang will be ambiguous.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    Question: would #1907 be relevant to this? That change relied on sending all the IPs to the router, but under this change, we will be sending one at a time.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    Looks good now. Not sure what's up with Jenkins though.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    @jayapalu Quite possible, yes. It could be fixed by adding another condition to the check that was added with #1907. It could also be "fixed" by checkiing if `configured()` returns `True` in the `arpPing()` method of the `CsIp` class. But I'm guessing that it doesn't get properly deleted from the DataBag when it's removed from the router. Thus it just gets written to `/etc/cloudstack/ips.json` again.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by yvsubhash <gi...@git.apache.org>.
Github user yvsubhash commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r96598944
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -823,13 +826,39 @@ public int compare(final PublicIpAddress o1, final PublicIpAddress o2) {
                     associatedWithNetworkId = ipAddrList.get(0).getNetworkId();
                 }
     
    +            // for network if the ips does not have any rules, then only last ip
    +            List<IPAddressVO> userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null);
    +
    +            int ipsWithrules = 0;
    +            int ipsStaticNat = 0;
    +            for (IPAddressVO ip : userIps) {
    +                if ( _firewallsDao.countRulesByIpIdAndState(ip.getId(), FirewallRule.State.Active) > 0 ) {
    +                    ipsWithrules++;
    +                }
    +
    +                if (ip.isOneToOneNat()) {
    +                    ipsStaticNat++;
    +                }
    +            }
    +
                 final IpAssocCommand cmd = new IpAssocCommand(ipsToSend);
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, _routerControlHelper.getRouterIpInNetwork(associatedWithNetworkId, router.getId()));
                 cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
                 final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
                 cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString());
     
    +            boolean remove = false;
    +            // if there is only one static nat then it will be checked for remove at the resource
    +            if (ipsWithrules == 0 && (ipsStaticNat == 0 || ipsStaticNat == 1)) {
    --- End diff --
    
    Can you combine these two if blocks and eliminate remove variable if this is not getting used at a later place


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1908: CLOUDSTACK-9317: Fixed disable static nat on leaving...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on the issue:

    https://github.com/apache/cloudstack/pull/1908
  
    @ProjectMoon 
    I have seen the issue of ips.json having the "add:true" while I am testing this PR. I tested this PR by manually removing the ip or setting add to false. Also I tested with the cleanup restart. With correct ips.json I did not see any issues with this PR.
    
    I think the ips.json problem is independent of this PR that need to be fixed.
    
    
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by jayapalu <gi...@git.apache.org>.
Github user jayapalu commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r110111189
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -848,13 +849,37 @@ public int compare(final PublicIpAddress o1, final PublicIpAddress o2) {
                     associatedWithNetworkId = ipAddrList.get(0).getNetworkId();
                 }
     
    +            // for network if the ips does not have any rules, then only last ip
    +            List<IPAddressVO> userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null);
    +
    +            int ipsWithrules = 0;
    +            int ipsStaticNat = 0;
    +            for (IPAddressVO ip : userIps) {
    +                if ( _rulesDao.countRulesByIpIdAndState(ip.getId(), FirewallRule.State.Active) > 0 ) {
    +                    ipsWithrules++;
    +                }
    +
    +                // check onetoonenat and also check if the ip "add":false. If there are 2 PF remove 1 static nat add
    +                if (ip.isOneToOneNat() && ip.getRuleState() == null) {
    --- End diff --
    
    In this case rule state is not set. It is null. I will improve the comment


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1908: CLOUDSTACK-9317: Fixed disable static nat on ...

Posted by ProjectMoon <gi...@git.apache.org>.
Github user ProjectMoon commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1908#discussion_r101736186
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -175,6 +176,8 @@
         @Inject
         private IPAddressDao _ipAddressDao;
         @Inject
    +    private FirewallRulesDao _firewallsDao;
    --- End diff --
    
    There is already a `FirewallRulesDao` in the file. No need to inject this one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---