Skip to content

Commit 1c59dae

Browse files
author
Marcus Sorensen
committed
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 <[email protected]> 1357852438 -0700
1 parent 62a4272 commit 1c59dae

5 files changed

Lines changed: 298 additions & 0 deletions

File tree

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@
245245
<exclude>scripts/vm/systemvm/id_rsa.cloud</exclude>
246246
<exclude>tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf</exclude>
247247
<exclude>tools/devcloud/devcloud.cfg</exclude>
248+
<exclude>tools/devcloud-kvm/devcloud-kvm.cfg</exclude>
248249
<exclude>ui/lib/flot/jquery.colorhelpers.js</exclude>
249250
<exclude>ui/lib/flot/jquery.flot.crosshair.js</exclude>
250251
<exclude>ui/lib/flot/jquery.flot.fillbetween.js</exclude>
@@ -371,6 +372,7 @@
371372
<module>developer</module>
372373
<module>tools/apidoc</module>
373374
<module>tools/devcloud</module>
375+
<module>tools/devcloud-kvm</module>
374376
<module>tools/marvin</module>
375377
<module>tools/cli</module>
376378
</modules>

tools/devcloud-kvm/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Licensed to the Apache Software Foundation (ASF) under one
2+
or more contributor license agreements. See the NOTICE file
3+
distributed with this work for additional information
4+
regarding copyright ownership. The ASF licenses this file
5+
to you under the Apache License, Version 2.0 (the
6+
"License"); you may not use this file except in compliance
7+
with the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing,
12+
software distributed under the License is distributed on an
13+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
KIND, either express or implied. See the License for the
15+
specific language governing permissions and limitations
16+
under the License.
17+
18+
===========================================================
19+
20+
This directory hosts configs for setting up the devcloud-kvm
21+
environment.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"zones": [
3+
{
4+
"name": "DevCloudKVM0",
5+
"physical_networks": [
6+
{
7+
"broadcastdomainrange": "Zone",
8+
"name": "test-network",
9+
"traffictypes": [
10+
{
11+
"typ": "Guest"
12+
},
13+
{
14+
"typ": "Management"
15+
}
16+
],
17+
"providers": [
18+
{
19+
"broadcastdomainrange": "ZONE",
20+
"name": "VirtualRouter"
21+
},
22+
{
23+
"broadcastdomainrange": "Pod",
24+
"name": "SecurityGroupProvider"
25+
}
26+
]
27+
}
28+
],
29+
"dns2": "4.4.4.4",
30+
"dns1": "8.8.8.8",
31+
"securitygroupenabled": "true",
32+
"localstorageenabled": "true",
33+
"networktype": "Basic",
34+
"pods": [
35+
{
36+
"endip": "192.168.100.250",
37+
"name": "test00",
38+
"startip": "192.168.100.200",
39+
"guestIpRanges": [
40+
{
41+
"startip": "192.168.100.100",
42+
"endip": "192.168.100.199",
43+
"netmask": "255.255.255.0",
44+
"gateway": "192.168.100.1"
45+
}
46+
],
47+
"netmask": "255.255.255.0",
48+
"clusters": [
49+
{
50+
"clustername": "test000",
51+
"hypervisor": "KVM",
52+
"hosts": [
53+
{
54+
"username": "root",
55+
"url": "http://192.168.100.10/",
56+
"password": "password"
57+
}
58+
],
59+
"clustertype": "CloudManaged"
60+
}
61+
],
62+
"gateway": "192.168.100.1"
63+
}
64+
],
65+
"internaldns1": "192.168.100.10",
66+
"secondaryStorages": [
67+
{
68+
"url": "nfs://192.168.100.10:/nfs/secondary"
69+
}
70+
]
71+
}
72+
],
73+
"logger": [
74+
{
75+
"name": "TestClient",
76+
"file": "/tmp/testclient.log"
77+
},
78+
{
79+
"name": "TestCase",
80+
"file": "/tmp/testcase.log"
81+
}
82+
],
83+
"mgtSvr": [
84+
{
85+
"mgtSvrIp": "127.0.0.1",
86+
"port": 8096
87+
}
88+
],
89+
"dbSvr":
90+
{
91+
"dbSvr": "127.0.0.1",
92+
"port": 3306,
93+
"user": "cloud",
94+
"passwd": "cloud",
95+
"db": "cloud"
96+
}
97+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- Licensed to the Apache Software Foundation (ASF) under one
2+
-- or more contributor license agreements. See the NOTICE file
3+
-- distributed with this work for additional information
4+
-- regarding copyright ownership. The ASF licenses this file
5+
-- to you under the Apache License, Version 2.0 (the
6+
-- "License"); you may not use this file except in compliance
7+
-- with the License. You may obtain a copy of the License at
8+
--
9+
-- http://www.apache.org/licenses/LICENSE-2.0
10+
--
11+
-- Unless required by applicable law or agreed to in writing,
12+
-- software distributed under the License is distributed on an
13+
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
-- KIND, either express or implied. See the License for the
15+
-- specific language governing permissions and limitations
16+
-- under the License.
17+
18+
19+
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);
20+
INSERT INTO `cloud`.`service_offering` (id, cpu, speed, ram_size) VALUES (17, 1, 100, 100);
21+
INSERT INTO `cloud`.`disk_offering` (id, name, uuid, display_text, created, type, disk_size) VALUES (18, 'tinyDiskOffering', UUID(), 'tinyDiskOffering', NOW(), 'Disk', 1073741824);
22+
INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','router.ram.size', '100');
23+
INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','router.cpu.mhz','100');
24+
INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','console.ram.size','100');
25+
INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','console.cpu.mhz', '100');
26+
INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','ssvm.ram.size','100');
27+
INSERT INTO `cloud`.`configuration` (instance, name,value) VALUE('DEFAULT','ssvm.cpu.mhz','100');
28+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'system.vm.use.local.storage', 'true');
29+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.workers', '3');
30+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.delay', '60');
31+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'expunge.interval', '60');
32+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'enable.ec2.api', 'true');
33+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'enable.s3.api', 'true');
34+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'host', '192.168.100.10');
35+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'management.network.cidr', '192.168.100.0/24');
36+
INSERT INTO `cloud`.`configuration` (instance, name, value) VALUE('DEFAULT', 'secstorage.allowed.internal.sites', '192.168.0.0/8');
37+
UPDATE `cloud`.`configuration` SET value='10' where name = 'storage.overprovisioning.factor';
38+
UPDATE `cloud`.`configuration` SET value='10' where name = 'cpu.overprovisioning.factor';
39+
UPDATE `cloud`.`configuration` SET value='10' where name = 'mem.overprovisioning.factor';
40+
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;

