cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [3/4] git commit: updated refs/heads/master to bc51a42
Date Mon, 17 Aug 2015 13:24:53 GMT
Refactored NicProfile.java for readability.

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/5db33718
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5db33718
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5db33718

Branch: refs/heads/master
Commit: 5db337184057193001056f46e178836e6be2d6fd
Parents: caa524b
Author: Boris Schrijver <boris@pcextreme.nl>
Authored: Mon Aug 17 14:12:10 2015 +0200
Committer: Boris Schrijver <boris@pcextreme.nl>
Committed: Mon Aug 17 14:12:10 2015 +0200

----------------------------------------------------------------------
 api/src/com/cloud/vm/NicProfile.java            | 443 ++++++++++---------
 .../orchestration/NetworkOrchestrator.java      |  57 ++-
 .../BareMetalPingServiceImpl.java               |  17 +-
 .../networkservice/BaremetaNetworkGuru.java     |  35 +-
 .../BaremetalDhcpManagerImpl.java               |  36 +-
 .../networkservice/BaremetalPxeManagerImpl.java |   9 +-
 .../hypervisor/hyperv/guru/HypervGuru.java      |  14 +-
 .../network/element/BigSwitchBcfElement.java    |   2 +-
 .../guru/BigSwitchBcfGuestNetworkGuru.java      |   2 +-
 .../cloudstack/network/element/DnsNotifier.java |   8 +-
 .../lb/ElasticLoadBalancerManagerImpl.java      |  22 +-
 .../cloudstack/element/GloboDnsElement.java     |   4 +-
 .../cloudstack/element/GloboDnsElementTest.java |   8 +-
 .../lb/InternalLoadBalancerVMManagerImpl.java   |  26 +-
 .../management/ContrailElementImpl.java         |  22 +-
 .../contrail/management/ContrailGuru.java       |  27 +-
 .../cloud/network/element/MidoNetElement.java   |  22 +-
 .../network/guru/MidoNetPublicNetworkGuru.java  |  32 +-
 .../network/element/MidoNetElementTest.java     |   6 +-
 server/src/com/cloud/api/ApiResponseHelper.java |  23 +-
 .../consoleproxy/ConsoleProxyManagerImpl.java   |  26 +-
 .../cloud/hypervisor/HypervisorGuruBase.java    |  10 +-
 .../com/cloud/network/IpAddressManagerImpl.java |  46 +-
 .../element/CloudZonesNetworkElement.java       |   4 +-
 .../cloud/network/guru/ControlNetworkGuru.java  |  15 +-
 .../cloud/network/guru/DirectNetworkGuru.java   |  49 +-
 .../network/guru/DirectPodBasedNetworkGuru.java |  35 +-
 .../network/guru/ExternalGuestNetworkGuru.java  |  39 +-
 .../cloud/network/guru/GuestNetworkGuru.java    |  26 +-
 .../cloud/network/guru/PodBasedNetworkGuru.java |  10 +-
 .../cloud/network/guru/PrivateNetworkGuru.java  |  32 +-
 .../cloud/network/guru/PublicNetworkGuru.java   |  35 +-
 .../cloud/network/guru/StorageNetworkGuru.java  |  10 +-
 .../network/router/CommandSetupHelper.java      |  10 +-
 .../cloud/network/router/NetworkHelperImpl.java |  14 +-
 .../network/router/NicProfileHelperImpl.java    |  12 +-
 .../VirtualNetworkApplianceManagerImpl.java     |  54 +--
 .../network/router/VpcNetworkHelperImpl.java    |   6 +-
 .../VpcVirtualNetworkApplianceManagerImpl.java  |  10 +-
 .../com/cloud/network/rules/DhcpPvlanRules.java |   2 +-
 .../cloud/network/rules/DhcpSubNetRules.java    |   8 +-
 .../cloud/network/rules/NicPlugInOutRules.java  |  12 +-
 .../network/rules/PrivateGatewayRules.java      |   2 +-
 .../SecondaryStorageManagerImpl.java            |  26 +-
 44 files changed, 668 insertions(+), 640 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/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 e9e9dc5..717054a 100644
