You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "venkata swamybabu budumuru (JIRA)" <ji...@apache.org> on 2013/04/16 13:25:17 UTC

[jira] [Created] (CLOUDSTACK-2045) [Multiple IPs Per Nic] This feature is not working well in case of networks with external devices after GC

venkata swamybabu budumuru created CLOUDSTACK-2045:
------------------------------------------------------

             Summary: [Multiple IPs Per Nic] This feature is not working well in case of networks with external devices after GC
                 Key: CLOUDSTACK-2045
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2045
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Network Controller
    Affects Versions: 4.2.0
         Environment: commit bc3e184b7273da605177b0ac4ed7186f7fa36fbd 
            Reporter: venkata swamybabu budumuru
            Priority: Critical
             Fix For: 4.2.0


Steps to reproduce :

1. Have an advanced zone created with 1 Xen Cluster
2. create a network offering with SRX and Netscaler
mysql> select * from ntwk_offering_service_map where network_offering_id=14;
+----+---------------------+----------------+---------------+---------------------+
| id | network_offering_id | service | provider | created |
+----+---------------------+----------------+---------------+---------------------+
| 48 | 14 | Dhcp | VirtualRouter | 2013-04-15 09:49:58 |
| 49 | 14 | Dns | VirtualRouter | 2013-04-15 09:49:58 |
| 50 | 14 | Firewall | JuniperSRX | 2013-04-15 09:49:58 |
| 52 | 14 | Lb | Netscaler | 2013-04-15 09:49:58 |
| 51 | 14 | PortForwarding | JuniperSRX | 2013-04-15 09:49:58 |
| 47 | 14 | SourceNat | JuniperSRX | 2013-04-15 09:49:58 |
| 46 | 14 | StaticNat | JuniperSRX | 2013-04-15 09:49:58 |
| 53 | 14 | UserData | VirtualRouter | 2013-04-15 09:49:58 |
+----+---------------------+----------------+---------------+---------------------+

3. create a Network using the above offering

                   id: 210
                 name: ExtNet1
                 uuid: 455f4a1c-204a-4d64-8357-63b9e562d5b7
         display_text: ExtNet1
         traffic_type: Guest
broadcast_domain_type: Vlan
        broadcast_uri: vlan://902
              gateway: 10.0.32.1
                 cidr: 10.0.32.0/20
                 mode: Dhcp
  network_offering_id: 14
  physical_network_id: 200
       data_center_id: 1
            guru_name: ExternalGuestNetworkGuru
                state: Implemented
              related: 210
            domain_id: 2
           account_id: 3
                 dns1: 10.103.128.16
                 dns2: NULL
            guru_data: NULL
           set_fields: 0
             acl_type: Account
       network_domain: cs3swamy.xen
       reservation_id: 7f12298d-0c8a-41d7-9407-dd4744342c55
           guest_type: Isolated
     restart_required: 0
              created: 2013-04-15 15:04:53
              removed: NULL
    specify_ip_ranges: 0
               vpc_id: NULL
          ip6_gateway: NULL
             ip6_cidr: NULL
         network_cidr: NULL

4. deploy VM using the above network (for example : in my case it got 10.0.64.0/20 as CIDR)
5. acquire at least 2 secondary ips for the above nic
6. create some PF/static Nat rules 

Below mentioned are the configured rules on secondary ips:
- PF & Firewall rule created on one secondary ip i.e. 10.0.65.59
- Static Nat & Firewall rule create on one more secondary ip i.e. 10.0.65.78

mysql> select * from nic_secondary_ips;
+----+--------------------------------------+------+-------+-------------+-------------+------------+---------------------+------------+-----------+
| id | uuid                                 | vmId | nicId | ip4_address | ip6_address | network_id | created             | account_id | domain_id |
+----+--------------------------------------+------+-------+-------------+-------------+------------+---------------------+------------+-----------+
|  1 | c4af4a4f-2697-446e-9b2b-92df3be5a922 |   20 |    53 | 10.0.65.78  | NULL        |        210 | 2013-04-15 17:48:27 |          3 |         2 |
|  2 | 1f316ce5-2bc9-4c60-94b2-8d414dad2536 |   20 |    53 | 10.0.65.59  | NULL        |        210 | 2013-04-15 17:54:03 |          3 |         2 |
+----+--------------------------------------+------+-------+-------------+-------------+------------+---------------------+------------+-----------+

