You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/01/14 19:00:34 UTC

[4/51] git commit: Summary: Add devcloud-kvm files

Summary: Add devcloud-kvm files

Detail: Working on getting a KVM-based devcloud so that development that
requires the KVM hypervisor can be simpler. This adds some setup devcloud files.

Signed-off-by: Marcus Sorensen <ma...@betterservers.com> 1357852438 -0700


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

Branch: refs/heads/ui-quick-view-v2
Commit: 1c59dae7087857858c91fc5497ee7a692833a2a2
Parents: 62a4272
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Thu Jan 10 14:13:58 2013 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Thu Jan 10 14:13:58 2013 -0700

----------------------------------------------------------------------
 pom.xml                             |    2 +
 tools/devcloud-kvm/README.md        |   21 +++++
 tools/devcloud-kvm/devcloud-kvm.cfg |   97 +++++++++++++++++++++
 tools/devcloud-kvm/devcloud-kvm.sql |   40 +++++++++
 tools/devcloud-kvm/pom.xml          |  138 ++++++++++++++++++++++++++++++
 5 files changed, 298 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1c59dae7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1dcf36f..aad124b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -245,6 +245,7 @@
               <exclude>scripts/vm/systemvm/id_rsa.cloud</exclude>
               <exclude>tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf</exclude>
               <exclude>tools/devcloud/devcloud.cfg</exclude>
+              <exclude>tools/devcloud-kvm/devcloud-kvm.cfg</exclude>
               <exclude>ui/lib/flot/jquery.colorhelpers.js</exclude>
               <exclude>ui/lib/flot/jquery.flot.crosshair.js</exclude>
               <exclude>ui/lib/flot/jquery.flot.fillbetween.js</exclude>
@@ -371,6 +372,7 @@
         <module>developer</module>
         <module>tools/apidoc</module>
         <module>tools/devcloud</module>