tools/devcloud-kvm/pom.xml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to
4+
you under the Apache License, Version 2.0 (the "License"); you may not use
5+
this file except in compliance with the License. You may obtain a copy of
6+
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
7+
by applicable law or agreed to in writing, software distributed under the
8+
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9+
OF ANY KIND, either express or implied. See the License for the specific
10+
language governing permissions and limitations under the License. -->
11+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
13+
<modelVersion>4.0.0</modelVersion>
14+
<artifactId>cloud-devcloud-kvm</artifactId>
15+
<name>Apache CloudStack Developer Tools</name>
16+
<packaging>pom</packaging>
17+
<parent>
18+
<groupId>org.apache.cloudstack</groupId>
19+
<artifactId>cloudstack</artifactId>
20+
<version>4.1.0-SNAPSHOT</version>
21+
<relativePath>../../pom.xml</relativePath>
22+
</parent>
23+
<dependencies>
24+
<dependency>
25+
<groupId>mysql</groupId>
26+
<artifactId>mysql-connector-java</artifactId>
27+
<version>5.1.21</version>
28+
<scope>runtime</scope>
29+
</dependency>
30+
</dependencies>
31+
32+
<build>
33+
<defaultGoal>install</defaultGoal>
34+
</build>
35+
<profiles>
36+
<profile>
37+
<id>deploydb</id>
38+
<activation>
39+
<property>
40+
<name>deploydb</name>
41+
</property>
42+
</activation>
43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.codehaus.mojo</groupId>
47+
<artifactId>properties-maven-plugin</artifactId>
48+
<version>1.0-alpha-2</version>
49+
<executions>
50+
<execution>
51+
<phase>initialize</phase>
52+
<goals>
53+
<goal>read-project-properties</goal>
54+
</goals>
55+
<configuration>
56+
<files>
57+
<file>${project.parent.basedir}/utils/conf/db.properties</file>
58+
<file>${project.parent.basedir}/utils/conf/db.properties.override</file>
59+
</files>
60+
<quiet>true</quiet>
61+
</configuration>
62+
</execution>
63+
</executions>
64+
</plugin>
65+
<plugin>
66+
<groupId>org.codehaus.mojo</groupId>
67+
<artifactId>sql-maven-plugin</artifactId>
68+
<version>1.5</version>
69+
<dependencies>
70+
<!-- specify the dependent jdbc driver here -->
71+
<dependency>
72+
<groupId>mysql</groupId>
73+
<artifactId>mysql-connector-java</artifactId>
74+
<version>${cs.mysql.version}</version>
75+
</dependency>
76+
</dependencies>
77+
<configuration>
78+
<driver>org.gjt.mm.mysql.Driver</driver>
79+
<url>jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud</url>
80+
<username>${db.cloud.username}</username>
81+
<password>${db.cloud.password}</password>
82+
<!--all executions are ignored if -Dmaven.test.skip=true -->
83+
<skip>${maven.test.skip}</skip>
84+
<forceMojoExecution>true</forceMojoExecution>
85+
</configuration>
86+
<executions>
87+
<execution>
88+
<id>create-schema</id>
89+
<phase>process-test-resources</phase>
90+
<goals>
91+
<goal>execute</goal>
92+
</goals>
93+
<configuration>
94+
<srcFiles>
95+
<srcFile>${basedir}/devcloud-kvm.sql</srcFile>
96+
</srcFiles>
97+
</configuration>
98+
</execution>
99+
</executions>
100+
</plugin>
101+
</plugins>
102+
</build>
103+
</profile>
104+
<profile>
105+
<id>deploysvr</id>
106+
<activation>
107+
<property>
108+
<name>deploysvr</name>
109+
</property>
110+
</activation>
111+
<build>
112+
<plugins>
113+
<plugin>
114+
<groupId>org.codehaus.mojo</groupId>
115+
<artifactId>exec-maven-plugin</artifactId>
116+
<version>1.2.1</version>
117+
<executions>
118+
<execution>
119+
<phase>package</phase>
120+
<goals>
121+
<goal>exec</goal>
122+
</goals>
123+
</execution>
124+
</executions>
125+
<configuration>
126+
<executable>python</executable>
127+
<arguments>
128+
<argument>../marvin/marvin/deployDataCenter.py</argument>
129+
<argument>-i</argument>
130+
<argument>devcloud-kvm.cfg</argument>
131+
</arguments>
132+
</configuration>
133+
</plugin>
134+
</plugins>
135+
</build>
136+
</profile>
137+
</profiles>
138+
</project>

0 commit comments

Comments
 (0)