mysql> select * from user_ip_address where one_to_one_nat=1\G
*************************** 1. row ***************************
                 id: 5
               uuid: dd31e847-0aa8-4506-9a13-b6c6895d91a3
         account_id: 3
          domain_id: 2
  public_ip_address: 10.147.44.64
     data_center_id: 1
         source_nat: 0
          allocated: 2013-04-16 10:17:45
         vlan_db_id: 1
     one_to_one_nat: 1
              vm_id: 20
              state: Allocated
        mac_address: 15
  source_network_id: 200
         network_id: 210
physical_network_id: 200
          is_system: 0
             vpc_id: NULL
          dnat_vmip: 10.0.65.78

mysql> select * from port_forwarding_rules;
+----+-------------+-----------------+-----------------+---------------+
| id | instance_id | dest_ip_address | dest_port_start | dest_port_end |
+----+-------------+-----------------+-----------------+---------------+
| 22 |          20 | 10.0.65.59      |              22 |            22 |
+----+-------------+-----------------+-----------------+---------------+

7. Stop the above VM and wait till network GC happens

Note : Make sure that "network.gc.interval" and "network.gc.wait" are set to some small value. in my case it is set to "10" 

8. Make sure that above network is set to "Allocated" after GC

9. Deploy VM and verify everything is fine.


Observations :-

(i) After step:9, network got a new CIDR range allocated i.e. 10.0.32.0/20
(ii) Verified the table port_forwarding_rules which got automatically changed to the new CIDR but, that secondary ip doesn't exist anywhere.

mysql> select * from port_forwarding_rules;
+----+-------------+-----------------+-----------------+---------------+
| id | instance_id | dest_ip_address | dest_port_start | dest_port_end |
+----+-------------+-----------------+-----------------+---------------+
| 22 |          20 | 10.0.33.59      |              22 |            22 |
+----+-------------+-----------------+-----------------+---------------+

mysql> select * from user_ip_address where one_to_one_nat=1\G
*************************** 1. row ***************************
                 id: 5
               uuid: dd31e847-0aa8-4506-9a13-b6c6895d91a3
         account_id: 3
          domain_id: 2
  public_ip_address: 10.147.44.64
     data_center_id: 1
         source_nat: 0
          allocated: 2013-04-16 10:17:45
         vlan_db_id: 1
     one_to_one_nat: 1
              vm_id: 20
              state: Allocated
        mac_address: 15
  source_network_id: 200
         network_id: 210
physical_network_id: 200
          is_system: 0
             vpc_id: NULL
          dnat_vmip: 10.0.65.78
1 row in set (0.00 sec)

mysql> select * from nic_secondary_ips;
+----+--------------------------------------+------+-------+-------------+-------------+------------+---------------------+------------+-----------+
| id | uuid                                 | vmId | nicId | ip4_address | ip6_address | network_id | created             | account_id | domain_id |
+----+--------------------------------------+------+-------+-------------+-------------+------------+---------------------+------------+-----------+
|  1 | c4af4a4f-2697-446e-9b2b-92df3be5a922 |   20 |    53 | 10.0.65.78  | NULL        |        210 | 2013-04-15 17:48:27 |          3 |         2 |
|  2 | 1f316ce5-2bc9-4c60-94b2-8d414dad2536 |   20 |    53 | 10.0.65.59  | NULL        |        210 | 2013-04-15 17:54:03 |          3 |         2 |
+----+--------------------------------------+------+-------+-------------+-------------+------------+---------------------+------------+-----------+

Issue :
=====
While the secondary ips are still pointing to the OLD CIDR, network got a new CIDR after GC.

Enhancement/Improvement needs to be done here is :
==========================================

Either we need to persist the old CIDR or we need to change the secondary ips automatically fit into the new CIDR

Attaching the vmops.log and api.log

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira