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 @@ public interface NicSecondaryIp extends ControlledEntity, Identity, InternalIden 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 @@ import com.cloud.utils.net.NetUtils; 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 class SecurityGroupRulesCmdTest { */ @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 4b04ff01a6d..50733de002d 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.ArrayList; import java.util.List; +import com.cloud.utils.StringUtils; import org.springframework.stereotype.Component; import com.cloud.utils.db.GenericDaoBase; @@ -106,7 +107,13 @@ public class NicSecondaryIpDaoImpl extends GenericDaoBase results = search(sc, null); List ips = new ArrayList(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 class NicSecondaryIpVO implements NicSecondaryIp { 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 final class LibvirtStartCommandWrapper extends CommandWrapper