--- a/api/src/com/cloud/vm/NicProfile.java
+++ b/api/src/com/cloud/vm/NicProfile.java
@@ -33,92 +33,166 @@ public class NicProfile implements InternalIdentity, Serializable {
 
     long id;
     long networkId;
+    long vmId;
+    String reservationId;
+    Integer deviceId;
+
+    String name;
+    String uuid;
+
+    String macAddress;
     BroadcastDomainType broadcastType;
     Mode mode;
-    long vmId;
-    String gateway;
     AddressFormat format;
     TrafficType trafficType;
-    String ip4Address;
-    String ip6Address;
-    String ip6Gateway;
-    String ip6Cidr;
-    String macAddress;
     URI isolationUri;
-    String netmask;
     URI broadcastUri;
     ReservationStrategy strategy;
-    String reservationId;
     boolean defaultNic;
-    Integer deviceId;
-    String dns1;
-    String dns2;
-    String ip6Dns1;
-    String ip6Dns2;
     Integer networkRate;
     boolean isSecurityGroupEnabled;
-    String name;
-    String requestedIpv4;
-    String requestedIpv6;
-    String uuid;
 
-    public String getDns1() {
-        return dns1;
-    }
+    // IPv4
+    String ipv4Address;
+    String ipv4Netmask;
+    String ipv4Gateway;
+    String ipv4Dns1;
+    String ipv4Dns2;
+    String requestedIPv4;
+
+    // IPv6
+    String ipv6Address;
+    String ipv6Gateway;
+    String ipv6Cidr;
+    String ipv6Dns1;
+    String ipv6Dns2;
+    String requestedIPv6;
+
+    //
+    // CONSTRUCTORS
+    //
 
-    public String getName() {
-        return name;
+    public NicProfile() {
     }
 
-    public void setName(String name) {
+    public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri, Integer networkRate, boolean isSecurityGroupEnabled, String name) {
+        id = nic.getId();
+        networkId = network.getId();
+        mode = network.getMode();
+        broadcastType = network.getBroadcastDomainType();
+        trafficType = network.getTrafficType();
+        format = nic.getAddressFormat();
+
+        ipv4Address = nic.getIp4Address();
+        ipv4Netmask = nic.getNetmask();
+        ipv4Gateway = nic.getGateway();
+
+        ipv6Address = nic.getIp6Address();
+        ipv6Gateway = nic.getIp6Gateway();
+        ipv6Cidr = nic.getIp6Cidr();
+
+        macAddress = nic.getMacAddress();
+        reservationId = nic.getReservationId();
+        strategy = nic.getReservationStrategy();
+        deviceId = nic.getDeviceId();
+        defaultNic = nic.isDefaultNic();
+        this.broadcastUri = broadcastUri;
+        this.isolationUri = isolationUri;
+
+        this.isSecurityGroupEnabled = isSecurityGroupEnabled;
+        vmId = nic.getInstanceId();
         this.name = name;
+        uuid = nic.getUuid();
+
+        if (networkRate != null) {
+            this.networkRate = networkRate;
+        }
     }
 
-    public String getDns2() {
-        return dns2;
+    public NicProfile(String requestedIPv4, String requestedIPv6) {
+        this.requestedIPv4 = requestedIPv4;
+        this.requestedIPv6 = requestedIPv6;
     }
 
-    public void setDns1(String dns1) {
-        this.dns1 = dns1;
+    public NicProfile(ReservationStrategy strategy, String ipv4Address, String macAddress, String gateway, String netmask) {
+        format = AddressFormat.Ip4;
+        this.ipv4Address = ipv4Address;
+        this.ipv4Gateway = gateway;
+        this.ipv4Netmask = netmask;
+        this.macAddress = macAddress;
+        this.strategy = strategy;
     }
 
-    public void setDns2(String dns2) {
-        this.dns2 = dns2;
+    //
+    // GET & SET GENERAL
+    //
+
+    @Override
+    public long getId() {
+        return id;
     }
 
-    public boolean isDefaultNic() {
-        return defaultNic;
+    public void setId(long id) {
+        this.id = id;
     }
 
-    public String getNetmask() {
-        return netmask;
+    public long getNetworkId() {
+        return networkId;
     }
 
-    public void setNetmask(String netmask) {
-        this.netmask = netmask;
+    public void setNetworId(long networkId){
+        this.networkId = networkId;
     }
 
-    public void setBroadcastUri(URI broadcastUri) {
-        this.broadcastUri = broadcastUri;
+    public long getVirtualMachineId() {
+        return vmId;
     }
 
-    public URI getBroadCastUri() {
-        return broadcastUri;
+    public void setVirtualMachineId(long virtualMachineId) {
+        this.vmId = virtualMachineId;
     }
 
-    public void setIsolationUri(URI isolationUri) {
-        this.isolationUri = isolationUri;
+    public String getReservationId() {
+        return reservationId;
     }
 
-    public URI getIsolationUri() {
-        return isolationUri;
+    public void setReservationId(String reservationId) {
+        this.reservationId = reservationId;
     }
 
-    public void setStrategy(ReservationStrategy strategy) {
-        this.strategy = strategy;
+    public Integer getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(int deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
     }
 
-    public BroadcastDomainType getType() {
+    public String getMacAddress() {
+        return macAddress;
+    }
+
+    public void setMacAddress(String macAddress) {
+        this.macAddress = macAddress;
+    }
+
+    public BroadcastDomainType getBroadcastType() {
         return broadcastType;
     }
 
@@ -126,199 +200,211 @@ public class NicProfile implements InternalIdentity, Serializable {
         this.broadcastType = broadcastType;
     }
 
+    public Mode getMode() {
+        return mode;
+    }
+
     public void setMode(Mode mode) {
         this.mode = mode;
     }
 
-    public void setDeviceId(int deviceId) {
-        this.deviceId = deviceId;
+    public AddressFormat getFormat() {
+        return format;
     }
 
-    public void setDefaultNic(boolean defaultNic) {
-        this.defaultNic = defaultNic;
+    public void setFormat(AddressFormat format) {
+        this.format = format;
     }
 
-    public Integer getDeviceId() {
-        return deviceId;
+    public TrafficType getTrafficType() {
+        return trafficType;
     }
 
-    public void setGateway(String gateway) {
-        this.gateway = gateway;
+    public void setTrafficType(TrafficType trafficType) {
+        this.trafficType = trafficType;
     }
 
-    public void setFormat(AddressFormat format) {
-        this.format = format;
+    public URI getIsolationUri() {
+        return isolationUri;
     }
 
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
+    public void setIsolationUri(URI isolationUri) {
+        this.isolationUri = isolationUri;
     }
 
-    public void setTrafficType(TrafficType trafficType) {
-        this.trafficType = trafficType;
+    public URI getBroadCastUri() {
+        return broadcastUri;
     }
 
-    public void setIp6Address(String ip6Address) {
-        this.ip6Address = ip6Address;
+    public void setBroadcastUri(URI broadcastUri) {
+        this.broadcastUri = broadcastUri;
     }
 
-    public Mode getMode() {
-        return mode;
+    public ReservationStrategy getReservationStrategy() {
+        return strategy;
     }
 
-    public long getNetworkId() {
-        return networkId;
+    public void setReservationStrategy(ReservationStrategy strategy) {
+        this.strategy = strategy;
     }
 
-    public long getVirtualMachineId() {
-        return vmId;
+    public boolean isDefaultNic() {
+        return defaultNic;
     }
 
-    @Override
-    public long getId() {
-        return id;
+    public void setDefaultNic(boolean defaultNic) {
+        this.defaultNic = defaultNic;
     }
 
-    public BroadcastDomainType getBroadcastType() {
-        return broadcastType;
+    public Integer getNetworkRate() {
+        return networkRate;
     }
 
-    public void setMacAddress(String macAddress) {
-        this.macAddress = macAddress;
+    public void setNetworkRate(Integer networkRate) {
+        this.networkRate = networkRate;
     }
 
-    public long getVmId() {
-        return vmId;
+    public boolean isSecurityGroupEnabled() {
+        return isSecurityGroupEnabled;
     }
 
-    public String getGateway() {
-        return gateway;
+    public void setSecurityGroupEnabled(boolean enabled) {
+        isSecurityGroupEnabled = enabled;
     }
 
-    public AddressFormat getFormat() {
-        return format;
+    //
+    // GET & SET IPv4
+    //
+
+    public String getIPv4Address() {
+        return ipv4Address;
     }
 
-    public TrafficType getTrafficType() {
-        return trafficType;
+    public void setIPv4Address(String ipv4Address) {
+        this.ipv4Address = ipv4Address;
     }
 
-    public String getIp4Address() {
-        return ip4Address;
+    public String getIPv4Netmask() {
+        return ipv4Netmask;
     }
 
-    public String getIp6Address() {
-        return ip6Address;
+    public void setIPv4Netmask(String ipv4Netmask) {
+        this.ipv4Netmask = ipv4Netmask;
     }
 
-    public String getMacAddress() {
-        return macAddress;
+    public String getIPv4Gateway() {
+        return ipv4Gateway;
     }
 
-    public void setIp4Address(String ip4Address) {
-        this.ip4Address = ip4Address;
+    public void setIPv4Gateway(String ipv4Gateway) {
+        this.ipv4Gateway = ipv4Gateway;
     }
 
-    public Integer getNetworkRate() {
-        return networkRate;
+    public String getIPv4Dns1() {
+        return ipv4Dns1;
     }
 
-    public ReservationStrategy getStrategy() {
-        return strategy;
+    public void setIPv4Dns1(String ipv4Dns1) {
+        this.ipv4Dns1 = ipv4Dns1;
     }
 
-    public String getUuid() {
-        return uuid;
+    public String getIPv4Dns2() {
+        return ipv4Dns2;
     }
 
-    public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri, Integer networkRate, boolean isSecurityGroupEnabled, String name) {
-        id = nic.getId();
-        networkId = network.getId();
-        gateway = nic.getGateway();
-        mode = network.getMode();
-        broadcastType = network.getBroadcastDomainType();
-        trafficType = network.getTrafficType();
-        ip4Address = nic.getIp4Address();
-        format = nic.getAddressFormat();
-        ip6Address = nic.getIp6Address();
-        macAddress = nic.getMacAddress();
-        reservationId = nic.getReservationId();
-        strategy = nic.getReservationStrategy();
-        deviceId = nic.getDeviceId();
-        defaultNic = nic.isDefaultNic();
-        this.broadcastUri = broadcastUri;
-        this.isolationUri = isolationUri;
-        netmask = nic.getNetmask();
-        this.isSecurityGroupEnabled = isSecurityGroupEnabled;
-        vmId = nic.getInstanceId();
-        this.name = name;
-        ip6Cidr = nic.getIp6Cidr();
-        ip6Gateway = nic.getIp6Gateway();
-        uuid = nic.getUuid();
+    public void setIPv4Dns2(String ipv4Dns2) {
+        this.ipv4Dns2 = ipv4Dns2;
+    }
 
-        if (networkRate != null) {
-            this.networkRate = networkRate;
-        }
+    public String getRequestedIPv4() {
+        return requestedIPv4;
     }
 
-    public NicProfile(ReservationStrategy strategy, String ip4Address, String macAddress, String gateway, String netmask) {
-        format = AddressFormat.Ip4;
-        this.ip4Address = ip4Address;
-        this.macAddress = macAddress;
-        this.gateway = gateway;
-        this.netmask = netmask;
-        this.strategy = strategy;
+    public void setRequestedIPv4(String requestedIPv4) {
+        this.requestedIPv4 = requestedIPv4;
     }
 
-    public NicProfile(String requestedIpv4, String requestedIpv6) {
-        this.requestedIpv4 = requestedIpv4;
-        this.requestedIpv6 = requestedIpv6;
+    //
+    // GET & SET IPv6
+    //
+
+    public String getIPv6Address() {
+        return ipv6Address;
     }
 
-    public NicProfile() {
+    public void setIPv6Address(String ipv6Address) {
+        this.ipv6Address = ipv6Address;
     }
 
-    public ReservationStrategy getReservationStrategy() {
-        return strategy;
+    public String getIPv6Gateway() {
+        return ipv6Gateway;
     }
 
-    public String getReservationId() {
-        return reservationId;
+    public void setIPv6Gateway(String ipv6Gateway) {
+        this.ipv6Gateway = ipv6Gateway;
     }
 
-    public void setReservationId(String reservationId) {
-        this.reservationId = reservationId;
+    public String getIPv6Cidr() {
+        return ipv6Cidr;
     }
 
-    public boolean isSecurityGroupEnabled() {
-        return isSecurityGroupEnabled;
+    public void setIPv6Cidr(String ipv6Cidr) {
+        this.ipv6Cidr = ipv6Cidr;
     }
 
-    public void setSecurityGroupEnabled(boolean enabled) {
-        isSecurityGroupEnabled = enabled;
+    public String getIPv6Dns1() {
+        return ipv6Dns1;
+    }
+
+    public void setIPv6Dns1(String ipv6Dns1) {
+        this.ipv6Dns1 = ipv6Dns1;
+    }
+
+    public String getIPv6Dns2() {
+        return ipv6Dns2;
+    }
+
+    public void setIPv6Dns2(String ipv6Dns2) {
+        this.ipv6Dns2 = ipv6Dns2;
+    }
+
+    public String getRequestedIPv6() {
+        return requestedIPv6;
     }
 
-    public String getRequestedIpv4() {
-        return requestedIpv4;
+    public void setRequestedIPv6(String requestedIPv6) {
+        this.requestedIPv6 = requestedIPv6;
     }
 
+    //
+    // OTHER METHODS
+    //
+
     public void deallocate() {
-        gateway = null;
         mode = null;
         format = null;
         broadcastType = null;
         trafficType = null;
-        ip4Address = null;
-        ip6Address = null;
+
+        ipv4Address = null;
+        ipv4Netmask = null;
+        ipv4Gateway = null;
+        ipv4Dns1 = null;
+        ipv4Dns2 = null;
+
+        ipv6Address = null;
+        ipv6Gateway = null;
+        ipv6Cidr = null;
+        ipv6Dns1 = null;
+        ipv6Dns2 = null;
+
         macAddress = null;
         reservationId = null;
         strategy = null;
         deviceId = null;
         broadcastUri = null;
         isolationUri = null;
-        netmask = null;
-        dns1 = null;
-        dns2 = null;
+
     }
 
     @Override
@@ -329,54 +415,9 @@ public class NicProfile implements InternalIdentity, Serializable {
                 .append("-")
                 .append(reservationId)
                 .append("-")
-                .append(ip4Address)
+                .append(ipv4Address)
                 .append("-")
                 .append(broadcastUri)
                 .toString();
     }
-
-    public String getIp6Gateway() {
-        return ip6Gateway;
-    }
-
-    public void setIp6Gateway(String ip6Gateway) {
-        this.ip6Gateway = ip6Gateway;
-    }
-
-    public String getIp6Cidr() {
-        return ip6Cidr;
-    }
-
-    public void setIp6Cidr(String ip6Cidr) {
-        this.ip6Cidr = ip6Cidr;
-    }
-
-    public String getRequestedIpv6() {
-        return requestedIpv6;
-    }
-
-    public void setRequestedIpv6(String requestedIpv6) {
-        this.requestedIpv6 = requestedIpv6;
-    }
-
-    public String getIp6Dns1() {
-        return ip6Dns1;
-    }
-
-    public void setIp6Dns1(String ip6Dns1) {
-        this.ip6Dns1 = ip6Dns1;
-    }
-
-    public String getIp6Dns2() {
-        return ip6Dns2;
-    }
-
-    public void setIp6Dns2(String ip6Dns2) {
-        this.ip6Dns2 = ip6Dns2;
-    }
-
-    public void setNetworId(long networkId){
-        this.networkId = networkId;
-    }
-
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/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 d4cdd9d..af5fc7f 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -37,9 +37,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import com.cloud.network.Networks;
-
-import org.apache.log4j.Logger;
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.cloud.entity.api.db.VMNetworkMapVO;
@@ -47,13 +44,14 @@ import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDao;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.ConfigDepot;
 import org.apache.cloudstack.framework.config.ConfigKey;
-import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.ConfigKey.Scope;
+import org.apache.cloudstack.framework.config.Configurable;
 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.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.region.PortableIpDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -111,6 +109,7 @@ import com.cloud.network.NetworkMigrationResponder;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.NetworkProfile;
 import com.cloud.network.NetworkStateListener;
+import com.cloud.network.Networks;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.PhysicalNetwork;
@@ -839,7 +838,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
         vo.setDefaultNic(profile.isDefaultNic());
 
-        vo.setIp4Address(profile.getIp4Address());
+        vo.setIp4Address(profile.getIPv4Address());
         vo.setAddressFormat(profile.getFormat());
 
         if (profile.getMacAddress() != null) {
@@ -847,8 +846,8 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         }
 
         vo.setMode(profile.getMode());
-        vo.setNetmask(profile.getNetmask());
-        vo.setGateway(profile.getGateway());
+        vo.setNetmask(profile.getIPv4Netmask());
+        vo.setGateway(profile.getIPv4Gateway());
 
         if (profile.getBroadCastUri() != null) {
             vo.setBroadcastUri(profile.getBroadCastUri());
@@ -860,25 +859,25 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
         vo.setState(Nic.State.Allocated);
 
-        vo.setIp6Address(profile.getIp6Address());
-        vo.setIp6Gateway(profile.getIp6Gateway());
-        vo.setIp6Cidr(profile.getIp6Cidr());
+        vo.setIp6Address(profile.getIPv6Address());
+        vo.setIp6Gateway(profile.getIPv6Gateway());
+        vo.setIp6Cidr(profile.getIPv6Cidr());
 
         return deviceId;
     }
 
     protected void applyProfileToNicForRelease(NicVO vo, NicProfile profile) {
-        vo.setGateway(profile.getGateway());
+        vo.setGateway(profile.getIPv4Gateway());
         vo.setAddressFormat(profile.getFormat());
-        vo.setIp4Address(profile.getIp4Address());
-        vo.setIp6Address(profile.getIp6Address());
+        vo.setIp4Address(profile.getIPv4Address());
+        vo.setIp6Address(profile.getIPv6Address());
         vo.setMacAddress(profile.getMacAddress());
         if (profile.getReservationStrategy() != null) {
             vo.setReservationStrategy(profile.getReservationStrategy());
         }
         vo.setBroadcastUri(profile.getBroadCastUri());
         vo.setIsolationUri(profile.getIsolationUri());
-        vo.setNetmask(profile.getNetmask());
+        vo.setNetmask(profile.getIPv4Netmask());
     }
 
     protected void applyProfileToNetwork(NetworkVO network, NetworkProfile profile) {
@@ -896,8 +895,8 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         to.setIp(nic.getIp4Address());
         to.setNetmask(nic.getNetmask());
         to.setMac(nic.getMacAddress());
-        to.setDns1(profile.getDns1());
-        to.setDns2(profile.getDns2());
+        to.setDns1(profile.getIPv4Dns1());
+        to.setDns2(profile.getIPv4Dns2());
         if (nic.getGateway() != null) {
             to.setGateway(nic.getGateway());
         } else {
@@ -910,8 +909,8 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         to.setBroadcastUri(nic.getBroadcastUri());
         to.setIsolationuri(nic.getIsolationUri());
         if (profile != null) {
-            to.setDns1(profile.getDns1());
-            to.setDns2(profile.getDns2());
+            to.setDns1(profile.getIPv4Dns1());
+            to.setDns2(profile.getIPv4Dns2());
         }
 
         Integer networkRate = _networkModel.getNetworkRate(config.getId(), null);
@@ -1240,7 +1239,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                 DhcpServiceProvider sp = (DhcpServiceProvider)element;
                 Map<Capability, String> dhcpCapabilities = element.getCapabilities().get(Service.Dhcp);
                 String supportsMultipleSubnets = dhcpCapabilities.get(Capability.DhcpAccrossMultipleSubnets);
-                if ((supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets)) && profile.getIp6Address() == null) {
+                if ((supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets)) && profile.getIPv6Address() == null) {
                     if (!sp.configDhcpSupportForSubnet(network, profile, vmProfile, dest, context)) {
                         return false;
                     }
@@ -1333,19 +1332,19 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
                     networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getHypervisorType(), network));
             guru.reserve(profile, network, vmProfile, dest, context);
-            nic.setIp4Address(profile.getIp4Address());
+            nic.setIp4Address(profile.getIPv4Address());
             nic.setAddressFormat(profile.getFormat());
-            nic.setIp6Address(profile.getIp6Address());
+            nic.setIp6Address(profile.getIPv6Address());
             nic.setMacAddress(profile.getMacAddress());
             nic.setIsolationUri(profile.getIsolationUri());
             nic.setBroadcastUri(profile.getBroadCastUri());
             nic.setReserver(guru.getName());
             nic.setState(Nic.State.Reserved);
-            nic.setNetmask(profile.getNetmask());
-            nic.setGateway(profile.getGateway());
+            nic.setNetmask(profile.getIPv4Netmask());
+            nic.setGateway(profile.getIPv4Gateway());
 
-            if (profile.getStrategy() != null) {
-                nic.setReservationStrategy(profile.getStrategy());
+            if (profile.getReservationStrategy() != null) {
+                nic.setReservationStrategy(profile.getReservationStrategy());
             }
 
             updateNic(nic, network.getId(), 1);
@@ -1478,9 +1477,9 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                     NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
                     NicProfile profile = new NicProfile();
                     profile.setDeviceId(255); //dummyId
-                    profile.setIp4Address(userIp.getAddress().toString());
-                    profile.setNetmask(publicIp.getNetmask());
-                    profile.setGateway(publicIp.getGateway());
+                    profile.setIPv4Address(userIp.getAddress().toString());
+                    profile.setIPv4Netmask(publicIp.getNetmask());
+                    profile.setIPv4Gateway(publicIp.getGateway());
                     profile.setMacAddress(publicIp.getMacAddress());
                     profile.setBroadcastType(network.getBroadcastDomainType());
                     profile.setTrafficType(network.getTrafficType());
@@ -3116,7 +3115,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         NicProfile nic = null;
         if (requested != null && requested.getBroadCastUri() != null) {
             String broadcastUri = requested.getBroadCastUri().toString();
-            String ipAddress = requested.getIp4Address();
+            String ipAddress = requested.getIPv4Address();
             NicVO nicVO = _nicDao.findByNetworkIdInstanceIdAndBroadcastUri(network.getId(), vm.getId(), broadcastUri);
             if (nicVO != null) {
                 if (ipAddress == null || nicVO.getIp4Address().equals(ipAddress)) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/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 70b9b58..17d3785 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalPingServiceImpl.java
@@ -30,19 +30,17 @@ import java.util.Map;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import com.cloud.network.Network;
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.AddBaremetalPxeCmd;
 import org.apache.cloudstack.api.AddBaremetalPxePingServerCmd;
 import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
+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;
+import com.cloud.agent.api.baremetal.PrepareCreateTemplateCommand;
 import com.cloud.agent.api.baremetal.PreparePxeServerAnswer;
 import com.cloud.agent.api.baremetal.PreparePxeServerCommand;
-import com.cloud.agent.api.baremetal.PrepareCreateTemplateCommand;
 import com.cloud.baremetal.database.BaremetalPxeDao;
 import com.cloud.baremetal.database.BaremetalPxeVO;
 import com.cloud.baremetal.networkservice.BaremetalPxeManager.BaremetalPxeType;
@@ -52,6 +50,7 @@ import com.cloud.deploy.DeployDestination;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDetailsDao;
+import com.cloud.network.Network;
 import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
@@ -95,12 +94,12 @@ public class BareMetalPingServiceImpl extends BareMetalPxeServiceBase implements
         long pxeServerId = pxeVo.getHostId();
 
         String mac = pxeNic.getMacAddress();
-        String ip = pxeNic.getIp4Address();
-        String gateway = pxeNic.getGateway();
-        String mask = pxeNic.getNetmask();
-        String dns = pxeNic.getDns1();
+        String ip = pxeNic.getIPv4Address();
+        String gateway = pxeNic.getIPv4Gateway();
+        String mask = pxeNic.getIPv4Netmask();
+        String dns = pxeNic.getIPv4Dns1();
         if (dns == null) {
-            dns = pxeNic.getDns2();
+            dns = pxeNic.getIPv4Dns2();
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
index a0b4199..292e6ef 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
@@ -18,6 +18,13 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package com.cloud.baremetal.networkservice;
 
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
+import org.apache.log4j.Logger;
+
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Pod;
 import com.cloud.dc.PodVlanMapVO;
@@ -50,12 +57,6 @@ import com.cloud.utils.db.TransactionStatus;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
-import org.apache.log4j.Logger;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
 
 @Local(value = {NetworkGuru.class})
 public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
@@ -93,7 +94,7 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
             return;
         }
 
-        String oldIp = nic.getIp4Address();
+        String oldIp = nic.getIPv4Address();
         boolean getNewIp = false;
         if (oldIp == null) {
             getNewIp = true;
@@ -113,7 +114,7 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
                         }
                     });
 
-                    nic.setIp4Address(null);
+                    nic.setIPv4Address(null);
                     getNewIp = true;
                 }
             }
@@ -127,8 +128,8 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
         }
 
         DataCenter dc = _dcDao.findById(network.getDataCenterId());
-        nic.setDns1(dc.getDns1());
-        nic.setDns2(dc.getDns2());
+        nic.setIPv4Dns1(dc.getDns1());
+        nic.setIPv4Dns2(dc.getDns2());
 
         /*
          * Pod pod = dest.getPod(); Pair<String, Long> ip =
@@ -154,13 +155,13 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
     private void getBaremetalIp(NicProfile nic, Pod pod, VirtualMachineProfile vm, Network network, String requiredIp) throws
         InsufficientAddressCapacityException, ConcurrentOperationException {
         DataCenter dc = _dcDao.findById(pod.getDataCenterId());
-        if (nic.getIp4Address() == null) {
-            s_logger.debug(String.format("Requiring ip address: %s", nic.getIp4Address()));
+        if (nic.getIPv4Address() == null) {
+            s_logger.debug(String.format("Requiring ip address: %s", nic.getIPv4Address()));
             PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), pod.getId(), vm.getOwner(), VlanType.DirectAttached, network.getId(), requiredIp, false);
-            nic.setIp4Address(ip.getAddress().toString());
+            nic.setIPv4Address(ip.getAddress().toString());
             nic.setFormat(AddressFormat.Ip4);
-            nic.setGateway(ip.getGateway());
-            nic.setNetmask(ip.getNetmask());
+            nic.setIPv4Gateway(ip.getGateway());
+            nic.setIPv4Netmask(ip.getNetmask());
             if (ip.getVlanTag() != null && ip.getVlanTag().equalsIgnoreCase(Vlan.UNTAGGED)) {
                 nic.setIsolationUri(IsolationType.Ec2.toUri(Vlan.UNTAGGED));
                 nic.setBroadcastUri(BroadcastDomainType.Vlan.toUri(Vlan.UNTAGGED));
@@ -169,7 +170,7 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
             nic.setReservationId(String.valueOf(ip.getVlanTag()));
             nic.setMacAddress(ip.getMacAddress());
         }
-        nic.setDns1(dc.getDns1());
-        nic.setDns2(dc.getDns2());
+        nic.setIPv4Dns1(dc.getDns1());
+        nic.setIPv4Dns2(dc.getDns2());
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
index 2b67abe..c2182e1 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
@@ -22,6 +22,20 @@
 // Automatically generated by addcopyright.py at 04/03/2012
 package com.cloud.baremetal.networkservice;
 
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.cloudstack.api.AddBaremetalDhcpCmd;
+import org.apache.cloudstack.api.ListBaremetalDhcpCmd;
+import org.apache.log4j.Logger;
+
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.StartupCommand;
@@ -60,18 +74,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.UserVmDao;
-import org.apache.cloudstack.api.AddBaremetalDhcpCmd;
-import org.apache.cloudstack.api.ListBaremetalDhcpCmd;
-import org.apache.log4j.Logger;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 @Local(value = {BaremetalDhcpManager.class})
 public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDhcpManager, ResourceStateAdapter {
@@ -141,22 +143,22 @@ public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDh
         }
 
         HostVO h = hosts.get(0);
-        String dns = nic.getDns1();
+        String dns = nic.getIPv4Dns1();
         if (dns == null) {
-            dns = nic.getDns2();
+            dns = nic.getIPv4Dns2();
         }
         DhcpEntryCommand dhcpCommand =
-            new DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), profile.getVirtualMachine().getHostName(), null, dns, nic.getGateway(), null,
+            new DhcpEntryCommand(nic.getMacAddress(), nic.getIPv4Address(), profile.getVirtualMachine().getHostName(), null, dns, nic.getIPv4Gateway(), null,
                 _ntwkModel.getExecuteInSeqNtwkElmtCmd());
         String errMsg =
-            String.format("Set dhcp entry on external DHCP %1$s failed(ip=%2$s, mac=%3$s, vmname=%4$s)", h.getPrivateIpAddress(), nic.getIp4Address(),
+            String.format("Set dhcp entry on external DHCP %1$s failed(ip=%2$s, mac=%3$s, vmname=%4$s)", h.getPrivateIpAddress(), nic.getIPv4Address(),
                 nic.getMacAddress(), profile.getVirtualMachine().getHostName());
         // prepareBareMetalDhcpEntry(nic, dhcpCommand);
         try {
             Answer ans = _agentMgr.send(h.getId(), dhcpCommand);
             if (ans.getResult()) {
                 s_logger.debug(String.format("Set dhcp entry on external DHCP %1$s successfully(ip=%2$s, mac=%3$s, vmname=%4$s)", h.getPrivateIpAddress(),
-                    nic.getIp4Address(), nic.getMacAddress(), profile.getVirtualMachine().getHostName()));
+                    nic.getIPv4Address(), nic.getMacAddress(), profile.getVirtualMachine().getHostName()));
                 return true;
             } else {
                 s_logger.debug(errMsg + " " + ans.getDetails());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/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 f68e7d3..f134716 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
@@ -30,14 +30,12 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import com.cloud.network.Network;
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd;
 import org.apache.cloudstack.api.AddBaremetalPxeCmd;
 import org.apache.cloudstack.api.AddBaremetalPxePingServerCmd;
 import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -50,6 +48,7 @@ import com.cloud.deploy.DeployDestination;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
+import com.cloud.network.Network;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.dao.PhysicalNetworkVO;
@@ -199,9 +198,9 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
         cmd.addVmData("userdata", "user-data", vm.getUserData());
         cmd.addVmData("metadata", "service-offering", StringUtils.unicodeEscape(serviceOffering));
         cmd.addVmData("metadata", "availability-zone", StringUtils.unicodeEscape(zoneName));
-        cmd.addVmData("metadata", "local-ipv4", nic.getIp4Address());
+        cmd.addVmData("metadata", "local-ipv4", nic.getIPv4Address());
         cmd.addVmData("metadata", "local-hostname", StringUtils.unicodeEscape(vm.getInstanceName()));
-        cmd.addVmData("metadata", "public-ipv4", nic.getIp4Address());
+        cmd.addVmData("metadata", "public-ipv4", nic.getIPv4Address());
         cmd.addVmData("metadata", "public-hostname", StringUtils.unicodeEscape(vm.getInstanceName()));
         cmd.addVmData("metadata", "instance-id", String.valueOf(vm.getId()));
         cmd.addVmData("metadata", "vm-id", String.valueOf(vm.getInstanceName()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
index 2a63142..f000324 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
@@ -27,18 +27,18 @@ import javax.inject.Inject;
 
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.exception.InsufficientAddressCapacityException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.hypervisor.HypervisorGuru;
 import com.cloud.hypervisor.HypervisorGuruBase;
-import com.cloud.storage.GuestOSVO;
-import com.cloud.storage.dao.GuestOSDao;
-import com.cloud.exception.InsufficientAddressCapacityException;
 import com.cloud.hypervisor.hyperv.manager.HypervManager;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.NetworkVO;
+import com.cloud.storage.GuestOSVO;
+import com.cloud.storage.dao.GuestOSDao;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.VirtualMachine;
@@ -129,10 +129,10 @@ public class HypervGuru extends HypervisorGuruBase implements HypervisorGuru {
                     } catch (InsufficientAddressCapacityException e) {
                         throw new CloudRuntimeException("unable to allocate mac address on network: " + networkId);
                     }
-                    nicTo.setDns1(profile.getDns1());
-                    nicTo.setDns2(profile.getDns2());
-                    if (publicNicProfile != null && publicNicProfile.getGateway() != null) {
-                        nicTo.setGateway(publicNicProfile.getGateway());
+                    nicTo.setDns1(profile.getIPv4Dns1());
+                    nicTo.setDns2(profile.getIPv4Dns2());
+                    if (publicNicProfile != null && publicNicProfile.getIPv4Gateway() != null) {
+                        nicTo.setGateway(publicNicProfile.getIPv4Gateway());
                     } else {
                         nicTo.setGateway(network.getGateway());
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java b/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
index 3c69f3b..dba9de2 100644
--- a/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
+++ b/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
@@ -264,7 +264,7 @@ NetworkACLServiceProvider, FirewallServiceProvider, ResourceStateAdapter {
         String hostname = dest.getHost().getName();
         String nicId = nic.getUuid();
         Integer vlan = Integer.valueOf(BroadcastDomainType.getValue(nic.getIsolationUri()));
-        String ipv4 = nic.getIp4Address();
+        String ipv4 = nic.getIPv4Address();
         String mac = nic.getMacAddress();
         long zoneId = network.getDataCenterId();
         String vmwareVswitchLabel = _networkModel.getDefaultGuestTrafficLabel(zoneId, HypervisorType.VMware);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/bigswitch/src/com/cloud/network/guru/BigSwitchBcfGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch/src/com/cloud/network/guru/BigSwitchBcfGuestNetworkGuru.java b/plugins/network-elements/bigswitch/src/com/cloud/network/guru/BigSwitchBcfGuestNetworkGuru.java
index 7625b4b..e205f47 100644
--- a/plugins/network-elements/bigswitch/src/com/cloud/network/guru/BigSwitchBcfGuestNetworkGuru.java
+++ b/plugins/network-elements/bigswitch/src/com/cloud/network/guru/BigSwitchBcfGuestNetworkGuru.java
@@ -387,7 +387,7 @@ public class BigSwitchBcfGuestNetworkGuru extends GuestNetworkGuru implements Ne
 
         String nicId = nic.getUuid();
         Integer vlan = Integer.valueOf(BroadcastDomainType.getValue(nic.getIsolationUri()));
-        String ipv4 = nic.getIp4Address();
+        String ipv4 = nic.getIPv4Address();
         String mac = nic.getMacAddress();
 
         CreateBcfAttachmentCommand cmd = new CreateBcfAttachmentCommand(tenantId,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java b/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java
index 5d1f02b..4e0a319 100644
--- a/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java
+++ b/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/element/DnsNotifier.java
@@ -73,8 +73,8 @@ public class DnsNotifier extends AdapterBase implements NetworkElement {
         throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
         // signal to the dns server that this vm is up and running and set the ip address to hostname mapping.
         vm.getHostName();
-        nic.getIp4Address();
-        nic.getIp6Address();
+        nic.getIPv4Address();
+        nic.getIPv6Address();
         return true;
     }
 
@@ -82,8 +82,8 @@ public class DnsNotifier extends AdapterBase implements NetworkElement {
     public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException,
         ResourceUnavailableException {
         vm.getHostName();
-        nic.getIp4Address();
-        nic.getIp6Address();
+        nic.getIPv4Address();
+        nic.getIPv6Address();
         // signal to the dns server that the vm is being shutdown and remove the mapping.
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
index 9aba5ae..b2d651c 100644
--- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
+++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
@@ -434,12 +434,12 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
 
         for (NicProfile nic : profile.getNics()) {
             int deviceId = nic.getDeviceId();
-            buf.append(" eth").append(deviceId).append("ip=").append(nic.getIp4Address());
-            buf.append(" eth").append(deviceId).append("mask=").append(nic.getNetmask());
+            buf.append(" eth").append(deviceId).append("ip=").append(nic.getIPv4Address());
+            buf.append(" eth").append(deviceId).append("mask=").append(nic.getIPv4Netmask());
             if (nic.isDefaultNic()) {
-                buf.append(" gateway=").append(nic.getGateway());
-                defaultDns1 = nic.getDns1();
-                defaultDns2 = nic.getDns2();
+                buf.append(" gateway=").append(nic.getIPv4Gateway());
+                defaultDns1 = nic.getIPv4Dns1();
+                defaultDns2 = nic.getIPv4Dns2();
             }
             if (nic.getTrafficType() == TrafficType.Management) {
                 buf.append(" localgw=").append(dest.getPod().getGateway());
@@ -497,11 +497,11 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
         List<NicProfile> nics = profile.getNics();
         for (NicProfile nic : nics) {
             if (nic.getTrafficType() == TrafficType.Public) {
-                elbVm.setPublicIpAddress(nic.getIp4Address());
-                elbVm.setPublicNetmask(nic.getNetmask());
+                elbVm.setPublicIpAddress(nic.getIPv4Address());
+                elbVm.setPublicNetmask(nic.getIPv4Netmask());
                 elbVm.setPublicMacAddress(nic.getMacAddress());
             } else if (nic.getTrafficType() == TrafficType.Control) {
-                elbVm.setPrivateIpAddress(nic.getIp4Address());
+                elbVm.setPrivateIpAddress(nic.getIPv4Address());
                 elbVm.setPrivateMacAddress(nic.getMacAddress());
             }
         }
@@ -534,14 +534,14 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
             // TODO this is a ugly to test hypervisor type here
             // for basic network mode, we will use the guest NIC for control NIC
             for (NicProfile nic : profile.getNics()) {
-                if (nic.getTrafficType() == TrafficType.Guest && nic.getIp4Address() != null) {
+                if (nic.getTrafficType() == TrafficType.Guest && nic.getIPv4Address() != null) {
                     controlNic = nic;
                     guestNetworkId = nic.getNetworkId();
                 }
             }
         } else {
             for (NicProfile nic : profile.getNics()) {
-                if (nic.getTrafficType() == TrafficType.Control && nic.getIp4Address() != null) {
+                if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
                     controlNic = nic;
                 } else if (nic.getTrafficType() == TrafficType.Guest) {
                     guestNetworkId = nic.getNetworkId();
@@ -554,7 +554,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
             return false;
         }
 
-        cmds.addCommand("checkSsh", new CheckSshCommand(profile.getInstanceName(), controlNic.getIp4Address(), 3922));
+        cmds.addCommand("checkSsh", new CheckSshCommand(profile.getInstanceName(), controlNic.getIPv4Address(), 3922));
 
         // Re-apply load balancing rules
         List<LoadBalancerVO> lbs = _elbVmMapDao.listLbsForElbVm(elbVm.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/globodns/src/com/globo/globodns/cloudstack/element/GloboDnsElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/globodns/src/com/globo/globodns/cloudstack/element/GloboDnsElement.java b/plugins/network-elements/globodns/src/com/globo/globodns/cloudstack/element/GloboDnsElement.java
index c5a184c..042145b 100644
--- a/plugins/network-elements/globodns/src/com/globo/globodns/cloudstack/element/GloboDnsElement.java
+++ b/plugins/network-elements/globodns/src/com/globo/globodns/cloudstack/element/GloboDnsElement.java
@@ -152,7 +152,7 @@ public class GloboDnsElement extends AdapterBase implements ResourceStateAdapter
             throw new InvalidParameterValueException("VM name should contain only lower case letters and digits: " + vmName + " - " + vm);
         }
 
-        CreateOrUpdateRecordAndReverseCommand cmd = new CreateOrUpdateRecordAndReverseCommand(vmHostname, nic.getIp4Address(), network.getNetworkDomain(),
+        CreateOrUpdateRecordAndReverseCommand cmd = new CreateOrUpdateRecordAndReverseCommand(vmHostname, nic.getIPv4Address(), network.getNetworkDomain(),
                 GloboDNSTemplateId.value(), GloboDNSOverride.value());
         callCommand(cmd, zoneId);
         return true;
@@ -174,7 +174,7 @@ public class GloboDnsElement extends AdapterBase implements ResourceStateAdapter
             throw new CloudRuntimeException("Could not find zone associated to this network");
         }
 
-        RemoveRecordCommand cmd = new RemoveRecordCommand(hostNameOfVirtualMachine(vm), nic.getIp4Address(), network.getNetworkDomain(), GloboDNSOverride.value());
+        RemoveRecordCommand cmd = new RemoveRecordCommand(hostNameOfVirtualMachine(vm), nic.getIPv4Address(), network.getNetworkDomain(), GloboDNSOverride.value());
         callCommand(cmd, zoneId);
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/globodns/test/com/globo/globodns/cloudstack/element/GloboDnsElementTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/globodns/test/com/globo/globodns/cloudstack/element/GloboDnsElementTest.java b/plugins/network-elements/globodns/test/com/globo/globodns/cloudstack/element/GloboDnsElementTest.java
index 36155b93..12427f6 100644
--- a/plugins/network-elements/globodns/test/com/globo/globodns/cloudstack/element/GloboDnsElementTest.java
+++ b/plugins/network-elements/globodns/test/com/globo/globodns/cloudstack/element/GloboDnsElementTest.java
@@ -19,9 +19,9 @@ package com.globo.globodns.cloudstack.element;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.io.IOException;
 
@@ -151,7 +151,7 @@ public class GloboDnsElementTest {
         when(network.getDataCenterId()).thenReturn(zoneId);
         when(network.getId()).thenReturn(1l);
         NicProfile nic = new NicProfile();
-        nic.setIp4Address("10.11.12.13");
+        nic.setIPv4Address("10.11.12.13");
         VirtualMachineProfile vm = mock(VirtualMachineProfile.class);
         when(vm.getHostName()).thenReturn("vm-name");
         when(vm.getType()).thenReturn(VirtualMachine.Type.User);
@@ -184,7 +184,7 @@ public class GloboDnsElementTest {
         when(network.getDataCenterId()).thenReturn(zoneId);
         when(network.getId()).thenReturn(1l);
         NicProfile nic = new NicProfile();
-        nic.setIp4Address("10.11.12.13");
+        nic.setIPv4Address("10.11.12.13");
         VirtualMachineProfile vm = mock(VirtualMachineProfile.class);
         when(vm.getHostName()).thenReturn("vm-name");
         when(vm.getType()).thenReturn(VirtualMachine.Type.User);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/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 4bd852d..cce7633 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
@@ -190,12 +190,12 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
 
         for (final NicProfile nic : profile.getNics()) {
             final int deviceId = nic.getDeviceId();
-            buf.append(" eth").append(deviceId).append("ip=").append(nic.getIp4Address());
-            buf.append(" eth").append(deviceId).append("mask=").append(nic.getNetmask());
+            buf.append(" eth").append(deviceId).append("ip=").append(nic.getIPv4Address());
+            buf.append(" eth").append(deviceId).append("mask=").append(nic.getIPv4Netmask());
 
             if (nic.isDefaultNic()) {
-                buf.append(" gateway=").append(nic.getGateway());
-                buf.append(" dns1=").append(nic.getGateway());
+                buf.append(" gateway=").append(nic.getIPv4Gateway());
+                buf.append(" dns1=").append(nic.getIPv4Gateway());
             }
 
             if (nic.getTrafficType() == TrafficType.Guest) {
@@ -251,7 +251,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
         final List<NicProfile> nics = profile.getNics();
         for (final NicProfile nic : nics) {
             if (nic.getTrafficType() == TrafficType.Control) {
-                internalLbVm.setPrivateIpAddress(nic.getIp4Address());
+                internalLbVm.setPrivateIpAddress(nic.getIPv4Address());
                 internalLbVm.setPrivateMacAddress(nic.getMacAddress());
             }
         }
@@ -339,7 +339,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
 
         if (reprogramGuestNtwk) {
             final NicProfile guestNic = getNicProfileByTrafficType(profile, TrafficType.Guest);
-            finalizeLbRulesForIp(cmds, internalLbVm, provider, new Ip(guestNic.getIp4Address()), guestNic.getNetworkId());
+            finalizeLbRulesForIp(cmds, internalLbVm, provider, new Ip(guestNic.getIPv4Address()), guestNic.getNetworkId());
         }
 
         return true;
@@ -408,7 +408,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
 
     protected NicProfile getNicProfileByTrafficType(final VirtualMachineProfile profile, final TrafficType trafficType) {
         for (final NicProfile nic : profile.getNics()) {
-            if (nic.getTrafficType() == trafficType && nic.getIp4Address() != null) {
+            if (nic.getTrafficType() == trafficType && nic.getIPv4Address() != null) {
                 return nic;
             }
         }
@@ -416,11 +416,11 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
     }
 
     protected void finalizeSshAndVersionOnStart(final Commands cmds, final VirtualMachineProfile profile, final DomainRouterVO router, final NicProfile controlNic) {
-        cmds.addCommand("checkSsh", new CheckSshCommand(profile.getInstanceName(), controlNic.getIp4Address(), 3922));
+        cmds.addCommand("checkSsh", new CheckSshCommand(profile.getInstanceName(), controlNic.getIPv4Address(), 3922));
 
         // Update internal lb vm template/scripts version
         final GetDomRVersionCmd command = new GetDomRVersionCmd();
-        command.setAccessDetail(NetworkElementCommand.ROUTER_IP, controlNic.getIp4Address());
+        command.setAccessDetail(NetworkElementCommand.ROUTER_IP, controlNic.getIPv4Address());
         command.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
         cmds.addCommand("getDomRVersion", command);
     }
@@ -672,17 +672,17 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
             s_logger.debug("Adding nic for Internal LB in Guest network " + guestNetwork);
             final NicProfile guestNic = new NicProfile();
             if (guestIp != null) {
-                guestNic.setIp4Address(guestIp.addr());
+                guestNic.setIPv4Address(guestIp.addr());
             } else {
-                guestNic.setIp4Address(_ipAddrMgr.acquireGuestIpAddress(guestNetwork, null));
+                guestNic.setIPv4Address(_ipAddrMgr.acquireGuestIpAddress(guestNetwork, null));
             }
-            guestNic.setGateway(guestNetwork.getGateway());
+            guestNic.setIPv4Gateway(guestNetwork.getGateway());
             guestNic.setBroadcastUri(guestNetwork.getBroadcastUri());
             guestNic.setBroadcastType(guestNetwork.getBroadcastDomainType());
             guestNic.setIsolationUri(guestNetwork.getBroadcastUri());
             guestNic.setMode(guestNetwork.getMode());
             final String gatewayCidr = guestNetwork.getCidr();
-            guestNic.setNetmask(NetUtils.getCidrNetmask(gatewayCidr));
+            guestNic.setIPv4Netmask(NetUtils.getCidrNetmask(gatewayCidr));
             guestNic.setDefaultNic(true);
             networks.put(guestNetwork, new ArrayList<NicProfile>(Arrays.asList(guestNic)));
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
index 05723b0..7f56409 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
@@ -27,24 +27,19 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.network.contrail.api.command.CreateServiceInstanceCmd;
 import org.apache.cloudstack.network.contrail.model.InstanceIpModel;
 import org.apache.cloudstack.network.contrail.model.VMInterfaceModel;
 import org.apache.cloudstack.network.contrail.model.VirtualMachineModel;
 import org.apache.cloudstack.network.contrail.model.VirtualNetworkModel;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.deploy.DeployDestination;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.IpAddress;
-import com.cloud.network.dao.NetworkDao;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.resource.ResourceManager;
-
 import com.cloud.network.Network;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.Provider;
@@ -52,12 +47,17 @@ import com.cloud.network.Network.Service;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.PublicIpAddress;
+import com.cloud.network.dao.NetworkDao;
+import com.cloud.network.dao.NetworkVO;
+import com.cloud.network.element.DhcpServiceProvider;
 import com.cloud.network.element.IpDeployer;
-import com.cloud.network.element.StaticNatServiceProvider;
 import com.cloud.network.element.SourceNatServiceProvider;
-import com.cloud.network.element.DhcpServiceProvider;
+import com.cloud.network.element.StaticNatServiceProvider;
 import com.cloud.network.rules.StaticNat;
 import com.cloud.offering.NetworkOffering;
+import com.cloud.resource.ResourceManager;
+import com.cloud.server.ConfigurationServer;
+import com.cloud.server.ConfigurationServerImpl;
 import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.NicVO;
@@ -65,8 +65,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
-import com.cloud.server.ConfigurationServer;
-import com.cloud.server.ConfigurationServerImpl;
 
 @Component
 @Local(value = {ContrailElement.class, StaticNatServiceProvider.class, IpDeployer.class, SourceNatServiceProvider.class})
@@ -196,7 +194,7 @@ public class ContrailElementImpl extends AdapterBase
             ipModel = new InstanceIpModel(vm.getInstanceName(), nic.getDeviceId());
             ipModel.addToVMInterface(vmiModel);
         }
-        ipModel.setAddress(nicProfile.getIp4Address());
+        ipModel.setAddress(nicProfile.getIPv4Address());
 
         try {
             vmModel.update(_manager.getModelController());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
index 427c279..8a86bc8 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
@@ -24,15 +24,11 @@ import java.util.List;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import net.juniper.contrail.api.types.MacAddressesType;
-import net.juniper.contrail.api.types.VirtualMachineInterface;
-
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.network.contrail.model.InstanceIpModel;
 import org.apache.cloudstack.network.contrail.model.VMInterfaceModel;
 import org.apache.cloudstack.network.contrail.model.VirtualMachineModel;
 import org.apache.cloudstack.network.contrail.model.VirtualNetworkModel;
+import org.apache.log4j.Logger;
 
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
@@ -73,6 +69,9 @@ import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
 
+import net.juniper.contrail.api.types.MacAddressesType;
+import net.juniper.contrail.api.types.VirtualMachineInterface;
+
 @Local(value = {NetworkGuru.class})
 public class ContrailGuru extends AdapterBase implements NetworkGuru {
     @Inject
@@ -193,14 +192,14 @@ public class ContrailGuru extends AdapterBase implements NetworkGuru {
     InsufficientAddressCapacityException, ConcurrentOperationException {
         s_logger.debug("allocate NicProfile on " + network.getName());
 
-        if (profile != null && profile.getRequestedIpv4() != null) {
+        if (profile != null && profile.getRequestedIPv4() != null) {
             throw new CloudRuntimeException("Does not support custom ip allocation at this time: " + profile);
         }
         if (profile == null) {
             profile = new NicProfile(ReservationStrategy.Create, null, null, null, null);
         }
 
-        profile.setStrategy(ReservationStrategy.Start);
+        profile.setReservationStrategy(ReservationStrategy.Start);
         URI broadcastUri = null;
         try {
             broadcastUri = new URI("vlan://untagged");
@@ -256,9 +255,9 @@ public class ContrailGuru extends AdapterBase implements NetworkGuru {
         } else {
             s_logger.debug("Reuse existing instance-ip object on " + ipModel.getName());
         }
-        if (nic.getIp4Address() != null) {
-            s_logger.debug("Nic using existing IP address " + nic.getIp4Address());
-            ipModel.setAddress(nic.getIp4Address());
+        if (nic.getIPv4Address() != null) {
+            s_logger.debug("Nic using existing IP address " + nic.getIPv4Address());
+            ipModel.setAddress(nic.getIPv4Address());
         }
 
         try {
@@ -282,13 +281,13 @@ public class ContrailGuru extends AdapterBase implements NetworkGuru {
             }
         }
 
-        if (nic.getIp4Address() == null) {
+        if (nic.getIPv4Address() == null) {
             s_logger.debug("Allocated IP address " + ipModel.getAddress());
-            nic.setIp4Address(ipModel.getAddress());
+            nic.setIPv4Address(ipModel.getAddress());
             if (network.getCidr() != null) {
-                nic.setNetmask(NetUtils.cidr2Netmask(network.getCidr()));
+                nic.setIPv4Netmask(NetUtils.cidr2Netmask(network.getCidr()));
             }
-            nic.setGateway(network.getGateway());
+            nic.setIPv4Gateway(network.getGateway());
             nic.setFormat(AddressFormat.Ip4);
         }
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java b/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java
index ccd2fb6..e1d9330 100644
--- a/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java
+++ b/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java
@@ -31,6 +31,7 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 import javax.ws.rs.core.MultivaluedMap;
 
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.log4j.Logger;
 import org.midonet.client.MidonetApi;
 import org.midonet.client.dto.DtoRule;
@@ -49,10 +50,6 @@ import org.midonet.client.resource.Rule;
 import org.midonet.client.resource.RuleChain;
 import org.springframework.stereotype.Component;
 
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-
 import com.cloud.agent.api.to.FirewallRuleTO;
 import com.cloud.agent.api.to.PortForwardingRuleTO;
 import com.cloud.configuration.Config;
@@ -87,6 +84,7 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
+import com.sun.jersey.core.util.MultivaluedMapImpl;
 
 @Component
 @Local(value = {NetworkElement.class, ConnectivityProvider.class, FirewallServiceProvider.class, SourceNatServiceProvider.class, DhcpServiceProvider.class,
@@ -430,7 +428,7 @@ public class MidoNetElement extends AdapterBase implements ConnectivityProvider,
             boolean isNewDhcpHost = true;
 
             for (DhcpHost dhcpHost : sub.getDhcpHosts()) {
-                if (dhcpHost.getIpAddr().equals(nic.getIp4Address())) {
+                if (dhcpHost.getIpAddr().equals(nic.getIPv4Address())) {
                     isNewDhcpHost = false;
                     break;
                 }
@@ -438,7 +436,7 @@ public class MidoNetElement extends AdapterBase implements ConnectivityProvider,
 
             if (isNewDhcpHost) {
                 DhcpHost host = sub.addDhcpHost();
-                host.ipAddr(nic.getIp4Address());
+                host.ipAddr(nic.getIPv4Address());
                 host.macAddr(nic.getMacAddress());
                 // This only sets the cloudstack internal name
                 host.name(vm.getHostName());
@@ -776,7 +774,7 @@ public class MidoNetElement extends AdapterBase implements ConnectivityProvider,
                 boolean routeExists = false;
                 for (Route route : providerRouter.getRoutes(new MultivaluedMapImpl())) {
                     String ip4 = route.getDstNetworkAddr();
-                    if (ip4 != null && ip4.equals(nic.getIp4Address())) {
+                    if (ip4 != null && ip4.equals(nic.getIPv4Address())) {
                         routeExists = true;
                         break;
                     }
@@ -788,7 +786,7 @@ public class MidoNetElement extends AdapterBase implements ConnectivityProvider,
                         .weight(100)
                         .srcNetworkAddr("0.0.0.0")
                         .srcNetworkLength(0)
-                        .dstNetworkAddr(nic.getIp4Address())
+                        .dstNetworkAddr(nic.getIPv4Address())
                         .dstNetworkLength(32)
                         .nextHopPort(providerDownlink.getId())
                         .nextHopGateway(null)
@@ -826,7 +824,7 @@ public class MidoNetElement extends AdapterBase implements ConnectivityProvider,
             //remove the routes associated with this IP address
             for (Route route : providerRouter.getRoutes(new MultivaluedMapImpl())) {
                 String routeDstAddr = route.getDstNetworkAddr();
-                if (routeDstAddr != null && routeDstAddr.equals(nic.getIp4Address())) {
+                if (routeDstAddr != null && routeDstAddr.equals(nic.getIPv4Address())) {
                     route.delete();
                 }
             }
@@ -1211,7 +1209,7 @@ public class MidoNetElement extends AdapterBase implements ConnectivityProvider,
             if (peerPort != null && peerPort instanceof RouterPort) {
                 RouterPort checkPort = (RouterPort)peerPort;
                 // Check it's a port on the providerRouter with the right gateway address
-                if (checkPort.getDeviceId().compareTo(providerRouter.getId()) == 0 && checkPort.getPortAddress().equals(nic.getGateway())) {
+                if (checkPort.getDeviceId().compareTo(providerRouter.getId()) == 0 && checkPort.getPortAddress().equals(nic.getIPv4Gateway())) {
                     providerDownlink = checkPort;
                     bridgeUplink = (BridgePort)api.getPort(checkPort.getPeerId());
                     break;
@@ -1221,10 +1219,10 @@ public class MidoNetElement extends AdapterBase implements ConnectivityProvider,
 
         // Create the ports and connection if they don't exist
         if (providerDownlink == null) {
-            String cidr = NetUtils.ipAndNetMaskToCidr(nic.getGateway(), nic.getNetmask());
+            String cidr = NetUtils.ipAndNetMaskToCidr(nic.getIPv4Gateway(), nic.getIPv4Netmask());
             String cidrSubnet = NetUtils.getCidrSubNet(cidr);
             int cidrSize = (int)NetUtils.getCidrSize(NetUtils.cidr2Netmask(cidr));
-            String gateway = nic.getGateway();
+            String gateway = nic.getIPv4Gateway();
 
             // Add interior port on router side, with network details
             providerDownlink = providerRouter.addInteriorRouterPort().networkAddress(cidrSubnet).networkLength(cidrSize).portAddress(gateway).create();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
index ee8fa27..bb1b6f9 100644
--- a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
+++ b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
@@ -94,15 +94,15 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     @Override
     protected void getIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapacityException,
         InsufficientAddressCapacityException, ConcurrentOperationException {
-        if (nic.getIp4Address() == null) {
+        if (nic.getIPv4Address() == null) {
             PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), Vlan.VlanType.VirtualNetwork, null, null, false);
-            nic.setIp4Address(ip.getAddress().addr());
+            nic.setIPv4Address(ip.getAddress().addr());
 
-            nic.setGateway(ip.getGateway());
+            nic.setIPv4Gateway(ip.getGateway());
 
             // Set netmask to /24 for now
             // TDO make it /32 and go via router for anything else on the subnet
-            nic.setNetmask("255.255.255.0");
+            nic.setIPv4Netmask("255.255.255.0");
 
             // Make it the default nic so that a default route is set up.
             nic.setDefaultNic(true);
@@ -115,8 +115,8 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
             nic.setMacAddress(ip.getMacAddress());
         }
 
-        nic.setDns1(dc.getDns1());
-        nic.setDns2(dc.getDns2());
+        nic.setIPv4Dns1(dc.getDns1());
+        nic.setIPv4Dns2(dc.getDns2());
     }
 
     @Override
@@ -125,8 +125,8 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
 
         DataCenter dc = _dcDao.findById(network.getDataCenterId());
         if (profile != null) {
-            profile.setDns1(dc.getDns1());
-            profile.setDns2(dc.getDns2());
+            profile.setIPv4Dns1(dc.getDns1());
+            profile.setIPv4Dns2(dc.getDns2());
         }
     }
 
@@ -140,18 +140,18 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
         s_logger.debug("allocate called with network: " + network + " nic: " + nic + " vm: " + vm);
         DataCenter dc = _dcDao.findById(network.getDataCenterId());
 
-        if (nic.getRequestedIpv4() != null) {
+        if (nic.getRequestedIPv4() != null) {
             throw new CloudRuntimeException("Does not support custom ip allocation at this time: " + nic);
         }
 
         getIp(nic, dc, vm, network);
 
-        if (nic.getIp4Address() == null) {
-            nic.setStrategy(Nic.ReservationStrategy.Start);
+        if (nic.getIPv4Address() == null) {
+            nic.setReservationStrategy(Nic.ReservationStrategy.Start);
         } else if (vm.getVirtualMachine().getType() == VirtualMachine.Type.DomainRouter) {
-            nic.setStrategy(Nic.ReservationStrategy.Managed);
+            nic.setReservationStrategy(Nic.ReservationStrategy.Managed);
         } else {
-            nic.setStrategy(Nic.ReservationStrategy.Create);
+            nic.setReservationStrategy(Nic.ReservationStrategy.Create);
         }
 
         nic.setBroadcastUri(generateBroadcastUri(network));
@@ -163,7 +163,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
         throws InsufficientVirtualNetworkCapacityException, InsufficientAddressCapacityException, ConcurrentOperationException {
         s_logger.debug("reserve called with network: " + network + " nic: " + nic + " vm: " + vm);
-        if (nic.getIp4Address() == null) {
+        if (nic.getIPv4Address() == null) {
             getIp(nic, dest.getDataCenter(), vm, network);
         }
     }
@@ -206,10 +206,10 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) {
         s_logger.debug("deallocate called with network: " + network + " nic: " + nic + " vm: " + vm);
         if (s_logger.isDebugEnabled()) {
-            s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIp4Address());
+            s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId() + ", ip: " + nic.getIPv4Address());
         }
 
-        final IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIp4Address());
+        final IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIPv4Address());
         if (ip != null && nic.getReservationStrategy() != Nic.ReservationStrategy.Managed) {
             Transaction.execute(new TransactionCallbackNoReturn() {
                 @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java b/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java
index 8434831..51e2b1b 100644
--- a/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java
+++ b/plugins/network-elements/midonet/test/com/cloud/network/element/MidoNetElementTest.java
@@ -30,8 +30,6 @@ import static org.mockito.Mockito.when;
 import java.util.ArrayList;
 import java.util.UUID;
 
-import junit.framework.TestCase;
-
 import org.midonet.client.MidonetApi;
 import org.midonet.client.resource.Bridge;
 import org.midonet.client.resource.BridgePort;
@@ -53,6 +51,8 @@ import com.cloud.vm.NicProfile;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
+import junit.framework.TestCase;
+
 public class MidoNetElementTest extends TestCase {
 
     /*
@@ -104,7 +104,7 @@ public class MidoNetElementTest extends TestCase {
 
         //mockNic
         NicProfile mockNic = mock(NicProfile.class);
-        when(mockNic.getIp4Address()).thenReturn("10.10.10.170");
+        when(mockNic.getIPv4Address()).thenReturn("10.10.10.170");
         when(mockNic.getMacAddress()).thenReturn("02:00:73:3e:00:01");
         when(mockNic.getName()).thenReturn("Fake Name");
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/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 99a80f8..6371023 100644
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -30,8 +30,6 @@ import java.util.TimeZone;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.affinity.AffinityGroup;
@@ -158,6 +156,7 @@ import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.usage.Usage;
 import org.apache.cloudstack.usage.UsageService;
 import org.apache.cloudstack.usage.UsageTypes;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.VgpuTypesInfo;
 import com.cloud.api.query.ViewResponseHelper;
@@ -1257,18 +1256,18 @@ public class ApiResponseHelper implements ResponseGenerator {
                 Network network = ApiDBUtils.findNetworkById(singleNicProfile.getNetworkId());
                 if (network != null) {
                     if (network.getTrafficType() == TrafficType.Management) {
-                        vmResponse.setPrivateIp(singleNicProfile.getIp4Address());
+                        vmResponse.setPrivateIp(singleNicProfile.getIPv4Address());
                         vmResponse.setPrivateMacAddress(singleNicProfile.getMacAddress());
-                        vmResponse.setPrivateNetmask(singleNicProfile.getNetmask());
+                        vmResponse.setPrivateNetmask(singleNicProfile.getIPv4Netmask());
                     } else if (network.getTrafficType() == TrafficType.Control) {
-                        vmResponse.setLinkLocalIp(singleNicProfile.getIp4Address());
+                        vmResponse.setLinkLocalIp(singleNicProfile.getIPv4Address());
                         vmResponse.setLinkLocalMacAddress(singleNicProfile.getMacAddress());
-                        vmResponse.setLinkLocalNetmask(singleNicProfile.getNetmask());
+                        vmResponse.setLinkLocalNetmask(singleNicProfile.getIPv4Netmask());
                     } else if (network.getTrafficType() == TrafficType.Public) {
-                        vmResponse.setPublicIp(singleNicProfile.getIp4Address());
+                        vmResponse.setPublicIp(singleNicProfile.getIPv4Address());
                         vmResponse.setPublicMacAddress(singleNicProfile.getMacAddress());
-                        vmResponse.setPublicNetmask(singleNicProfile.getNetmask());
-                        vmResponse.setGateway(singleNicProfile.getGateway());
+                        vmResponse.setPublicNetmask(singleNicProfile.getIPv4Netmask());
+                        vmResponse.setGateway(singleNicProfile.getIPv4Gateway());
                     } else if (network.getTrafficType() == TrafficType.Guest) {
                         /*
                           * In basic zone, public ip has TrafficType.Guest in case EIP service is not enabled.
@@ -1285,10 +1284,10 @@ public class ApiResponseHelper implements ResponseGenerator {
                                 vmResponse.setGateway(vlan.getVlanGateway());
                             }
                         } else {
-                            vmResponse.setPublicIp(singleNicProfile.getIp4Address());
+                            vmResponse.setPublicIp(singleNicProfile.getIPv4Address());
                             vmResponse.setPublicMacAddress(singleNicProfile.getMacAddress());
-                            vmResponse.setPublicNetmask(singleNicProfile.getNetmask());
-                            vmResponse.setGateway(singleNicProfile.getGateway());
+                            vmResponse.setPublicNetmask(singleNicProfile.getIPv4Netmask());
+                            vmResponse.setGateway(singleNicProfile.getIPv4Gateway());
                         }
                     }
                 }


Mime
View raw message