+        <module>tools/devcloud-kvm</module>
         <module>tools/marvin</module>
         <module>tools/cli</module>
       </modules>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1c59dae7/tools/devcloud-kvm/README.md
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/README.md b/tools/devcloud-kvm/README.md
new file mode 100644
index 0000000..3261fbe
--- /dev/null
+++ b/tools/devcloud-kvm/README.md
@@ -0,0 +1,21 @@
+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 directory hosts configs for setting up the devcloud-kvm
+environment.

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1c59dae7/tools/devcloud-kvm/devcloud-kvm.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/devcloud-kvm.cfg b/tools/devcloud-kvm/devcloud-kvm.cfg
new file mode 100644
index 0000000..47a128f
--- /dev/null
+++ b/tools/devcloud-kvm/devcloud-kvm.cfg
@@ -0,0 +1,97 @@
+{
+    "zones": [
+        {
+            "name": "DevCloudKVM0", 
+            "physical_networks": [
+                {
+                    "broadcastdomainrange": "Zone", 
+                    "name": "test-network", 
+                    "traffictypes": [
+                        {
+                            "typ": "Guest"
+                        }, 
+                        {
+                            "typ": "Management"
+                        } 
+                    ], 
+                    "providers": [
+                        {
+                            "broadcastdomainrange": "ZONE", 
+                            "name": "VirtualRouter"
+                        },
+                        {
+                            "broadcastdomainrange": "Pod",
+                            "name": "SecurityGroupProvider"
+                        }
+                    ]
+                }
+            ],
+            "dns2": "4.4.4.4", 
+            "dns1": "8.8.8.8",
+            "securitygroupenabled": "true", 
+            "localstorageenabled": "true",
+            "networktype": "Basic", 
+            "pods": [
+                {
+                    "endip": "192.168.100.250", 
+                    "name": "test00", 
+                    "startip": "192.168.100.200", 
+                    "guestIpRanges": [
+                        {
+                            "startip": "192.168.100.100", 
+                            "endip": "192.168.100.199", 
+                            "netmask": "255.255.255.0", 
+                            "gateway": "192.168.100.1"
+                        }
+                    ], 
+                    "netmask": "255.255.255.0", 
+                    "clusters": [
+                        {
+                            "clustername": "test000", 
+                            "hypervisor": "KVM", 
+                            "hosts": [
+                                {
+                                    "username": "root", 
+                                    "url": "http://192.168.100.10/", 
+                                    "password": "password"
+                                }
+                            ], 
+                            "clustertype": "CloudManaged"
+                        }
+                    ], 
+                    "gateway": "192.168.100.1"
+                }
+            ], 
+            "internaldns1": "192.168.100.10", 
+            "secondaryStorages": [
+                {
+                    "url": "nfs://192.168.100.10:/nfs/secondary"
+                }
+            ]
+        }
+    ], 
+    "logger": [
+        {
+            "name": "TestClient", 
+            "file": "/tmp/testclient.log"
+        }, 
+        {
+            "name": "TestCase", 
+            "file": "/tmp/testcase.log"
+        }
+    ], 
+    "mgtSvr": [
+        {
+            "mgtSvrIp": "127.0.0.1", 
+            "port": 8096
+        }
+    ],
+    "dbSvr": 
+        {
+	    "dbSvr": "127.0.0.1",
+	    "port": 3306,
+	    "user": "cloud",
+	    "passwd": "cloud",
+	    "db": "cloud"
+        }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1c59dae7/tools/devcloud-kvm/devcloud-kvm.sql
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/devcloud-kvm.sql b/tools/devcloud-kvm/devcloud-kvm.sql
new file mode 100644
index 0000000..eeba641
--- /dev/null
+++ b/tools/devcloud-kvm/devcloud-kvm.sql
@@ -0,0 +1,40 @@
+-- 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.
+
+
+INSERT INTO `cloud`.`disk_offering` (id, name, uuid, display_text, created, use_local_storage, type, disk_size) VALUES (17, 'tinyOffering', UUID(), 'tinyOffering', NOW(), 1, 'Service', 0);
+INSERT INTO `cloud`.`service_offering` (id, cpu, speed, ram_size) VALUES (17, 1, 100, 100);
+INSERT INTO `cloud`.`disk_offering` (id, name, uuid, display_text, created, type, disk_size) VALUES (18, 'tinyDiskOffering', UUID(), 'tinyDiskOffering', NOW(), 'Disk', 1073741824);
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','router.ram.size', '100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','router.cpu.mhz','100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','console.ram.size','100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','console.cpu.mhz', '100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','ssvm.ram.size','100');
+INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','ssvm.cpu.mhz','100');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'system.vm.use.local.storage', 'true');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.workers', '3');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.delay', '60');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.interval', '60');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'enable.ec2.api', 'true');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'enable.s3.api', 'true');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'host', '192.168.100.10');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'management.network.cidr', '192.168.100.0/24');
+INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'secstorage.allowed.internal.sites', '192.168.0.0/8');
+UPDATE `cloud`.`configuration` SET value='10' where name = 'storage.overprovisioning.factor';
+UPDATE `cloud`.`configuration` SET value='10' where name = 'cpu.overprovisioning.factor';
+UPDATE `cloud`.`configuration` SET value='10' where name = 'mem.overprovisioning.factor';
+UPDATE `cloud`.`vm_template` SET unique_name="tiny Linux",name="tiny Linux",url="https://dl.dropbox.com/u/678991/cloudstack-extras/ttylinux_pv.qcow2",checksum="81dcf4b4ca05a3b637a040e851568f29",display_text="tiny Linux",format='QCOW2',hypervisor_type='KVM' where id=5;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1c59dae7/tools/devcloud-kvm/pom.xml
----------------------------------------------------------------------
diff --git a/tools/devcloud-kvm/pom.xml b/tools/devcloud-kvm/pom.xml
new file mode 100644
index 0000000..c9af192
--- /dev/null
+++ b/tools/devcloud-kvm/pom.xml
@@ -0,0 +1,138 @@
+<!-- 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cloud-devcloud-kvm</artifactId>
+  <name>Apache CloudStack Developer Tools</name>
+  <packaging>pom</packaging>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloudstack</artifactId>
+    <version>4.1.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+  <dependencies>
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>5.1.21</version>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+  </build>
+  <profiles>
+    <profile>
+      <id>deploydb</id>
+      <activation>
+        <property>
+          <name>deploydb</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>properties-maven-plugin</artifactId>
+            <version>1.0-alpha-2</version>
+            <executions>
+              <execution>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>read-project-properties</goal>
+                </goals>
+                <configuration>
+                  <files>
+                    <file>${project.parent.basedir}/utils/conf/db.properties</file>
+                    <file>${project.parent.basedir}/utils/conf/db.properties.override</file>
+                  </files>
+                  <quiet>true</quiet>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>sql-maven-plugin</artifactId>
+            <version>1.5</version>
+            <dependencies>
+              <!-- specify the dependent jdbc driver here -->
+              <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${cs.mysql.version}</version>
+              </dependency>
+            </dependencies>
+            <configuration>
+              <driver>org.gjt.mm.mysql.Driver</driver>
+              <url>jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud</url>
+              <username>${db.cloud.username}</username>
+              <password>${db.cloud.password}</password>
+              <!--all executions are ignored if -Dmaven.test.skip=true -->
+              <skip>${maven.test.skip}</skip>
+              <forceMojoExecution>true</forceMojoExecution>
+            </configuration>
+            <executions>
+              <execution>
+                <id>create-schema</id>
+                <phase>process-test-resources</phase>
+                <goals>
+                  <goal>execute</goal>
+                </goals>
+                <configuration>
+                  <srcFiles>
+                    <srcFile>${basedir}/devcloud-kvm.sql</srcFile>
+                  </srcFiles>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>deploysvr</id>
+      <activation>
+        <property>
+          <name>deploysvr</name>
+        </property>
+      </activation>
+      <build> 
+        <plugins>
+          <plugin>
+         <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <executable>python</executable>
+          <arguments>
+            <argument>../marvin/marvin/deployDataCenter.py</argument>
+            <argument>-i</argument>
+            <argument>devcloud-kvm.cfg</argument>
+          </arguments>
+        </configuration>
+          </plugin>
+        </plugins>
+      </build> 
+    </profile>
+  </profiles>
+</project>