You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/11/22 12:01:00 UTC

[jira] [Commented] (CLOUDSTACK-9853) IPv6 Prefix Delegation support in Basic Networking

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-9853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16262404#comment-16262404 ] 

ASF GitHub Bot commented on CLOUDSTACK-9853:
--------------------------------------------

rhtyd closed pull request #2028: CLOUDSTACK-9853: Add support for Secondary IPv6 Addresses and Subnets
URL: https://github.com/apache/cloudstack/pull/2028
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/api/src/com/cloud/vm/NicSecondaryIp.java b/api/src/com/cloud/vm/NicSecondaryIp.java
index fb90dd351f6..b7d3668c3e2 100644
--- a/api/src/com/cloud/vm/NicSecondaryIp.java
+++ b/api/src/com/cloud/vm/NicSecondaryIp.java
@@ -34,6 +34,8 @@
 
     String getIp4Address();
 
+    String getIp6Address();
+
     long getNetworkId();
 
     long getVmId();
diff --git a/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java b/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
index fe4ac1cdc2e..47da7f816bb 100644
--- a/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
+++ b/core/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
@@ -35,7 +35,7 @@
 public class SecurityGroupRulesCmd extends Command {
     private static final String CIDR_LENGTH_SEPARATOR = "/";
     private static final char RULE_TARGET_SEPARATOR = ',';
-    private static final char RULE_COMMAND_SEPARATOR = ':';
+    private static final char RULE_COMMAND_SEPARATOR = ';';
     protected static final String EGRESS_RULE = "E:";
     protected static final String INGRESS_RULE = "I:";
     private static final Logger LOGGER = Logger.getLogger(SecurityGroupRulesCmd.class);
diff --git a/core/test/com/cloud/agent/api/SecurityGroupRulesCmdTest.java b/core/test/com/cloud/agent/api/SecurityGroupRulesCmdTest.java
index aba24608241..50c82a76455 100644
--- a/core/test/com/cloud/agent/api/SecurityGroupRulesCmdTest.java
+++ b/core/test/com/cloud/agent/api/SecurityGroupRulesCmdTest.java
@@ -86,7 +86,7 @@ public void testStringifyCompressedRules() throws Exception {
      */
     @Test
     public void testCompressStringifiedRules() throws Exception {
-        final String compressed = "eJzztEpMSrYytDKyMtQz0jPWM9E31THTM9ez0LPUN9Dxc40IUXAlrAQAPdoP3Q==";
+        final String compressed = "eJzztEpMSrY2tDayNtQz0jPWM9E31THTM9ez0LPUN9Dxc40IUXAlrAQAPusP4w==";
         final String a = securityGroupRulesCmd.compressStringifiedRules();
         assertTrue(compressed.equals(a));
     }
diff --git a/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpDaoImpl.java
index 8cd61953a73..6ae9b1534cd 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpDaoImpl.java
@@ -20,6 +20,7 @@
 import java.util.List;
 
 
+import com.cloud.utils.StringUtils;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -106,7 +107,13 @@ protected NicSecondaryIpDaoImpl() {
         List<NicSecondaryIpVO> results = search(sc, null);
         List<String> ips = new ArrayList<String>(results.size());
         for (NicSecondaryIpVO result : results) {
-            ips.add(result.getIp4Address());
+            if (StringUtils.isNotBlank(result.getIp4Address())) {
+                ips.add(result.getIp4Address());
+            }
+
+            if (StringUtils.isNotBlank(result.getIp6Address())) {
+                ips.add(result.getIp6Address());
+            }
         }
         return ips;
     }
diff --git a/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java b/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java
index f8730aac5d2..23e45e8a235 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java
@@ -42,6 +42,16 @@ public NicSecondaryIpVO(long nicId, String ipaddr, long vmId, long accountId, lo
         this.networkId = networkId;
     }
 
+    public NicSecondaryIpVO(long nicId, String ip4Address, String ip6Address, long vmId, long accountId, long domainId, long networkId) {
+        this.nicId = nicId;
+        this.vmId = vmId;
+        this.ip4Address = ip4Address;
+        this.ip6Address = ip6Address;
+        this.accountId = accountId;
+        this.domainId = domainId;
+        this.networkId = networkId;
+    }
+
     protected NicSecondaryIpVO() {
     }
 
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java
index 198b95dd237..5a75f078f9e 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java
@@ -102,11 +102,11 @@ public Answer execute(final StartCommand command, final LibvirtComputingResource
                         final StringBuilder sb = new StringBuilder();
                         if (nicSecIps != null) {
                             for (final String ip : nicSecIps) {
-                                sb.append(ip).append(":");
+                                sb.append(ip).append(";");
                             }
                             secIpsStr = sb.toString();
                         } else {
-                            secIpsStr = "0:";
+                            secIpsStr = "0;";
                         }
                         libvirtComputingResource.defaultNetworkRules(conn, vmName, nic, vmSpec.getId(), secIpsStr);
                     }
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixStartCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixStartCommandWrapper.java
index 073f00096b0..0c4a354d1f0 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixStartCommandWrapper.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixStartCommandWrapper.java
@@ -179,11 +179,11 @@ public Answer execute(final StartCommand command, final CitrixResourceBase citri
                             final StringBuilder sb = new StringBuilder();
                             if (nicSecIps != null) {
                                 for (final String ip : nicSecIps) {
-                                    sb.append(ip).append(":");
+                                    sb.append(ip).append(";");
                                 }
                                 secIpsStr = sb.toString();
                             } else {
-                                secIpsStr = "0:";
+                                secIpsStr = "0;";
                             }
                             result = citrixResourceBase.callHostPlugin(conn, "vmops", "default_network_rules", "vmName", vmName, "vmIP", nic.getIp(), "vmMAC", nic.getMac(),
                                     "vmID", Long.toString(vmSpec.getId()), "secIps", secIpsStr);
@@ -222,4 +222,4 @@ public Answer execute(final StartCommand command, final CitrixResourceBase citri
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops
index 93d2af21d87..58ee03097be 100755
--- a/scripts/vm/hypervisor/xenserver/vmops
+++ b/scripts/vm/hypervisor/xenserver/vmops
@@ -802,7 +802,7 @@ def default_network_rules(session, args):
 
     #add secodnary nic ips to ipset
     secIpSet = "1"
-    ips = sec_ips.split(':')
+    ips = sec_ips.split(';')
     ips.pop()
     if ips[0] == "0":
         secIpSet = "0";
diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py
index 0e815650bd6..c53fab8f142 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -481,7 +481,7 @@ def default_network_rules(vm_name, vm_id, vm_ip, vm_ip6, vm_mac, vif, brname, se
 
     #add secodnary nic ips to ipset
     secIpSet = "1"
-    ips = sec_ips.split(':')
+    ips = sec_ips.split(';')
     ips.pop()
     if ips[0] == "0":
         secIpSet = "0";


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> IPv6 Prefix Delegation support in Basic Networking
> --------------------------------------------------
>
>                 Key: CLOUDSTACK-9853
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9853
>             Project: CloudStack
>          Issue Type: New Feature
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: KVM, Management Server
>            Reporter: Wido den Hollander
>            Assignee: Wido den Hollander
>              Labels: basic-networking, dhcp, dhcpv6, ipv6, virtual-router
>
> In addition to have a single IPv6 address (/128) Instances in Basic Networking should be able to have a IPv6 subnet, like a /60 for example routed to them.
> The mechanism for this is DHCPv6 Prefix Delegation. A DHCPv6 server can tell the Instance which subnet is routed to it.
> On the physical router a (static) route needs to be configured to do this. So in Basic Networking it will be up to the network admin to make sure the routes are present.
> The Management Server will pick a subnet for a Instance when needed and configure the VR with the proper DHCPv6 arguments so that the right answer is provided to the Instance.
> For example when running containers it is very nice to have a subnet routed to your Instance so you can give each container a unique IPv6 address.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)