cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [2/4] git commit: updated refs/heads/master to ef783d9
Date Wed, 19 Aug 2015 05:21:29 GMT
Refactored Nic.java for readability.

Changed methodnames according to Nic.java refactor.

Fixed NicVO.java due to regression from Nic.java refactor.

Fixed VmWareGuru.java after Nic.java refactor.

See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c30ba1df
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c30ba1df
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c30ba1df

Branch: refs/heads/master
Commit: c30ba1df0bd29cbb933bdeabcae3759111542f9e
Parents: 5db3371
Author: Boris Schrijver <boris@pcextreme.nl>
Authored: Mon Aug 17 16:20:51 2015 +0200
Committer: Boris Schrijver <boris@pcextreme.nl>
Committed: Tue Aug 18 14:04:48 2015 +0200

----------------------------------------------------------------------
 api/src/com/cloud/vm/Nic.java                   | 28 +++---
 api/src/com/cloud/vm/NicProfile.java            | 18 ++--
 .../orchestration/NetworkOrchestrator.java      | 14 +--
 .../orchestration/NetworkOrchestratorTest.java  | 16 ++--
 engine/schema/src/com/cloud/vm/NicVO.java       | 50 +++++------
 .../schema/src/com/cloud/vm/dao/NicDaoImpl.java | 10 +--
 .../src/com/cloud/vm/dao/UserVmDaoImpl.java     |  8 +-
 .../BareMetalPingServiceImpl.java               |  6 +-
 .../BaremetalKickStartServiceImpl.java          | 44 +++++-----
 .../networkservice/BaremetalPxeManagerImpl.java |  2 +-
 .../com/cloud/hypervisor/guru/VMwareGuru.java   | 11 ++-
 .../network/bigswitch/BigSwitchBcfUtils.java    |  2 +-
 .../lb/InternalLoadBalancerVMManagerImpl.java   |  8 +-
 .../contrail/model/VMInterfaceModel.java        | 15 ++--
 .../contrail/model/InstanceIpModelTest.java     | 26 +++---
 .../contrail/model/VMInterfaceModelTest.java    | 25 +++---
 .../network/guru/NuageVspGuestNetworkGuru.java  | 12 +--
 .../cloud/network/ovs/OvsTunnelManagerImpl.java |  7 +-
 server/src/com/cloud/api/ApiResponseHelper.java | 10 +--
 .../ha/ManagementIPSystemVMInvestigator.java    |  4 +-
 .../com/cloud/ha/UserVmDomRInvestigator.java    |  4 +-
 .../network/ExternalDeviceUsageManagerImpl.java |  9 +-
 .../ExternalFirewallDeviceManagerImpl.java      |  5 +-
 .../ExternalLoadBalancerDeviceManagerImpl.java  | 15 ++--
 .../com/cloud/network/IpAddressManagerImpl.java |  4 +-
 .../src/com/cloud/network/NetworkModelImpl.java | 25 +++---
 .../com/cloud/network/NetworkServiceImpl.java   | 90 ++++++++++----------
 .../cloud/network/guru/DirectNetworkGuru.java   |  8 +-
 .../network/guru/DirectPodBasedNetworkGuru.java |  4 +-
 .../network/guru/ExternalGuestNetworkGuru.java  |  4 +-
 .../lb/LoadBalancingRulesManagerImpl.java       | 16 ++--
 .../network/router/CommandSetupHelper.java      | 18 ++--
 .../cloud/network/router/NetworkHelperImpl.java | 12 +--
 .../network/router/RouterControlHelper.java     |  2 +-
 .../VirtualNetworkApplianceManagerImpl.java     | 12 +--
 .../VpcVirtualNetworkApplianceManagerImpl.java  | 14 +--
 .../cloud/network/rules/DhcpSubNetRules.java    |  2 +-
 .../cloud/network/rules/RulesManagerImpl.java   | 17 ++--
 .../security/SecurityGroupManagerImpl.java      |  7 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java  | 28 +++---
 .../network/router/RouterControlHelperTest.java |  6 +-
 41 files changed, 306 insertions(+), 312 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/api/src/com/cloud/vm/Nic.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/Nic.java b/api/src/com/cloud/vm/Nic.java
