You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/05/04 21:16:26 UTC
[1/2] git commit: updated refs/heads/4.4-forward to c9e2012
Repository: cloudstack
Updated Branches:
refs/heads/4.4-forward 5c2ddb248 -> c9e201229
- Created new devcloud advanced networking config file (devcloud-advanced_juniper-contrail.cfg). - Modification to deployDataCenter script, to enable "JuniperContrailRouter" & "JuniperContrailVpcRouter" providers.
Signed-off-by: Daan Hoogland <da...@onecht.net>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/df32c86a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/df32c86a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/df32c86a
Branch: refs/heads/4.4-forward
Commit: df32c86a1732b80f356012ae3a06cd59dfea56ac
Parents: 5c2ddb2
Author: Sachchidanand Vaidya <va...@juniper.net>
Authored: Fri May 2 16:22:14 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Sun May 4 21:14:26 2014 +0200
----------------------------------------------------------------------
.../devcloud-advanced_juniper-contrail.cfg | 123 +++++++++++++++++++
tools/marvin/marvin/deployDataCenter.py | 7 ++
2 files changed, 130 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df32c86a/tools/devcloud/devcloud-advanced_juniper-contrail.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloud-advanced_juniper-contrail.cfg b/tools/devcloud/devcloud-advanced_juniper-contrail.cfg
new file mode 100644
index 0000000..35b551a2
--- /dev/null
+++ b/tools/devcloud/devcloud-advanced_juniper-contrail.cfg
@@ -0,0 +1,123 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# This configuration is meant for running advanced networking , with management server on the laptop,
+# It requires that the user run a DNS resolver within devcloud via 'apt-get install dnsmasq'
+#
+#
+{
+ "zones": [
+ {
+ "localstorageenabled": "true",
+ "name": "default",
+ "dns1": "8.8.8.8",
+ "physical_networks": [
+ {
+ "broadcastdomainrange": "Zone",
+ "name": "ip-fabric",
+ "traffictypes": [
+ {
+ "xen": "Pool-wide network associated with eth0",
+ "typ": "Management"
+ },
+ {
+ "xen": "Pool-wide network associated with eth0",
+ "typ": "Guest"
+ },
+ {
+ "xen": "Pool-wide network associated with eth1",
+ "typ": "Public"
+ }
+ ],
+ "providers": [
+ {
+ "broadcastdomainrange": "ZONE",
+ "name": "JuniperContrailRouter"
+ }
+ ],
+ "isolationmethods": [
+ "L3VPN"
+ ]
+ }
+ ],
+ "ipranges": [
+ {
+ "startip": "10.0.3.100",
+ "endip": "10.0.3.199",
+ "netmask": "255.255.255.0",
+ "vlan": "untagged",
+ "gateway": "10.0.3.2"
+ }
+ ],
+ "networktype": "Advanced",
+ "pods": [
+ {
+ "endip": "192.168.56.249",
+ "name": "a6",
+ "startip": "192.168.56.200",
+ "netmask": "255.255.255.0",
+ "clusters": [
+ {
+ "clustername": "a6-xen",
+ "hypervisor": "XenServer",
+ "hosts": [
+ {
+ "username": "root",
+ "url": "http://192.168.56.10/",
+ "password": "password"
+ }
+ ],
+ "clustertype": "CloudManaged"
+ }
+ ],
+ "gateway": "192.168.56.1"
+ }
+ ],
+ "internaldns1": "192.168.56.10",
+ "secondaryStorages": [
+ {
+ "url": "nfs://192.168.56.10:/opt/storage/secondary",
+ "provider": "NFS",
+ "details": [ ]
+ }
+ ]
+ }
+ ],
+ "dbSvr": {
+ "dbSvr": "127.0.0.1",
+ "passwd": "cloud",
+ "db": "cloud",
+ "port": 3306,
+ "user": "cloud"
+ },
+ "logger": [
+ {
+ "name": "TestClient",
+ "file": "/var/log/testclient.log"
+ },
+ {
+ "name": "TestCase",
+ "file": "/var/log/testcase.log"
+ }
+ ],
+ "mgtSvr": [
+ {
+ "mgtSvrIp": "127.0.0.1",
+ "port": 8096
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df32c86a/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index c4f6e1e..e5a0749 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -300,6 +300,13 @@ class deployDataCenters(object):
self.enableProvider(pnetprovres[0].id)
elif provider.name == 'SecurityGroupProvider':
self.enableProvider(pnetprovres[0].id)
+ elif provider.name in ['JuniperContrailRouter', 'JuniperContrailVpcRouter']:
+ netprov = addNetworkServiceProvider.\
+ addNetworkServiceProviderCmd()
+ netprov.name = provider.name
+ netprov.physicalnetworkid = phynetwrk.id
+ result = self.apiClient.addNetworkServiceProvider(netprov)
+ self.enableProvider(result.id)
elif provider.name in ['Netscaler', 'JuniperSRX', 'F5BigIp']:
netprov = addNetworkServiceProvider.\
addNetworkServiceProviderCmd()
[2/2] git commit: updated refs/heads/4.4-forward to c9e2012
Posted by da...@apache.org.
Revert "Add OpenContrail support to devCloud environment"
This reverts commit 5c2ddb24886a6698492acfc418b7408d4511d3c8.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c9e20122
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c9e20122
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c9e20122
Branch: refs/heads/4.4-forward
Commit: c9e201229e0879d5708bf035ea74b9d486112899
Parents: df32c86
Author: Daan Hoogland <da...@onecht.net>
Authored: Sun May 4 21:15:08 2014 +0200
Committer: Daan Hoogland <da...@onecht.net>
Committed: Sun May 4 21:15:08 2014 +0200
----------------------------------------------------------------------
.../contrail/model/InstanceIpModelTest.java | 139 ------------------
.../contrail/model/VMInterfaceModelTest.java | 143 -------------------
2 files changed, 282 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c9e20122/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java
deleted file mode 100644
index a996900..0000000
--- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/InstanceIpModelTest.java
+++ /dev/null
@@ -1,139 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package org.apache.cloudstack.network.contrail.model;
-import java.util.UUID;
-
-import java.io.IOException;
-
-import org.apache.cloudstack.network.contrail.management.ContrailManagerImpl;
-import org.apache.log4j.Logger;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.anyLong;
-import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.anyString;
-
-import com.cloud.network.Network;
-import com.cloud.network.Networks.TrafficType;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.network.dao.NetworkDao;
-import com.cloud.vm.NicVO;
-import com.cloud.vm.VMInstanceVO;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.dao.UserVmDao;
-
-import net.juniper.contrail.api.ApiConnectorMock;
-import net.juniper.contrail.api.ApiConnector;
-
-import org.junit.Test;
-import junit.framework.TestCase;
-
-public class InstanceIpModelTest extends TestCase {
- private static final Logger s_logger =
- Logger.getLogger(InstanceIpModelTest.class);
-
- @Test
- public void testCreateInstanceIp() throws IOException {
-
- ContrailManagerImpl contrailMgr = mock(ContrailManagerImpl.class);
- ModelController controller = mock(ModelController.class);
- ApiConnector api = new ApiConnectorMock(null, 0);
- when(controller.getApiAccessor()).thenReturn(api);
- when(controller.getManager()).thenReturn(contrailMgr);
-
- // Create Virtual-Network (VN)
- NetworkVO network = mock(NetworkVO.class);
- when(network.getName()).thenReturn("testnetwork");
- when(network.getState()).thenReturn(Network.State.Implemented);
- when(network.getGateway()).thenReturn("10.1.1.1");
- when(network.getCidr()).thenReturn("10.1.1.0/24");
- when(network.getPhysicalNetworkId()).thenReturn(42L);
- when(network.getDomainId()).thenReturn(10L);
- when(network.getAccountId()).thenReturn(42L);
- NetworkDao networkDao = mock(NetworkDao.class);
- when(networkDao.findById(anyLong())).thenReturn(network);
- when(controller.getNetworkDao()).thenReturn(networkDao);
-
- when(contrailMgr.getCanonicalName(network)).thenReturn("testnetwork");
- when(contrailMgr.getProjectId(network.getDomainId(), network.getAccountId())).thenReturn("testProjectId");
-
- VirtualNetworkModel vnModel = new VirtualNetworkModel(network, UUID.randomUUID().toString(), "test",
- TrafficType.Guest);
- vnModel.build(controller, network);
- try {
- vnModel.update(controller);
- } catch (Exception ex) {
- fail("virtual-network update failed ");
- }
-
- // Create Virtual-Machine (VM)
- VMInstanceVO vm = mock(VMInstanceVO.class);
- when(vm.getInstanceName()).thenReturn("testVM1");
- when(vm.getState()).thenReturn(VirtualMachine.State.Running);
- when(vm.getDomainId()).thenReturn(10L);
- when(vm.getAccountId()).thenReturn(42L);
- UserVmDao VmDao = mock(UserVmDao.class);
- when(VmDao.findById(anyLong())).thenReturn(null);
- when(controller.getVmDao()).thenReturn(VmDao);
-
- VirtualMachineModel vmModel = new VirtualMachineModel(vm, UUID.randomUUID().toString());
- vmModel.build(controller, vm);
- try {
- vmModel.update(controller);
- } catch (Exception ex) {
- fail("virtual-machine update failed ");
- }
-
- // Create Virtual=Machine-Interface (VMInterface)
- NicVO nic = mock(NicVO.class);
- when(nic.getIp4Address()).thenReturn("10.1.1.2");
- when(nic.getMacAddress()).thenReturn("00:01:02:03:04:05");
- when(nic.getDeviceId()).thenReturn(100);
- when(nic.getState()).thenReturn(NicVO.State.Allocated);
- when(nic.getNetworkId()).thenReturn(10L);
-
- when(contrailMgr.getVifNameByVmName(anyString(), anyInt())).thenReturn("testVM1-100");
-
- VMInterfaceModel vmiModel = new VMInterfaceModel(UUID.randomUUID().toString());
- vmiModel.addToVirtualMachine(vmModel);
- vmiModel.addToVirtualNetwork(vnModel);
-
- try {
- vmiModel.build(controller, vm, nic);
- vmiModel.setActive();
- } catch (Exception ex) {
- fail("vm-interface build failed ");
- }
-
- try {
- vmiModel.update(controller);
- } catch (Exception ex) {
- fail("vm-interface update failed ");
- }
- InstanceIpModel ipModel = new InstanceIpModel(vm.getInstanceName(), nic.getDeviceId());
- ipModel.addToVMInterface(vmiModel);
- ipModel.setAddress(nic.getIp4Address());
-
- try {
- ipModel.update(controller);
- } catch (Exception ex) {
- fail("ipInstance update failed ");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c9e20122/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java
deleted file mode 100644
index ebc1f76..0000000
--- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/model/VMInterfaceModelTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package org.apache.cloudstack.network.contrail.model;
-import java.util.UUID;
-import java.io.IOException;
-
-import org.apache.cloudstack.network.contrail.management.ContrailManagerImpl;
-import org.apache.log4j.Logger;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.anyLong;
-import static org.mockito.Mockito.anyString;
-import static org.mockito.Mockito.anyInt;
-
-import com.cloud.network.Network;
-import com.cloud.network.Networks.TrafficType;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.network.dao.NetworkDao;
-import com.cloud.vm.NicVO;
-import com.cloud.vm.VMInstanceVO;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.dao.UserVmDao;
-
-import net.juniper.contrail.api.ApiConnectorMock;
-import net.juniper.contrail.api.types.VirtualMachineInterface;
-import net.juniper.contrail.api.ApiConnector;
-
-import org.junit.Test;
-import junit.framework.TestCase;
-
-public class VMInterfaceModelTest extends TestCase {
- private static final Logger s_logger =
- Logger.getLogger(VMInterfaceModelTest.class);
-
- @Test
- public void testCreateVMInterface() throws IOException {
-
- String uuid;
- ContrailManagerImpl contrailMgr = mock(ContrailManagerImpl.class);
- ModelController controller = mock(ModelController.class);
- ApiConnector api = new ApiConnectorMock(null, 0);
- when(controller.getManager()).thenReturn(contrailMgr);
- when(controller.getApiAccessor()).thenReturn(api);
-
- // Create Virtual-Network (VN)
- NetworkVO network = mock(NetworkVO.class);
- when(network.getName()).thenReturn("testnetwork");
- when(network.getState()).thenReturn(Network.State.Implemented);
- when(network.getGateway()).thenReturn("10.1.1.1");
- when(network.getCidr()).thenReturn("10.1.1.0/24");
- when(network.getPhysicalNetworkId()).thenReturn(42L);
- when(network.getDomainId()).thenReturn(10L);
- when(network.getAccountId()).thenReturn(42L);
- NetworkDao networkDao = mock(NetworkDao.class);
- when(networkDao.findById(anyLong())).thenReturn(network);
- when(controller.getNetworkDao()).thenReturn(networkDao);
-
- when(contrailMgr.getCanonicalName(network)).thenReturn("testnetwork");
- when(contrailMgr.getProjectId(network.getDomainId(), network.getAccountId())).thenReturn("testProjectId");
-
- VirtualNetworkModel vnModel = new VirtualNetworkModel(network, UUID.randomUUID().toString(),
- "test", TrafficType.Guest);
- vnModel.build(controller, network);
- try {
- vnModel.update(controller);
- } catch (Exception ex) {
- fail("virtual-network update failed ");
- }
-
- // Create Virtual-Machine (VM)
- VMInstanceVO vm = mock(VMInstanceVO.class);
- when(vm.getInstanceName()).thenReturn("testVM1");
- when(vm.getState()).thenReturn(VirtualMachine.State.Running);
- when(vm.getDomainId()).thenReturn(10L);
- when(vm.getAccountId()).thenReturn(42L);
- UserVmDao VmDao = mock(UserVmDao.class);
- when(VmDao.findById(anyLong())).thenReturn(null);
- when(controller.getVmDao()).thenReturn(VmDao);
-
- VirtualMachineModel vmModel = new VirtualMachineModel(vm, UUID.randomUUID().toString());
- vmModel.build(controller, vm);
- try {
- vmModel.update(controller);
- } catch (Exception ex) {
- fail("virtual-machine update failed ");
- }
-
- // Create Virtual=Machine-Interface (VMInterface)
- NicVO nic = mock(NicVO.class);
- when(nic.getIp4Address()).thenReturn("10.1.1.2");
- when(nic.getMacAddress()).thenReturn("00:01:02:03:04:05");
- when(nic.getDeviceId()).thenReturn(100);
- when(nic.getState()).thenReturn(NicVO.State.Allocated);
- when(nic.getNetworkId()).thenReturn(10L);
-
- when(contrailMgr.getVifNameByVmName(anyString(), anyInt())).thenReturn("testVM1-100");
-
- uuid = UUID.randomUUID().toString();
- VMInterfaceModel vmiModel = new VMInterfaceModel(uuid);
-
- assertEquals(uuid, vmiModel.getUuid());
-
- vmiModel.addToVirtualMachine(vmModel);
- vmiModel.addToVirtualNetwork(vnModel);
-
- try {
- vmiModel.build(controller, vm, nic);
- vmiModel.setActive();
- } catch (Exception ex) {
- fail("vm-interface build failed ");
- }
-
- try {
- vmiModel.update(controller);
- } catch (Exception ex) {
- fail("vm-interface update failed ");
- }
-
- // Verify virtual-machine-interface creation.
- try {
- VirtualMachineInterface vmi = (VirtualMachineInterface) api.findById(VirtualMachineInterface.class, vmiModel.getUuid());
- assertNotNull(vmi);
- } catch (Exception ex) {
- fail("vm-interface verify failed ");
- }
- }
-}