cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject [1/2] git commit: updated refs/heads/cisco-vnmc-api-integration to 5a427d4
Date Wed, 27 Mar 2013 04:24:42 GMT
Updated Branches:
  refs/heads/cisco-vnmc-api-integration 2c386c61e -> 5a427d48e


Passing correct gateway ip while creating vservice node and guest port profile in Nexus


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

Branch: refs/heads/cisco-vnmc-api-integration
Commit: 48cbf34d3bf44a5601842fa8bbc41be6beea3b07
Parents: 2c386c6
Author: Koushik Das <koushik.das@citrix.com>
Authored: Wed Mar 27 02:20:45 2013 +0530
Committer: Koushik Das <koushik.das@citrix.com>
Committed: Wed Mar 27 02:20:45 2013 +0530

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java |    4 ++--
 .../hypervisor/vmware/mo/HypervisorHostHelper.java |   13 ++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48cbf34d/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 98847c1..be683a0 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -1570,7 +1570,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                     vmMo.getRunningHost(), vlanId, null, null, this._ops_timeout, true);
         } else {
             networkInfo = HypervisorHostHelper.prepareNetwork(this._publicTrafficInfo.getVirtualSwitchName(),
"cloud.public",
-                    vmMo.getRunningHost(), vlanId, null, null, this._ops_timeout, vSwitchType,
_portsPerDvPortGroup, false);
+                    vmMo.getRunningHost(), vlanId, null, null, this._ops_timeout, vSwitchType,
_portsPerDvPortGroup, null, false);
         }
 
         int nicIndex = allocPublicNicIndex(vmMo);
@@ -2517,7 +2517,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         }
         else {
             networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix,
hostMo, getVlanInfo(nicTo, switchName.second()),
-                    nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout,
switchType, _portsPerDvPortGroup, configureVServiceInNexus);
+                    nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout,
switchType, _portsPerDvPortGroup, nicTo.getGateway(), configureVServiceInNexus);
         }
 
         return networkInfo;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48cbf34d/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index fa6938a..7f323c5 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -163,7 +163,8 @@ public class HypervisorHostHelper {
     }
 
     public static void createPortProfile(VmwareContext context, String ethPortProfileName,
String networkName,
-            Integer vlanId, Integer networkRateMbps, long peakBandwidth, long burstSize,
boolean configureVServiceInNexus) throws Exception {
+            Integer vlanId, Integer networkRateMbps, long peakBandwidth, long burstSize,
+            String gateway, boolean configureVServiceInNexus) throws Exception {
         Map<String, String> vsmCredentials = getValidatedVsmCredentials(context);
         String vsmIp = vsmCredentials.get("vsmip");
         String vsmUserName = vsmCredentials.get("vsmusername");
@@ -233,14 +234,16 @@ public class HypervisorHostHelper {
                 s_logger.info("Adding port profile configured over untagged VLAN.");
                 netconfClient.addPortProfile(networkName, PortProfileType.vethernet, BindingType.portbindingstatic,
SwitchPortMode.access, 0);
             } else {
-                s_logger.info("Adding port profile configured over VLAN : " + vlanId.toString());
                 if (!configureVServiceInNexus) {
+                    s_logger.info("Adding port profile configured over VLAN : " + vlanId.toString());
                     netconfClient.addPortProfile(networkName, PortProfileType.vethernet,
BindingType.portbindingstatic, SwitchPortMode.access, vlanId.intValue());
                 } else {
                     String tenant = "vlan-" + vlanId.intValue();
                     String vdc = "root/" + tenant + "/VDC-" + tenant;
                     String esp = "ESP-" + tenant;
-                    netconfClient.addVServiceNode(vlanId.toString(), "10.1.1.1");
+                    s_logger.info("Adding vservice node in Nexus VSM for VLAN : " + vlanId.toString());
+                    netconfClient.addVServiceNode(vlanId.toString(), gateway);
+                    s_logger.info("Adding port profile with vservice details configured over
VLAN : " + vlanId.toString());
                     netconfClient.addPortProfile(networkName, PortProfileType.vethernet,
BindingType.portbindingstatic, SwitchPortMode.access, vlanId.intValue(), vdc, esp);
                 }
             }
@@ -410,7 +413,7 @@ public class HypervisorHostHelper {
 
     public static Pair<ManagedObjectReference, String> prepareNetwork(String physicalNetwork,
String namePrefix,
             HostMO hostMo, String vlanId, Integer networkRateMbps, Integer networkRateMulticastMbps,
long timeOutMs,
-            VirtualSwitchType vSwitchType, int numPorts, boolean configureVServiceInNexus)
throws Exception {
+            VirtualSwitchType vSwitchType, int numPorts, String gateway, boolean configureVServiceInNexus)
throws Exception {
         ManagedObjectReference morNetwork = null;
         VmwareContext context = hostMo.getContext();
         ManagedObjectReference dcMor = hostMo.getHyperHostDatacenter();
@@ -524,7 +527,7 @@ public class HypervisorHostHelper {
 
             if (!dataCenterMo.hasDvPortGroup(networkName)) {
                 s_logger.info("Port profile " + networkName + " not found.");
-                createPortProfile(context, physicalNetwork, networkName, vid, networkRateMbps,
peakBandwidth, burstSize, configureVServiceInNexus);
+                createPortProfile(context, physicalNetwork, networkName, vid, networkRateMbps,
peakBandwidth, burstSize, gateway, configureVServiceInNexus);
                 bWaitPortGroupReady = true;
             } else {
                 s_logger.info("Port profile " + networkName + " found.");


Mime
View raw message