index 0517219..7b8e27f 100644
--- a/api/src/com/cloud/vm/Nic.java
+++ b/api/src/com/cloud/vm/Nic.java
@@ -115,14 +115,8 @@ public interface Nic extends Identity, InternalIdentity {
 
     boolean isDefaultNic();
 
-    String getIp4Address();
-
     String getMacAddress();
 
-    String getNetmask();
-
-    String getGateway();
-
     /**
      * @return network profile id that this
      */
@@ -145,11 +139,25 @@ public interface Nic extends Identity, InternalIdentity {
 
     AddressFormat getAddressFormat();
 
-    String getIp6Gateway();
+    boolean getSecondaryIp();
 
-    String getIp6Cidr();
+    //
+    // IPv4
+    //
 
-    String getIp6Address();
+    String getIPv4Address();
 
-    boolean getSecondaryIp();
+    String getIPv4Netmask();
+
+    String getIPv4Gateway();
+
+    //
+    // IPv6
+    //
+
+    String getIPv6Gateway();
+
+    String getIPv6Cidr();
+
+    String getIPv6Address();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/api/src/com/cloud/vm/NicProfile.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/NicProfile.java b/api/src/com/cloud/vm/NicProfile.java
index 717054a..3f8884e 100644
--- a/api/src/com/cloud/vm/NicProfile.java
+++ b/api/src/com/cloud/vm/NicProfile.java
@@ -83,13 +83,13 @@ public class NicProfile implements InternalIdentity, Serializable {
         trafficType = network.getTrafficType();
         format = nic.getAddressFormat();
 
-        ipv4Address = nic.getIp4Address();
-        ipv4Netmask = nic.getNetmask();
-        ipv4Gateway = nic.getGateway();
+        ipv4Address = nic.getIPv4Address();
+        ipv4Netmask = nic.getIPv4Netmask();
+        ipv4Gateway = nic.getIPv4Gateway();
 
-        ipv6Address = nic.getIp6Address();
-        ipv6Gateway = nic.getIp6Gateway();
-        ipv6Cidr = nic.getIp6Cidr();
+        ipv6Address = nic.getIPv6Address();
+        ipv6Gateway = nic.getIPv6Gateway();
+        ipv6Cidr = nic.getIPv6Cidr();
 
         macAddress = nic.getMacAddress();
         reservationId = nic.getReservationId();
@@ -114,11 +114,11 @@ public class NicProfile implements InternalIdentity, Serializable {
         this.requestedIPv6 = requestedIPv6;
     }
 
-    public NicProfile(ReservationStrategy strategy, String ipv4Address, String macAddress, String gateway, String netmask) {
+    public NicProfile(ReservationStrategy strategy, String ipv4Address, String macAddress, String ipv4gateway, String ipv4netmask) {
         format = AddressFormat.Ip4;
         this.ipv4Address = ipv4Address;
-        this.ipv4Gateway = gateway;
-        this.ipv4Netmask = netmask;
+        this.ipv4Gateway = ipv4gateway;
+        this.ipv4Netmask = ipv4netmask;
         this.macAddress = macAddress;
         this.strategy = strategy;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index af5fc7f..a12540d 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -892,13 +892,13 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         to.setDeviceId(nic.getDeviceId());
         to.setBroadcastType(config.getBroadcastDomainType());
         to.setType(config.getTrafficType());
-        to.setIp(nic.getIp4Address());
-        to.setNetmask(nic.getNetmask());
+        to.setIp(nic.getIPv4Address());
+        to.setNetmask(nic.getIPv4Netmask());
         to.setMac(nic.getMacAddress());
         to.setDns1(profile.getIPv4Dns1());
         to.setDns2(profile.getIPv4Dns2());
-        if (nic.getGateway() != null) {
-            to.setGateway(nic.getGateway());
+        if (nic.getIPv4Gateway() != null) {
+            to.setGateway(nic.getIPv4Gateway());
         } else {
             to.setGateway(config.getGateway());
         }
@@ -1741,7 +1741,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     }
 
     private boolean isLastNicInSubnet(NicVO nic) {
-        if (_nicDao.listByNetworkIdTypeAndGatewayAndBroadcastUri(nic.getNetworkId(), VirtualMachine.Type.User, nic.getGateway(), nic.getBroadcastUri()).size() > 1) {
+        if (_nicDao.listByNetworkIdTypeAndGatewayAndBroadcastUri(nic.getNetworkId(), VirtualMachine.Type.User, nic.getIPv4Gateway(), nic.getBroadcastUri()).size() > 1) {
             return false;
         }
         return true;
@@ -1753,7 +1753,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         Network network = _networksDao.findById(nic.getNetworkId());
         DhcpServiceProvider dhcpServiceProvider = getDhcpServiceProvider(network);
         try {
-            final NicIpAliasVO ipAlias = _nicIpAliasDao.findByGatewayAndNetworkIdAndState(nic.getGateway(), network.getId(), NicIpAlias.state.active);
+            final NicIpAliasVO ipAlias = _nicIpAliasDao.findByGatewayAndNetworkIdAndState(nic.getIPv4Gateway(), network.getId(), NicIpAlias.state.active);
             if (ipAlias != null) {
                 ipAlias.setState(NicIpAlias.state.revoked);
                 Transaction.execute(new TransactionCallbackNoReturn() {
@@ -3118,7 +3118,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
             String ipAddress = requested.getIPv4Address();
             NicVO nicVO = _nicDao.findByNetworkIdInstanceIdAndBroadcastUri(network.getId(), vm.getId(), broadcastUri);
             if (nicVO != null) {
-                if (ipAddress == null || nicVO.getIp4Address().equals(ipAddress)) {
+                if (ipAddress == null || nicVO.getIPv4Address().equals(ipAddress)) {
                     nic = _networkModel.getNicProfile(vm, network.getId(), broadcastUri);
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java b/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java
index 04233df..2d15403 100644
--- a/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java
+++ b/engine/orchestration/test/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java
@@ -17,44 +17,42 @@
 package org.apache.cloudstack.engine.orchestration;
 
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.ArrayList;
 import java.util.Map;
 
-import junit.framework.TestCase;
-
 import org.apache.log4j.Logger;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Matchers;
 
 import com.cloud.network.Network;
-
-import com.cloud.network.NetworkModel;
 import com.cloud.network.Network.GuestType;
 import com.cloud.network.Network.Service;
+import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.NetworkServiceMapDao;
 import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.element.DhcpServiceProvider;
 import com.cloud.network.guru.NetworkGuru;
-
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.VirtualMachine.Type;
+import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.NicIpAliasDao;
 import com.cloud.vm.dao.NicSecondaryIpDao;
 
+import junit.framework.TestCase;
+
 /**
  * NetworkManagerImpl implements NetworkManager.
  */
@@ -106,7 +104,7 @@ public class NetworkOrchestratorTest extends TestCase {
         when(testOrchastrator._networkModel.areServicesSupportedInNetwork(network.getId(), Service.Dhcp)).thenReturn(true);
         when(network.getTrafficType()).thenReturn(TrafficType.Guest);
         when(network.getGuestType()).thenReturn(GuestType.Shared);
-        when(testOrchastrator._nicDao.listByNetworkIdTypeAndGatewayAndBroadcastUri(nic.getNetworkId(), VirtualMachine.Type.User, nic.getGateway(), nic.getBroadcastUri())).thenReturn(new ArrayList<NicVO>());
+        when(testOrchastrator._nicDao.listByNetworkIdTypeAndGatewayAndBroadcastUri(nic.getNetworkId(), VirtualMachine.Type.User, nic.getIPv4Gateway(), nic.getBroadcastUri())).thenReturn(new ArrayList<NicVO>());
 
 
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/engine/schema/src/com/cloud/vm/NicVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/NicVO.java b/engine/schema/src/com/cloud/vm/NicVO.java
index 2865cc8..febb25c 100644
--- a/engine/schema/src/com/cloud/vm/NicVO.java
+++ b/engine/schema/src/com/cloud/vm/NicVO.java
@@ -48,13 +48,13 @@ public class NicVO implements Nic {
     Long instanceId;
 
     @Column(name = "ip4_address")
-    String ip4Address;
+    String iPv4Address;
 
     @Column(name = "ip6_address")
-    String ip6Address;
+    String iPv6Address;
 
     @Column(name = "netmask")
-    String netmask;
+    String iPv4Netmask;
 
     @Column(name = "isolation_uri")
     URI isolationUri;
@@ -66,7 +66,7 @@ public class NicVO implements Nic {
     URI broadcastUri;
 
     @Column(name = "gateway")
-    String gateway;
+    String iPv4Gateway;
 
     @Column(name = "mac_address")
     String macAddress;
@@ -98,10 +98,10 @@ public class NicVO implements Nic {
     boolean defaultNic;
 
     @Column(name = "ip6_gateway")
-    String ip6Gateway;
+    String iPv6Gateway;
 
     @Column(name = "ip6_cidr")
-    String ip6Cidr;
+    String iPv6Cidr;
 
     @Column(name = "strategy")
     @Enumerated(value = EnumType.STRING)
@@ -132,12 +132,12 @@ public class NicVO implements Nic {
     }
 
     @Override
-    public String getIp4Address() {
-        return ip4Address;
+    public String getIPv4Address() {
+        return iPv4Address;
     }
 
     public void setIp4Address(String address) {
-        ip4Address = address;
+        iPv4Address = address;
     }
 
     @Override
@@ -164,26 +164,26 @@ public class NicVO implements Nic {
     }
 
     @Override
-    public String getIp6Address() {
-        return ip6Address;
+    public String getIPv6Address() {
+        return iPv6Address;
     }
 
     public void setIp6Address(String ip6Address) {
-        this.ip6Address = ip6Address;
+        this.iPv6Address = ip6Address;
     }
 
     @Override
-    public String getNetmask() {
-        return netmask;
+    public String getIPv4Netmask() {
+        return iPv4Netmask;
     }
 
     @Override
-    public String getGateway() {
-        return gateway;
+    public String getIPv4Gateway() {
+        return iPv4Gateway;
     }
 
     public void setGateway(String gateway) {
-        this.gateway = gateway;
+        this.iPv4Gateway = gateway;
     }
 
     @Override
@@ -196,7 +196,7 @@ public class NicVO implements Nic {
     }
 
     public void setNetmask(String netmask) {
-        this.netmask = netmask;
+        this.iPv4Netmask = netmask;
     }
 
     @Override
@@ -322,7 +322,7 @@ public class NicVO implements Nic {
             .append("-")
             .append(reservationId)
             .append("-")
-            .append(ip4Address)
+            .append(iPv4Address)
             .append("]")
             .toString();
     }
@@ -342,21 +342,21 @@ public class NicVO implements Nic {
     }
 
     @Override
-    public String getIp6Gateway() {
-        return ip6Gateway;
+    public String getIPv6Gateway() {
+        return iPv6Gateway;
     }
 
     public void setIp6Gateway(String ip6Gateway) {
-        this.ip6Gateway = ip6Gateway;
+        this.iPv6Gateway = ip6Gateway;
     }
 
     @Override
-    public String getIp6Cidr() {
-        return ip6Cidr;
+    public String getIPv6Cidr() {
+        return iPv6Cidr;
     }
 
     public void setIp6Cidr(String ip6Cidr) {
-        this.ip6Cidr = ip6Cidr;
+        this.iPv6Cidr = ip6Cidr;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java
index 1e78262..da89b2c 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java
@@ -59,9 +59,9 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
         AllFieldsSearch = createSearchBuilder();
         AllFieldsSearch.and("instance", AllFieldsSearch.entity().getInstanceId(), Op.EQ);
         AllFieldsSearch.and("network", AllFieldsSearch.entity().getNetworkId(), Op.EQ);
-        AllFieldsSearch.and("gateway", AllFieldsSearch.entity().getGateway(), Op.EQ);
+        AllFieldsSearch.and("gateway", AllFieldsSearch.entity().getIPv4Gateway(), Op.EQ);
         AllFieldsSearch.and("vmType", AllFieldsSearch.entity().getVmType(), Op.EQ);
-        AllFieldsSearch.and("address", AllFieldsSearch.entity().getIp4Address(), Op.EQ);
+        AllFieldsSearch.and("address", AllFieldsSearch.entity().getIPv4Address(), Op.EQ);
         AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().isDefaultNic(), Op.EQ);
         AllFieldsSearch.and("broadcastUri", AllFieldsSearch.entity().getBroadcastUri(), Op.EQ);
         AllFieldsSearch.and("secondaryip", AllFieldsSearch.entity().getSecondaryIp(), Op.EQ);
@@ -70,9 +70,9 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
         AllFieldsSearch.done();
 
         IpSearch = createSearchBuilder(String.class);
-        IpSearch.select(null, Func.DISTINCT, IpSearch.entity().getIp4Address());
+        IpSearch.select(null, Func.DISTINCT, IpSearch.entity().getIPv4Address());
         IpSearch.and("network", IpSearch.entity().getNetworkId(), Op.EQ);
-        IpSearch.and("address", IpSearch.entity().getIp4Address(), Op.NNULL);
+        IpSearch.and("address", IpSearch.entity().getIPv4Address(), Op.NNULL);
         IpSearch.done();
 
         NonReleasedSearch = createSearchBuilder();
@@ -216,7 +216,7 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
         sc.setParameters("instance", instanceId);
         NicVO nicVo = findOneBy(sc);
         if (nicVo != null) {
-            return nicVo.getIp4Address();
+            return nicVo.getIPv4Address();
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
index db028c4..1f2843d 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
@@ -30,12 +30,12 @@ import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import com.cloud.utils.Pair;
 import org.apache.log4j.Logger;
 
 import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.user.Account;
+import com.cloud.utils.Pair;
 import com.cloud.utils.db.Attribute;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.GenericSearchBuilder;
@@ -185,7 +185,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
 
         SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder();
         nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
-        nicSearch.and("ip4Address", nicSearch.entity().getIp4Address(), SearchCriteria.Op.NNULL);
+        nicSearch.and("ip4Address", nicSearch.entity().getIPv4Address(), SearchCriteria.Op.NNULL);
 
         AccountDataCenterVirtualSearch = createSearchBuilder();
         AccountDataCenterVirtualSearch.and("account", AccountDataCenterVirtualSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
@@ -307,8 +307,8 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
             SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder();
             nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
             nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
-            nicSearch.and().op("ip4Address", nicSearch.entity().getIp4Address(), SearchCriteria.Op.NNULL);
-            nicSearch.or("ip6Address", nicSearch.entity().getIp6Address(), SearchCriteria.Op.NNULL);
+            nicSearch.and().op("ip4Address", nicSearch.entity().getIPv4Address(), SearchCriteria.Op.NNULL);
+            nicSearch.or("ip6Address", nicSearch.entity().getIPv6Address(), SearchCriteria.Op.NNULL);
             nicSearch.cp();
 
             UserVmSearch = createSearchBuilder();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java
index 17d3785..5ad48dc 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java
@@ -138,10 +138,10 @@ public class BareMetalPingServiceImpl extends BareMetalPxeServiceBase implements
         HostVO host = _hostDao.findById(hostId);
         DataCenterVO dc = _dcDao.findById(host.getDataCenterId());
         NicVO nic = nics.get(0);
-        String mask = nic.getNetmask();
+        String mask = nic.getIPv4Netmask();
         String mac = nic.getMacAddress();
-        String ip = nic.getIp4Address();
-        String gateway = nic.getGateway();
+        String ip = nic.getIPv4Address();
+        String gateway = nic.getIPv4Gateway();
         String dns = dc.getDns1();
         if (dns == null) {
             dns = dc.getDns2();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
index d6404a6..beffa3e 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
@@ -18,6 +18,24 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package com.cloud.baremetal.networkservice;
 
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd;
+import org.apache.cloudstack.api.AddBaremetalPxeCmd;
+import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand.BootDev;
@@ -61,22 +79,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.NicDao;
-import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd;
-import org.apache.cloudstack.api.AddBaremetalPxeCmd;
-import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.log4j.Logger;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import java.io.File;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 @Local(value = BaremetalPxeService.class)
 public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase implements BaremetalPxeService {
@@ -229,16 +231,16 @@ public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase imple
         List<String> tuple =  parseKickstartUrl(profile);
         String cmd =  String.format("/opt/cloud/bin/prepare_pxe.sh %s %s %s %s %s %s", tuple.get(1), tuple.get(2), profile.getTemplate().getUuid(),
                 String.format("01-%s", nic.getMacAddress().replaceAll(":", "-")).toLowerCase(), tuple.get(0), nic.getMacAddress().toLowerCase());
-        s_logger.debug(String.format("prepare pxe on virtual router[ip:%s], cmd: %s", mgmtNic.getIp4Address(), cmd));
-        Pair<Boolean, String> ret = SshHelper.sshExecute(mgmtNic.getIp4Address(), 3922, "root", getSystemVMKeyFile(), null, cmd);
+        s_logger.debug(String.format("prepare pxe on virtual router[ip:%s], cmd: %s", mgmtNic.getIPv4Address(), cmd));
+        Pair<Boolean, String> ret = SshHelper.sshExecute(mgmtNic.getIPv4Address(), 3922, "root", getSystemVMKeyFile(), null, cmd);
         if (!ret.first()) {
             throw new CloudRuntimeException(String.format("failed preparing PXE in virtual router[id:%s], because %s", vr.getId(), ret.second()));
         }
 
         //String internalServerIp = "10.223.110.231";
-        cmd = String.format("/opt/cloud/bin/baremetal_snat.sh %s %s %s", mgmtNic.getIp4Address(), internalServerIp, mgmtNic.getGateway());
-        s_logger.debug(String.format("prepare SNAT on virtual router[ip:%s], cmd: %s", mgmtNic.getIp4Address(), cmd));
-        ret = SshHelper.sshExecute(mgmtNic.getIp4Address(), 3922, "root", getSystemVMKeyFile(), null, cmd);
+        cmd = String.format("/opt/cloud/bin/baremetal_snat.sh %s %s %s", mgmtNic.getIPv4Address(), internalServerIp, mgmtNic.getIPv4Gateway());
+        s_logger.debug(String.format("prepare SNAT on virtual router[ip:%s], cmd: %s", mgmtNic.getIPv4Address(), cmd));
+        ret = SshHelper.sshExecute(mgmtNic.getIPv4Address(), 3922, "root", getSystemVMKeyFile(), null, cmd);
         if (!ret.first()) {
             throw new CloudRuntimeException(String.format("failed preparing PXE in virtual router[id:%s], because %s", vr.getId(), ret.second()));
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
index f134716..e99292a 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
@@ -193,7 +193,7 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
         String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText();
         String zoneName = _dcDao.findById(vm.getDataCenterId()).getName();
         NicVO nvo = _nicDao.findById(nic.getId());
-        VmDataCommand cmd = new VmDataCommand(nvo.getIp4Address(), vm.getInstanceName(), _ntwkModel.getExecuteInSeqNtwkElmtCmd());
+        VmDataCommand cmd = new VmDataCommand(nvo.getIPv4Address(), vm.getInstanceName(), _ntwkModel.getExecuteInSeqNtwkElmtCmd());
         // if you add new metadata files, also edit systemvm/patches/debian/config/var/www/html/latest/.htaccess
         cmd.addVmData("userdata", "user-data", vm.getUserData());
         cmd.addVmData("metadata", "service-offering", StringUtils.unicodeEscape(serviceOffering));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index 9ac32d4..62d82c2 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -27,8 +27,6 @@ import java.util.UUID;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
 import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
@@ -41,6 +39,7 @@ import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.BackupSnapshotCommand;
 import com.cloud.agent.api.Command;
@@ -267,10 +266,10 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co
                     } catch (InsufficientAddressCapacityException e) {
                         throw new CloudRuntimeException("unable to allocate mac address on network: " + networkId);
                     }
-                    nicTo.setDns1(publicNicProfile.getDns1());
-                    nicTo.setDns2(publicNicProfile.getDns2());
-                    if (publicNicProfile.getGateway() != null) {
-                        nicTo.setGateway(publicNicProfile.getGateway());
+                    nicTo.setDns1(publicNicProfile.getIPv4Dns1());
+                    nicTo.setDns2(publicNicProfile.getIPv4Dns2());
+                    if (publicNicProfile.getIPv4Gateway() != null) {
+                        nicTo.setGateway(publicNicProfile.getIPv4Gateway());
                     } else {
                         nicTo.setGateway(network.getGateway());
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java b/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
index 61f3d48..da409df 100644
--- a/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
+++ b/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
@@ -292,7 +292,7 @@ public class BigSwitchBcfUtils {
                 p.setOwner(BigSwitchBcfApi.getCloudstackInstanceId());
 
                 List<AttachmentData.Attachment.IpAddress> ipList = new ArrayList<AttachmentData.Attachment.IpAddress>();
-                ipList.add(new AttachmentData().getAttachment().new IpAddress(nic.getIp4Address()));
+                ipList.add(new AttachmentData().getAttachment().new IpAddress(nic.getIPv4Address()));
                 p.setIpAddresses(ipList);
 
                 p.setId(nic.getUuid());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
index cce7633..88ab512 100644
--- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
+++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
@@ -480,7 +480,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
             maxconn = offering.getConcurrentConnections().toString();
         }
         final LoadBalancerConfigCommand cmd =
-                new LoadBalancerConfigCommand(lbs, guestNic.getIp4Address(), guestNic.getIp4Address(), internalLbVm.getPrivateIpAddress(), _itMgr.toNicTO(guestNicProfile,
+                new LoadBalancerConfigCommand(lbs, guestNic.getIPv4Address(), guestNic.getIPv4Address(), internalLbVm.getPrivateIpAddress(), _itMgr.toNicTO(guestNicProfile,
                         internalLbVm.getHypervisorType()), internalLbVm.getVpcId(), maxconn, offering.isKeepAliveEnabled());
 
         cmd.lbStatsVisibility = _configDao.getValue(Config.NetworkLBHaproxyStatsVisbility.key());
@@ -489,7 +489,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
         cmd.lbStatsPort = _configDao.getValue(Config.NetworkLBHaproxyStatsPort.key());
 
         cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getInternalLbControlIp(internalLbVm.getId()));
-        cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, guestNic.getIp4Address());
+        cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, guestNic.getIPv4Address());
         cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, internalLbVm.getInstanceName());
         final DataCenterVO dcVo = _dcDao.findById(internalLbVm.getDataCenterId());
         cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString());
@@ -502,7 +502,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
         for (final NicVO nic : nics) {
             final Network ntwk = _ntwkModel.getNetwork(nic.getNetworkId());
             if (ntwk.getTrafficType() == TrafficType.Control) {
-                controlIpAddress = nic.getIp4Address();
+                controlIpAddress = nic.getIPv4Address();
             }
         }
 
@@ -714,7 +714,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
             while (it.hasNext()) {
                 final DomainRouterVO vm = it.next();
                 final Nic nic = _nicDao.findByNtwkIdAndInstanceId(guestNetworkId, vm.getId());
-                if (!nic.getIp4Address().equalsIgnoreCase(requestedGuestIp.addr())) {
+                if (!nic.getIPv4Address().equalsIgnoreCase(requestedGuestIp.addr())) {
                     it.remove();
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VMInterfaceModel.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VMInterfaceModel.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VMInterfaceModel.java
index 49060f1..dbfb969 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VMInterfaceModel.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VMInterfaceModel.java
@@ -19,20 +19,19 @@ package org.apache.cloudstack.network.contrail.model;
 
 import java.io.IOException;
 
-import net.juniper.contrail.api.ApiConnector;
-import net.juniper.contrail.api.types.MacAddressesType;
-import net.juniper.contrail.api.types.VirtualMachineInterface;
-import net.juniper.contrail.api.types.VirtualMachineInterfacePropertiesType;
-
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.network.contrail.management.ContrailManager;
+import org.apache.log4j.Logger;
 
 import com.cloud.exception.InternalErrorException;
 import com.cloud.network.Network;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.VMInstanceVO;
 
+import net.juniper.contrail.api.ApiConnector;
+import net.juniper.contrail.api.types.MacAddressesType;
+import net.juniper.contrail.api.types.VirtualMachineInterface;
+import net.juniper.contrail.api.types.VirtualMachineInterfacePropertiesType;
+
 public class VMInterfaceModel extends ModelObjectBase {
     private static final Logger s_logger = Logger.getLogger(VMInterfaceModel.class);
 
@@ -78,7 +77,7 @@ public class VMInterfaceModel extends ModelObjectBase {
         setProperties(controller, instance, nic);
 
         InstanceIpModel ipModel = getInstanceIp();
-        String ipAddress = nic.getIp4Address();
+        String ipAddress = nic.getIPv4Address();
         if (ipAddress != null) {
             if (ipModel == null) {
                 ipModel = new InstanceIpModel(_vmName, _deviceId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java
index a996900..38b8ea6 100644
--- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java
+++ b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java
@@ -16,33 +16,31 @@
 // under the License.
 
 package org.apache.cloudstack.network.contrail.model;
-import java.util.UUID;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 import java.io.IOException;
+import java.util.UUID;
 
 import org.apache.cloudstack.network.contrail.management.ContrailManagerImpl;
 import org.apache.log4j.Logger;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.anyLong;
-import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.anyString;
+import org.junit.Test;
 
 import com.cloud.network.Network;
 import com.cloud.network.Networks.TrafficType;
-import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.dao.NetworkDao;
+import com.cloud.network.dao.NetworkVO;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.dao.UserVmDao;
 
-import net.juniper.contrail.api.ApiConnectorMock;
-import net.juniper.contrail.api.ApiConnector;
-
-import org.junit.Test;
 import junit.framework.TestCase;
+import net.juniper.contrail.api.ApiConnector;
+import net.juniper.contrail.api.ApiConnectorMock;
 
 public class InstanceIpModelTest extends TestCase {
     private static final Logger s_logger =
@@ -102,7 +100,7 @@ public class InstanceIpModelTest extends TestCase {
 
         // Create Virtual=Machine-Interface (VMInterface)
         NicVO nic = mock(NicVO.class);
-        when(nic.getIp4Address()).thenReturn("10.1.1.2");
+        when(nic.getIPv4Address()).thenReturn("10.1.1.2");
         when(nic.getMacAddress()).thenReturn("00:01:02:03:04:05");
         when(nic.getDeviceId()).thenReturn(100);
         when(nic.getState()).thenReturn(NicVO.State.Allocated);
@@ -128,7 +126,7 @@ public class InstanceIpModelTest extends TestCase {
         }
         InstanceIpModel ipModel = new InstanceIpModel(vm.getInstanceName(), nic.getDeviceId());
         ipModel.addToVMInterface(vmiModel);
-        ipModel.setAddress(nic.getIp4Address());
+        ipModel.setAddress(nic.getIPv4Address());
 
         try {
             ipModel.update(controller);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java
index ebc1f76..391ada5 100644
--- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java
+++ b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java
@@ -16,33 +16,32 @@
 // under the License.
 
 package org.apache.cloudstack.network.contrail.model;
-import java.util.UUID;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import java.io.IOException;
+import java.util.UUID;
 
 import org.apache.cloudstack.network.contrail.management.ContrailManagerImpl;
 import org.apache.log4j.Logger;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.anyLong;
-import static org.mockito.Mockito.anyString;
-import static org.mockito.Mockito.anyInt;
+import org.junit.Test;
 
 import com.cloud.network.Network;
 import com.cloud.network.Networks.TrafficType;
-import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.dao.NetworkDao;
+import com.cloud.network.dao.NetworkVO;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.dao.UserVmDao;
 
+import junit.framework.TestCase;
+import net.juniper.contrail.api.ApiConnector;
 import net.juniper.contrail.api.ApiConnectorMock;
 import net.juniper.contrail.api.types.VirtualMachineInterface;
-import net.juniper.contrail.api.ApiConnector;
-
-import org.junit.Test;
-import junit.framework.TestCase;
 
 public class VMInterfaceModelTest extends TestCase {
     private static final Logger s_logger =
@@ -103,7 +102,7 @@ public class VMInterfaceModelTest extends TestCase {
 
         // Create Virtual=Machine-Interface (VMInterface)
         NicVO nic = mock(NicVO.class);
-        when(nic.getIp4Address()).thenReturn("10.1.1.2");
+        when(nic.getIPv4Address()).thenReturn("10.1.1.2");
         when(nic.getMacAddress()).thenReturn("00:01:02:03:04:05");
         when(nic.getDeviceId()).thenReturn(100);
         when(nic.getState()).thenReturn(NicVO.State.Allocated);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java b/plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
index 6dc1a00..9bbaf40 100644
--- a/plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
+++ b/plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
@@ -288,7 +288,7 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru {
 
         try {
             s_logger.debug("Handling deallocate() call back, which is called when a VM is destroyed or interface is removed, " + "to delete VM Interface with IP "
-                    + nic.getIp4Address() + " from a VM " + vm.getInstanceName() + " with state " + vm.getVirtualMachine().getState());
+                    + nic.getIPv4Address() + " from a VM " + vm.getInstanceName() + " with state " + vm.getVirtualMachine().getState());
             DomainVO networksDomain = _domainDao.findById(network.getDomainId());
             NicVO nicFrmDd = _nicDao.findById(nic.getId());
             long networkOfferingId = _ntwkOfferingDao.findById(network.getNetworkOfferingId()).getId();
@@ -299,7 +299,7 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru {
                 vpcUuid = vpcObj.getUuid();
             }
             HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId());
-            DeallocateVmVspCommand cmd = new DeallocateVmVspCommand(network.getUuid(), nicFrmDd.getUuid(), nic.getMacAddress(), nic.getIp4Address(),
+            DeallocateVmVspCommand cmd = new DeallocateVmVspCommand(network.getUuid(), nicFrmDd.getUuid(), nic.getMacAddress(), nic.getIPv4Address(),
                     isL3Network(networkOfferingId), vpcUuid, networksDomain.getUuid(), vm.getInstanceName(), vm.getUuid());
             DeallocateVmVspAnswer answer = (DeallocateVmVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd);
             if (answer == null || !answer.getResult()) {
@@ -309,7 +309,7 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru {
                 }
             }
         } catch (InsufficientVirtualNetworkCapacityException e) {
-            s_logger.error("Handling deallocate(). VM " + vm.getInstanceName() + " with NIC IP " + nic.getIp4Address()
+            s_logger.error("Handling deallocate(). VM " + vm.getInstanceName() + " with NIC IP " + nic.getIPv4Address()
                     + " is getting destroyed. REST API failed to update the VM state in NuageVsp", e);
         }
         super.deallocate(network, nic, vm);
@@ -383,9 +383,9 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru {
             for (Map<String, String> interfaces : vmInterfacesDetails) {
                 String macFromNuage = interfaces.get("mac");
                 if (StringUtils.equals(macFromNuage, nic.getMacAddress())) {
-                    nic.setIp4Address(interfaces.get("ip4Address"));
-                    nic.setGateway(interfaces.get("gateway"));
-                    nic.setNetmask(interfaces.get("netmask"));
+                    nic.setIPv4Address(interfaces.get("ip4Address"));
+                    nic.setIPv4Gateway(interfaces.get("gateway"));
+                    nic.setIPv4Netmask(interfaces.get("netmask"));
                     break;
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
index 633f5f5..9024abb 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
@@ -27,12 +27,11 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 import javax.persistence.EntityExistsException;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.framework.messagebus.MessageBus;
 import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -805,7 +804,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                 Network network = _networkDao.findById(vmNic.getNetworkId());
                 if (network.getTrafficType() == TrafficType.Guest) {
                     OvsVpcPhysicalTopologyConfigCommand.Nic nic =  new OvsVpcPhysicalTopologyConfigCommand.Nic(
-                            vmNic.getIp4Address(), vmNic.getMacAddress(), network.getUuid());
+                            vmNic.getIPv4Address(), vmNic.getMacAddress(), network.getUuid());
                     vmNics.add(nic);
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 6371023..0a9d9c4 100644
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -3421,7 +3421,7 @@ public class ApiResponseHelper implements ResponseGenerator {
             response.setVmId(vm.getUuid());
         }
 
-        response.setIpaddress(result.getIp4Address());
+        response.setIpaddress(result.getIPv4Address());
 
         if (result.getSecondaryIp()) {
             List<NicSecondaryIpVO> secondaryIps = ApiDBUtils.findNicSecondaryIps(result.getId());
@@ -3437,12 +3437,12 @@ public class ApiResponseHelper implements ResponseGenerator {
             }
         }
 
-        response.setGateway(result.getGateway());
-        response.setNetmask(result.getNetmask());
+        response.setGateway(result.getIPv4Gateway());
+        response.setNetmask(result.getIPv4Netmask());
         response.setMacAddress(result.getMacAddress());
 
-        if (result.getIp6Address() != null) {
-            response.setIp6Address(result.getIp6Address());
+        if (result.getIPv6Address() != null) {
+            response.setIp6Address(result.getIPv6Address());
         }
 
         response.setDeviceId(String.valueOf(result.getDeviceId()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
index 89901d9..9f361b0 100644
--- a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
+++ b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
@@ -71,13 +71,13 @@ public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl {
         }
 
         for (Nic nic : nics) {
-            if (nic.getIp4Address() == null) {
+            if (nic.getIPv4Address() == null) {
                 continue;
             }
             // get the data center IP address, find a host on the pod, use that host to ping the data center IP address
             List<Long> otherHosts = findHostByPod(vmHost.getPodId(), vm.getHostId());
             for (Long otherHost : otherHosts) {
-                Status vmState = testIpAddress(otherHost, nic.getIp4Address());
+                Status vmState = testIpAddress(otherHost, nic.getIPv4Address());
                 assert vmState != null;
                 // In case of Status.Unknown, next host will be tried
                 if (vmState == Status.Up) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/ha/UserVmDomRInvestigator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/UserVmDomRInvestigator.java b/server/src/com/cloud/ha/UserVmDomRInvestigator.java
index 782e4b3..63d9bf0 100644
--- a/server/src/com/cloud/ha/UserVmDomRInvestigator.java
+++ b/server/src/com/cloud/ha/UserVmDomRInvestigator.java
@@ -70,7 +70,7 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl {
         List<? extends Nic> nics = _networkMgr.getNicsForTraffic(userVm.getId(), TrafficType.Guest);
 
         for (Nic nic : nics) {
-            if (nic.getIp4Address() == null) {
+            if (nic.getIPv4Address() == null) {
                 continue;
             }
 
@@ -154,7 +154,7 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl {
     }
 
     private Boolean testUserVM(VirtualMachine vm, Nic nic, VirtualRouter router) {
-        String privateIp = nic.getIp4Address();
+        String privateIp = nic.getIPv4Address();
         String routerPrivateIp = router.getPrivateIpAddress();
 
         List<Long> otherHosts = new ArrayList<Long>();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java b/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
index 67ff773..9e53341 100644
--- a/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
@@ -29,11 +29,10 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.ExternalNetworkResourceUsageAnswer;
@@ -272,7 +271,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
                 if (mapping != null) {
                     NicVO nic = _nicDao.findById(mapping.getNicId());
-                    String loadBalancingIpAddress = nic.getIp4Address();
+                    String loadBalancingIpAddress = nic.getIPv4Address();
                     bytesSentAndReceived = lbAnswer.ipBytes.get(loadBalancingIpAddress);
 
                     if (bytesSentAndReceived != null) {
@@ -542,7 +541,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
                     if (mapping != null) {
                         NicVO nic = _nicDao.findById(mapping.getNicId());
-                        String loadBalancingIpAddress = nic.getIp4Address();
+                        String loadBalancingIpAddress = nic.getIPv4Address();
                         bytesSentAndReceived = answer.ipBytes.get(loadBalancingIpAddress);
 
                         if (bytesSentAndReceived != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
index 1597431..f0d8622 100644
--- a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
@@ -25,13 +25,12 @@ import java.util.Map;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.response.ExternalFirewallResponse;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -545,7 +544,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         if (!add) {
             List<NicVO> nics = _nicDao.listByNetworkId(network.getId());
             for (NicVO nic : nics) {
-                if (nic.getVmType() == null && nic.getReservationStrategy().equals(ReservationStrategy.PlaceHolder) && nic.getIp4Address().equals(network.getGateway())) {
+                if (nic.getVmType() == null && nic.getReservationStrategy().equals(ReservationStrategy.PlaceHolder) && nic.getIPv4Address().equals(network.getGateway())) {
                     s_logger.debug("Removing placeholder nic " + nic + " for the network " + network);
                     _nicDao.remove(nic.getId());
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
index d36c22d..d7ee2b6 100644
--- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
@@ -27,13 +27,12 @@ import java.util.UUID;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.response.ExternalLoadBalancerResponse;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -821,7 +820,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 // On the firewall provider for the network, create a static NAT rule between the source IP
                 // address and the load balancing IP address
                 try {
-                    applyStaticNatRuleForInlineLBRule(zone, network, revoked, srcIp, loadBalancingIpNic.getIp4Address());
+                    applyStaticNatRuleForInlineLBRule(zone, network, revoked, srcIp, loadBalancingIpNic.getIPv4Address());
                 } catch (ResourceUnavailableException ex) {
                     // Rollback db operation
                     _inlineLoadBalancerNicMapDao.expunge(mapping.getId());
@@ -843,7 +842,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 if (count == 0) {
                     // On the firewall provider for the network, delete the static NAT rule between the source IP
                     // address and the load balancing IP address
-                    applyStaticNatRuleForInlineLBRule(zone, network, revoked, srcIp, loadBalancingIpNic.getIp4Address());
+                    applyStaticNatRuleForInlineLBRule(zone, network, revoked, srcIp, loadBalancingIpNic.getIPv4Address());
 
                     // Delete the mapping between the source IP address and the load balancing IP address
                     _inlineLoadBalancerNicMapDao.expunge(mapping.getId());
@@ -914,7 +913,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 }
 
                 // Change the source IP address for the load balancing rule to be the load balancing IP address
-                srcIp = loadBalancingIpNic.getIp4Address();
+                srcIp = loadBalancingIpNic.getIPv4Address();
             }
 
             if ((destinations != null && !destinations.isEmpty()) || rule.isAutoScaleConfig()) {
@@ -1037,7 +1036,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                     + " Either network implement failed half way through or already network shutdown is completed. So just returning.");
                 return true;
             }
-            selfIp = selfipNic.getIp4Address();
+            selfIp = selfipNic.getIPv4Address();
         }
 
         // It's a hack, using isOneToOneNat field for indicate if it's inline or not
@@ -1196,7 +1195,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
 
                 // Change the source IP address for the load balancing rule to
                 // be the load balancing IP address
-                srcIp = loadBalancingIpNic.getIp4Address();
+                srcIp = loadBalancingIpNic.getIPv4Address();
             }
 
             if ((destinations != null && !destinations.isEmpty()) || !rule.isAutoScaleConfig()) {
@@ -1235,7 +1234,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
         for (NicVO guestIp : guestIps) {
             // only external firewall and external load balancer will create NicVO with PlaceHolder reservation strategy
             if (guestIp.getReservationStrategy().equals(ReservationStrategy.PlaceHolder) && guestIp.getVmType() == null && guestIp.getReserver() == null &&
-                !guestIp.getIp4Address().equals(network.getGateway())) {
+                !guestIp.getIPv4Address().equals(network.getGateway())) {
                 return guestIp;
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/IpAddressManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/IpAddressManagerImpl.java b/server/src/com/cloud/network/IpAddressManagerImpl.java
index e1a6825..28df971 100644
--- a/server/src/com/cloud/network/IpAddressManagerImpl.java
+++ b/server/src/com/cloud/network/IpAddressManagerImpl.java
@@ -1853,9 +1853,9 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
                 if (requestedIpv4 != null && vm.getType() == VirtualMachine.Type.DomainRouter) {
                     Nic placeholderNic = _networkModel.getPlaceholderNicForRouter(network, null);
                     if (placeholderNic != null) {
-                        IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), placeholderNic.getIp4Address());
+                        IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), placeholderNic.getIPv4Address());
                         ip = PublicIp.createFromAddrAndVlan(userIp, _vlanDao.findById(userIp.getVlanId()));
-                        s_logger.debug("Nic got an ip address " + placeholderNic.getIp4Address() + " stored in placeholder nic for the network " + network);
+                        s_logger.debug("Nic got an ip address " + placeholderNic.getIPv4Address() + " stored in placeholder nic for the network " + network);
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index 7a85c9d..154e666 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -34,13 +34,11 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import com.cloud.utils.StringUtils;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
 
 import com.cloud.api.ApiDBUtils;
 import com.cloud.configuration.Config;
@@ -105,6 +103,7 @@ import com.cloud.user.AccountManager;
 import com.cloud.user.AccountVO;
 import com.cloud.user.DomainManager;
 import com.cloud.user.dao.AccountDao;
+import com.cloud.utils.StringUtils;
 import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
@@ -827,15 +826,15 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     @Override
     public String getIpInNetwork(long vmId, long networkId) {
         Nic guestNic = getNicInNetwork(vmId, networkId);
-        assert (guestNic != null && guestNic.getIp4Address() != null) : "Vm doesn't belong to network associated with " + "ipAddress or ip4 address is null";
-        return guestNic.getIp4Address();
+        assert (guestNic != null && guestNic.getIPv4Address() != null) : "Vm doesn't belong to network associated with " + "ipAddress or ip4 address is null";
+        return guestNic.getIPv4Address();
     }
 
     @Override
     public String getIpInNetworkIncludingRemoved(long vmId, long networkId) {
         Nic guestNic = getNicInNetworkIncludingRemoved(vmId, networkId);
-        assert (guestNic != null && guestNic.getIp4Address() != null) : "Vm doesn't belong to network associated with " + "ipAddress or ip4 address is null";
-        return guestNic.getIp4Address();
+        assert (guestNic != null && guestNic.getIPv4Address() != null) : "Vm doesn't belong to network associated with " + "ipAddress or ip4 address is null";
+        return guestNic.getIPv4Address();
     }
 
     @Override
@@ -942,7 +941,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
         NicVO networkElementNic = _nicDao.findByNetworkIdAndType(virtualNetwork.getId(), Type.DomainRouter);
 
         if (networkElementNic != null) {
-            return networkElementNic.getIp4Address();
+            return networkElementNic.getIPv4Address();
         } else {
             s_logger.warn("Unable to set find network element for the network id=" + virtualNetwork.getId());
             return null;
@@ -2195,20 +2194,20 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     public NicVO getPlaceholderNicForRouter(Network network, Long podId) {
         List<NicVO> nics = _nicDao.listPlaceholderNicsByNetworkIdAndVmType(network.getId(), VirtualMachine.Type.DomainRouter);
         for (NicVO nic : nics) {
-            if (nic.getReserver() == null && (nic.getIp4Address() != null || nic.getIp6Address() != null)) {
+            if (nic.getReserver() == null && (nic.getIPv4Address() != null || nic.getIPv6Address() != null)) {
                 if (podId == null) {
                     return nic;
                 } else {
                     //return nic only when its ip address belong to the pod range (for the Basic zone case)
                     List<? extends Vlan> vlans = _vlanDao.listVlansForPod(podId);
                     for (Vlan vlan : vlans) {
-                        if (nic.getIp4Address() != null) {
-                            IpAddress ip = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), nic.getIp4Address());
+                        if (nic.getIPv4Address() != null) {
+                            IpAddress ip = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), nic.getIPv4Address());
                             if (ip != null && ip.getVlanId() == vlan.getId()) {
                                 return nic;
                             }
                         } else {
-                            UserIpv6AddressVO ipv6 = _ipv6Dao.findByNetworkIdAndIp(network.getId(), nic.getIp6Address());
+                            UserIpv6AddressVO ipv6 = _ipv6Dao.findByNetworkIdAndIp(network.getId(), nic.getIPv6Address());
                             if (ipv6 != null && ipv6.getVlanId() == vlan.getId()) {
                                 return nic;
                             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index e47baea..abee178 100644
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -16,6 +16,49 @@
 // under the License.
 package com.cloud.network;
 
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.UnknownHostException;
+import java.security.InvalidParameterException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.UUID;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.acl.SecurityChecker.AccessType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.command.admin.network.CreateNetworkCmdByAdmin;
+import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
+import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd;
+import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
+import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
+import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.framework.messagebus.MessageBus;
+import org.apache.cloudstack.framework.messagebus.PublishScope;
+import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
+import org.apache.log4j.Logger;
+
 import com.cloud.api.ApiDBUtils;
 import com.cloud.configuration.Config;
 import com.cloud.configuration.ConfigurationManager;
@@ -151,49 +194,6 @@ import com.cloud.vm.dao.NicSecondaryIpVO;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
-import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-import org.apache.cloudstack.acl.SecurityChecker.AccessType;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.command.admin.network.CreateNetworkCmdByAdmin;
-import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
-import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd;
-import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
-import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
-import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
-import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
-import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
-import org.apache.cloudstack.context.CallContext;
-import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.cloudstack.framework.messagebus.MessageBus;
-import org.apache.cloudstack.framework.messagebus.PublishScope;
-import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
-import org.apache.log4j.Logger;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.net.URI;
-import java.net.UnknownHostException;
-import java.security.InvalidParameterException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.UUID;
-
 /**
  * NetworkServiceImpl implements NetworkService.
  */
@@ -2185,11 +2185,11 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
                 s_logger.info("The specified guest vm cidr has " +  range + " IPs");
 
                 for (NicVO nic : nicsPresent) {
-                    long nicIp = NetUtils.ip2Long(nic.getIp4Address());
+                    long nicIp = NetUtils.ip2Long(nic.getIPv4Address());
                     //check if nic IP is outside the guest vm cidr
                     if (nicIp < startIp || nicIp > endIp) {
                     if (!(nic.getState() == Nic.State.Deallocating)) {
-                            throw new InvalidParameterValueException("Active IPs like " + nic.getIp4Address() + " exist outside the Guest VM CIDR. Cannot apply reservation ");
+                            throw new InvalidParameterValueException("Active IPs like " + nic.getIPv4Address() + " exist outside the Guest VM CIDR. Cannot apply reservation ");
                             }
                         }
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/guru/DirectNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
index 41718fc..9686f80 100644
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@ -294,7 +294,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
                     public void doInTransactionWithoutResult(TransactionStatus status) {
                         // if the ip address a part of placeholder, don't release it
                         Nic placeholderNic = _networkModel.getPlaceholderNicForRouter(network, null);
-                        if (placeholderNic != null && placeholderNic.getIp4Address().equalsIgnoreCase(ip.getAddress().addr())) {
+                        if (placeholderNic != null && placeholderNic.getIPv4Address().equalsIgnoreCase(ip.getAddress().addr())) {
                             s_logger.debug("Not releasing direct ip " + ip.getId() + " yet as its ip is saved in the placeholder");
                         } else {
                             _ipAddrMgr.markIpAsUnavailable(ip.getId());
@@ -337,9 +337,9 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
                     @Override
                     public void doInTransactionWithoutResult(TransactionStatus status) {
                         for (Nic nic : nics) {
-                            if (nic.getIp4Address() != null) {
-                                s_logger.debug("Releasing ip " + nic.getIp4Address() + " of placeholder nic " + nic);
-                                IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIp4Address());
+                            if (nic.getIPv4Address() != null) {
+                                s_logger.debug("Releasing ip " + nic.getIPv4Address() + " of placeholder nic " + nic);
+                                IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIPv4Address());
                                 if (ip != null) {
                                     _ipAddrMgr.markIpAsUnavailable(ip.getId());
                                     _ipAddressDao.unassignIpAddress(ip.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
index 02292be..26c8015 100644
--- a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
@@ -182,9 +182,9 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
                     if (vm.getType() == VirtualMachine.Type.DomainRouter) {
                         Nic placeholderNic = _networkModel.getPlaceholderNicForRouter(network, pod.getId());
                         if (placeholderNic != null) {
-                            IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), placeholderNic.getIp4Address());
+                            IPAddressVO userIp = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), placeholderNic.getIPv4Address());
                             ip = PublicIp.createFromAddrAndVlan(userIp, _vlanDao.findById(userIp.getVlanId()));
-                            s_logger.debug("Nic got an ip address " + placeholderNic.getIp4Address() + " stored in placeholder nic for the network " + network +
+                            s_logger.debug("Nic got an ip address " + placeholderNic.getIPv4Address() + " stored in placeholder nic for the network " + network +
                                 " and gateway " + podRangeGateway);
                         }
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
index 8562ae3..c0a6ea9 100644
--- a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
@@ -190,8 +190,8 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
         // Mask the Ipv4 address of all nics that use this network with the new guest VLAN offset
         List<NicVO> nicsInNetwork = _nicDao.listByNetworkId(config.getId());
         for (NicVO nic : nicsInNetwork) {
-            if (nic.getIp4Address() != null) {
-                long ipMask = getIpMask(nic.getIp4Address(), cidrSize);
+            if (nic.getIPv4Address() != null) {
+                long ipMask = getIpMask(nic.getIPv4Address(), cidrSize);
                 nic.setIp4Address(NetUtils.long2Ip(newCidrAddress | ipMask));
                 _nicDao.persist(nic);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index 81b9bb1..c03af2d 100644
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -30,11 +30,6 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd;
 import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;
@@ -50,6 +45,7 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationSe
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.lb.ApplicationLoadBalancerRuleVO;
 import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.to.LoadBalancerTO;
 import com.cloud.configuration.ConfigurationManager;
@@ -169,6 +165,8 @@ import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.NicSecondaryIpDao;
 import com.cloud.vm.dao.UserVmDao;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
 
 @Local(value = {LoadBalancingRulesManager.class, LoadBalancingRulesService.class})
 public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements LoadBalancingRulesManager, LoadBalancingRulesService {
@@ -898,7 +896,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
                                     for (LoadBalancerVMMapVO lbVmMap : lbVmMaps) {
                                         UserVm vm = _vmDao.findById(lbVmMap.getInstanceId());
                                         Nic nic = _nicDao.findByInstanceIdAndNetworkIdIncludingRemoved(ulb.getNetworkId(), vm.getId());
-                                        String dstIp = lbVmMap.getInstanceIp() == null ? nic.getIp4Address(): lbVmMap.getInstanceIp();
+                                        String dstIp = lbVmMap.getInstanceIp() == null ? nic.getIPv4Address(): lbVmMap.getInstanceIp();
 
                                         for (int i = 0; i < lbto.getDestinations().length; i++) {
                                             LoadBalancerTO.DestinationTO des = lbto.getDestinations()[i];
@@ -1031,7 +1029,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
                 throw ex;
             }
 
-            String priIp = nicInSameNetwork.getIp4Address();
+            String priIp = nicInSameNetwork.getIPv4Address();
 
             if (existingVmIdIps.containsKey(instanceId)) {
                 // now check for ip address
@@ -2056,7 +2054,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
         for (LoadBalancerVMMapVO lbVmMap : lbVmMaps) {
             UserVm vm = _vmDao.findById(lbVmMap.getInstanceId());
             Nic nic = _nicDao.findByInstanceIdAndNetworkIdIncludingRemoved(lb.getNetworkId(), vm.getId());
-            dstIp = lbVmMap.getInstanceIp() == null ? nic.getIp4Address(): lbVmMap.getInstanceIp();
+            dstIp = lbVmMap.getInstanceIp() == null ? nic.getIPv4Address(): lbVmMap.getInstanceIp();
             LbDestination lbDst = new LbDestination(lb.getDefaultPortStart(), lb.getDefaultPortEnd(), dstIp, lbVmMap.isRevoke());
             dstList.add(lbDst);
         }
@@ -2465,7 +2463,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
         for (LoadBalancerVMMapVO lbVmMap : lbVmMaps) {
             UserVm vm = _vmDao.findById(lbVmMap.getInstanceId());
             Nic nic = _nicDao.findByInstanceIdAndNetworkIdIncludingRemoved(lb.getNetworkId(), vm.getId());
-            Ip ip = new Ip(nic.getIp4Address());
+            Ip ip = new Ip(nic.getIPv4Address());
             dstList.put(ip, vm);
         }
         return dstList;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30ba1df/server/src/com/cloud/network/router/CommandSetupHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/CommandSetupHelper.java b/server/src/com/cloud/network/router/CommandSetupHelper.java
index 30af056..f701218 100644
--- a/server/src/com/cloud/network/router/CommandSetupHelper.java
+++ b/server/src/com/cloud/network/router/CommandSetupHelper.java
@@ -191,7 +191,7 @@ public class CommandSetupHelper {
         final String zoneName = _dcDao.findById(router.getDataCenterId()).getName();
         cmds.addCommand(
                 "vmdata",
-                generateVmDataCommand(router, nic.getIp4Address(), vm.getUserData(), serviceOffering, zoneName, nic.getIp4Address(), vm.getHostName(), vm.getInstanceName(),
+                generateVmDataCommand(router, nic.getIPv4Address(), vm.getUserData(), serviceOffering, zoneName, nic.getIPv4Address(), vm.getHostName(), vm.getInstanceName(),
                         vm.getId(), vm.getUuid(), publicKey, nic.getNetworkId()));
     }
 
@@ -217,10 +217,10 @@ public class CommandSetupHelper {
     }
 
     public void createDhcpEntryCommand(final VirtualRouter router, final UserVm vm, final NicVO nic, final Commands cmds) {
-        final DhcpEntryCommand dhcpCommand = new DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), vm.getHostName(), nic.getIp6Address(),
+        final DhcpEntryCommand dhcpCommand = new DhcpEntryCommand(nic.getMacAddress(), nic.getIPv4Address(), vm.getHostName(), nic.getIPv6Address(),
                 _networkModel.getExecuteInSeqNtwkElmtCmd());
 
-        String gatewayIp = nic.getGateway();
+        String gatewayIp = nic.getIPv4Gateway();
         if (!nic.isDefaultNic()) {
             final GuestOSVO guestOS = _guestOSDao.findById(vm.getGuestOSId());
             if (guestOS == null || !guestOS.getDisplayName().toLowerCase().contains("windows")) {
@@ -231,11 +231,11 @@ public class CommandSetupHelper {
         final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
 
         dhcpCommand.setDefaultRouter(gatewayIp);
-        dhcpCommand.setIp6Gateway(nic.getIp6Gateway());
+        dhcpCommand.setIp6Gateway(nic.getIPv6Gateway());
         String ipaddress = null;
         final NicVO domrDefaultNic = findDefaultDnsIp(vm.getId());
         if (domrDefaultNic != null) {
-            ipaddress = domrDefaultNic.getIp4Address();
+            ipaddress = domrDefaultNic.getIPv4Address();
         }
         dhcpCommand.setDefaultDns(ipaddress);
         dhcpCommand.setDuid(NetUtils.getDuidLL(nic.getMacAddress()));
@@ -268,13 +268,13 @@ public class CommandSetupHelper {
         final List<DhcpTO> ipList = new ArrayList<DhcpTO>();
 
         final NicVO router_guest_nic = _nicDao.findByNtwkIdAndInstanceId(network.getId(), router.getId());
-        final String cidr = NetUtils.getCidrFromGatewayAndNetmask(router_guest_nic.getGateway(), router_guest_nic.getNetmask());
+        final String cidr = NetUtils.getCidrFromGatewayAndNetmask(router_guest_nic.getIPv4Gateway(), router_guest_nic.getIPv4Netmask());
         final String[] cidrPair = cidr.split("\\/");
         final String cidrAddress = cidrPair[0];
         final long cidrSize = Long.parseLong(cidrPair[1]);
         final String startIpOfSubnet = NetUtils.getIpRangeStartIpFromCidr(cidrAddress, cidrSize);
 
-        ipList.add(new DhcpTO(router_guest_nic.getIp4Address(), router_guest_nic.getGateway(), router_guest_nic.getNetmask(), startIpOfSubnet));
+        ipList.add(new DhcpTO(router_guest_nic.getIPv4Address(), router_guest_nic.getIPv4Gateway(), router_guest_nic.getIPv4Netmask(), startIpOfSubnet));
         for (final NicIpAliasVO ipAliasVO : ipAliasVOList) {
             final DhcpTO DhcpTO = new DhcpTO(ipAliasVO.getIp4Address(), ipAliasVO.getGateway(), ipAliasVO.getNetmask(), ipAliasVO.getStartIpOfSubnet());
             if (s_logger.isTraceEnabled()) {
@@ -523,7 +523,7 @@ public class CommandSetupHelper {
 
         // password should be set only on default network element
         if (password != null && nic.isDefaultNic()) {
-            final SavePasswordCommand cmd = new SavePasswordCommand(password, nic.getIp4Address(), profile.getVirtualMachine().getHostName(),
+            final SavePasswordCommand cmd = new SavePasswordCommand(password, nic.getIPv4Address(), profile.getVirtualMachine().getHostName(),
                     _networkModel.getExecuteInSeqNtwkElmtCmd());
             cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));
             cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, _routerControlHelper.getRouterIpInNetwork(nic.getNetworkId(), router.getId()));
@@ -1022,7 +1022,7 @@ public class CommandSetupHelper {
         // find domR's nic in the network
         NicVO domrDefaultNic;
         if (isZoneBasic) {
-            domrDefaultNic = _nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter, defaultNic.getGateway());
+            domrDefaultNic = _nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter, defaultNic.getIPv4Gateway());
         } else {
             domrDefaultNic = _nicDao.findByNetworkIdAndType(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter);
         }


Mime
View raw message