cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/7] git commit: updated refs/heads/docker to 2ab7524
Date Sun, 30 Mar 2014 18:04:16 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/docker [created] 2ab75245d


init docker


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

Branch: refs/heads/docker
Commit: cd4444cfecc53d2ec5bb0a5774644dc14e517f6d
Parents: 7830a0f
Author: tuna <ng.tuna@gmail.com>
Authored: Mon Mar 17 22:22:05 2014 +0700
Committer: tuna <ng.tuna@gmail.com>
Committed: Sat Mar 29 15:22:23 2014 +0700

----------------------------------------------------------------------
 agent/conf/agent.properties                     |   3 +-
 api/src/com/cloud/hypervisor/Hypervisor.java    |   3 +
 .../com/cloud/upgrade/dao/Upgrade421to430.java  |   6 +
 plugins/hypervisors/docker/pom.xml              |  86 ++++++++++++++
 .../cloudstack/docker-compute/module.properties |  18 +++
 .../spring-docker-compute-context.xml           |  30 +++++
 .../docker/resource/DockerResource.java         | 115 +++++++++++++++++++
 .../lb/InternalLoadBalancerVMManagerImpl.java   |   6 +-
 .../spring-server-compute-context.xml           |   4 +
 .../spring-server-discoverer-context.xml        |   5 +
 server/src/com/cloud/configuration/Config.java  |   2 +-
 server/src/com/cloud/hypervisor/DockerGuru.java |  41 +++++++
 .../kvm/discoverer/DockerServerDiscoverer.java  |  18 +++
 .../kvm/discoverer/LibvirtServerDiscoverer.java |   2 +-
 .../com/cloud/network/SshKeysDistriMonitor.java |   4 +-
 .../router/VirtualNetworkApplianceManager.java  |   6 +-
 .../VirtualNetworkApplianceManagerImpl.java     |   3 +
 setup/db/db/schema-410to420.sql                 |  12 +-
 18 files changed, 354 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/agent/conf/agent.properties
----------------------------------------------------------------------
diff --git a/agent/conf/agent.properties b/agent/conf/agent.properties
old mode 100644
new mode 100755
index 8bd9756..ca3f9e9
--- a/agent/conf/agent.properties
+++ b/agent/conf/agent.properties
@@ -81,12 +81,13 @@ domr.scripts.dir=scripts/network/domr/kvm
 # openvswitch = com.cloud.hypervisor.kvm.resource.OvsVifDriver
 #libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.BridgeVifDriver
 
-# set the hypervisor type, values are: kvm, lxc
+# set the hypervisor type, values are: kvm, lxc, docker
 # hypervisor.type=kvm
 
 # set the hypervisor URI. Usually there is no need for changing this
 # For KVM: qemu:///system
 # For LXC: lxc:///
+# For Docker: docker:///
 # hypervisor.uri=qemu:///system
 
 # settings to enable direct networking in libvirt, should not be used

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/api/src/com/cloud/hypervisor/Hypervisor.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/hypervisor/Hypervisor.java b/api/src/com/cloud/hypervisor/Hypervisor.java
old mode 100644
new mode 100755
index 710ddfc..c574f67
--- a/api/src/com/cloud/hypervisor/Hypervisor.java
+++ b/api/src/com/cloud/hypervisor/Hypervisor.java
@@ -32,6 +32,7 @@ public class Hypervisor {
         Simulator,
         Ovm,
         LXC,
+        Docker,
 
         Any; /*If you don't care about the hypervisor type*/
 
@@ -59,6 +60,8 @@ public class Hypervisor {
                 return HypervisorType.Ovm;
             } else if (hypervisor.equalsIgnoreCase("LXC")) {
                 return HypervisorType.LXC;
+            } else if (hypervisor.equalsIgnoreCase("Docker")) {
+                return HypervisorType.Docker;
             } else if (hypervisor.equalsIgnoreCase("Any")) {
                 return HypervisorType.Any;
             } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
old mode 100644
new mode 100755
index 7e26132..7da2863
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
@@ -212,6 +212,8 @@ public class Upgrade421to430 implements DbUpgrade {
                             break;
                         case LXC:       hypervisorsListInUse.add(Hypervisor.HypervisorType.LXC);
                             break;
+                        case Docker:    hypervisorsListInUse.add(Hypervisor.HypervisorType.Docker);
+                        	break;
                     }
                 }
             } catch (SQLException e) {
@@ -223,6 +225,7 @@ public class Upgrade421to430 implements DbUpgrade {
                     put(Hypervisor.HypervisorType.VMware, "systemvm-vmware-4.3");
                     put(Hypervisor.HypervisorType.KVM, "systemvm-kvm-4.3");
                     put(Hypervisor.HypervisorType.LXC, "systemvm-lxc-4.3");
+                    put(Hypervisor.HypervisorType.Docker, "systemvm-docker-4.3");
                     put(Hypervisor.HypervisorType.Hyperv, "systemvm-hyperv-4.3");
                 }
             };
@@ -232,6 +235,7 @@ public class Upgrade421to430 implements DbUpgrade {
                     put(Hypervisor.HypervisorType.VMware, "router.template.vmware");
                     put(Hypervisor.HypervisorType.KVM, "router.template.kvm");
                     put(Hypervisor.HypervisorType.LXC, "router.template.lxc");
+                    put(Hypervisor.HypervisorType.Docker, "router.template.docker");
                     put(Hypervisor.HypervisorType.Hyperv, "router.template.hyperv");
                 }
             };
@@ -241,6 +245,7 @@ public class Upgrade421to430 implements DbUpgrade {
                     put(Hypervisor.HypervisorType.VMware, "http://download.cloud.com/templates/4.3/systemvm64template-2014-01-14-master-vmware.ova");
                     put(Hypervisor.HypervisorType.KVM, "http://download.cloud.com/templates/4.3/systemvm64template-2014-01-14-master-kvm.qcow2.bz2");
                     put(Hypervisor.HypervisorType.LXC, "http://download.cloud.com/templates/4.3/systemvm64template-2014-01-14-master-kvm.qcow2.bz2");
+                    put(Hypervisor.HypervisorType.Docker, "http://download.cloud.com/templates/4.3/systemvm64template-2014-01-14-master-kvm.qcow2.bz2");
                     put(Hypervisor.HypervisorType.Hyperv, "http://download.cloud.com/templates/4.3/systemvm64template-2013-12-23-hyperv.vhd.bz2");
                 }
             };
@@ -250,6 +255,7 @@ public class Upgrade421to430 implements DbUpgrade {
                     put(Hypervisor.HypervisorType.VMware, "ef593a061f3b7594ab0bfd9b0ed0a0d4");
                     put(Hypervisor.HypervisorType.KVM, "85a1bed07bf43cbf022451cb2ecae4ff");
                     put(Hypervisor.HypervisorType.LXC, "85a1bed07bf43cbf022451cb2ecae4ff");
+                    put(Hypervisor.HypervisorType.Docker, "85a1bed07bf43cbf022451cb2ecae4ff");
                     put(Hypervisor.HypervisorType.Hyperv, "5df45ee6ebe1b703a8805f4e1f4d0818");
                 }
             };

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/plugins/hypervisors/docker/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/docker/pom.xml b/plugins/hypervisors/docker/pom.xml
new file mode 100755
index 0000000..4ede673
--- /dev/null
+++ b/plugins/hypervisors/docker/pom.xml
@@ -0,0 +1,86 @@
+<!-- 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-plugin-hypervisor-docker</artifactId>
+  <name>Apache CloudStack Plugin - Hypervisor Docker</name>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloudstack-plugins</artifactId>
+    <version>4.4.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+  <repositories>
+    <repository>
+      <id>libvirt-org</id>
+      <url>http://libvirt.org/maven2</url>
+    </repository>
+  </repositories>
+  <dependencies>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-agent</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.libvirt</groupId>
+      <artifactId>libvirt</artifactId>
+      <version>${cs.libvirt-java.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-network-ovs</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>net.java.dev.jna</groupId>
+       <artifactId>jna</artifactId>
+       <version>${cs.jna.version}</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <defaultGoal>install</defaultGoal>
+    <sourceDirectory>src</sourceDirectory>
+    <testSourceDirectory>test</testSourceDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>package</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
+              <includeScope>runtime</includeScope>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>**/Qemu*.java</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/module.properties
b/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/module.properties
new file mode 100755
index 0000000..0da362b
--- /dev/null
+++ b/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/module.properties
@@ -0,0 +1,18 @@
+# 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.
+name=docker-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/spring-docker-compute-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/spring-docker-compute-context.xml
b/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/spring-docker-compute-context.xml
new file mode 100755
index 0000000..77c549f
--- /dev/null
+++ b/plugins/hypervisors/docker/resources/META-INF/cloudstack/docker-compute/spring-docker-compute-context.xml
@@ -0,0 +1,30 @@
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/plugins/hypervisors/docker/src/com/cloud/hypervisor/docker/resource/DockerResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/docker/src/com/cloud/hypervisor/docker/resource/DockerResource.java
b/plugins/hypervisors/docker/src/com/cloud/hypervisor/docker/resource/DockerResource.java
new file mode 100644
index 0000000..501df0d
--- /dev/null
+++ b/plugins/hypervisors/docker/src/com/cloud/hypervisor/docker/resource/DockerResource.java
@@ -0,0 +1,115 @@
+package com.cloud.hypervisor.docker.resource;
+
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.PingCommand;
+import com.cloud.agent.api.RebootCommand;
+import com.cloud.agent.api.StartAnswer;
+import com.cloud.agent.api.StartCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StopCommand;
+import com.cloud.host.Host.Type;
+import com.cloud.resource.ServerResource;
+import com.cloud.resource.ServerResourceBase;
+
+@Local(value = {ServerResource.class})
+public class DockerResource extends ServerResourceBase implements ServerResource {
+	private static final Logger s_logger = Logger.getLogger(DockerResource.class);
+
+	@Override
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
+		return true;
+	}
+	
+	@Override
+	public Answer executeRequest(Command cmd) {
+		try {
+			if (cmd instanceof StopCommand) {
+                return execute((StopCommand)cmd);
+            } else if (cmd instanceof RebootCommand) {
+                return execute((RebootCommand)cmd);
+            }  else if (cmd instanceof StartCommand) {
+                return execute((StartCommand)cmd);
+            }  else {
+                s_logger.warn("Unsupported command ");
+                return Answer.createUnsupportedCommandAnswer(cmd);
+            }
+        } catch (final IllegalArgumentException e) {
+            return new Answer(cmd, false, e.getMessage());
+        }
+	}
+	
+	protected Answer execute(StopCommand cmd) {
+		
+	}
+	
+	private Answer execute(RebootCommand cmd) {
+		
+	}
+	
+	protected StartAnswer execute(StartCommand cmd) {
+		
+	}
+	
+	@Override
+	public void setName(String name) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setConfigParams(Map<String, Object> params) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public Map<String, Object> getConfigParams() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public int getRunLevel() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public void setRunLevel(int level) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public Type getType() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public StartupCommand[] initialize() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public PingCommand getCurrentStatus(long id) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	protected String getDefaultScriptsDir() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/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
old mode 100644
new mode 100755
index 02e872b..86f2860
--- 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
@@ -749,7 +749,11 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements
In
                     case LXC:
                         templateName = VirtualNetworkApplianceManager.RouterTemplateLxc.valueIn(dest.getDataCenter().getId());
                         break;
-                    default: break;
+                    case Docker:
+                        templateName = VirtualNetworkApplianceManager.RouterTemplateDocker.valueIn(dest.getDataCenter().getId());
+                        break;
+                    default:
+                        break;
                 }
                 VMTemplateVO template = _templateDao.findRoutingTemplate(hType, templateName);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
b/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
old mode 100644
new mode 100755
index 1311902..d1667eb
--- a/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
+++ b/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
@@ -34,5 +34,9 @@
     <bean id="LXCGuru" class="com.cloud.hypervisor.LXCGuru">
         <property name="name" value="LXCGuru" />
     </bean>
+    
+    <bean id="DockerGuru" class="com.cloud.hypervisor.DockerGuru">
+        <property name="name" value="DockerGuru" />
+    </bean>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
b/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
old mode 100644
new mode 100755
index 90666d1..3b2a948
--- a/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
+++ b/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
@@ -37,6 +37,11 @@
         class="com.cloud.hypervisor.kvm.discoverer.LxcServerDiscoverer">
         <property name="name" value="Lxc Discover" />
     </bean>
+    
+    <bean id="DockerServerDiscoverer"
+        class="com.cloud.hypervisor.kvm.discoverer.DockerServerDiscoverer">
+        <property name="name" value="Docker Discover" />
+    </bean>    
 
     <bean id="dummyHostDiscoverer" class="com.cloud.resource.DummyHostDiscoverer">
         <property name="name" value="dummyHostDiscoverer" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 6ebb7e6..feaee2f 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -178,7 +178,7 @@ public enum Config {
 	SystemVMDefaultHypervisor("Advanced", ManagementServer.class, String.class, "system.vm.default.hypervisor",
null, "Hypervisor type used to create system vm", null),
     SystemVMRandomPassword("Advanced", ManagementServer.class, Boolean.class, "system.vm.random.password",
"false", "Randomize system vm password the first time management server starts", null),
 	LinkLocalIpNums("Advanced", ManagementServer.class, Integer.class, "linkLocalIp.nums", "10",
"The number of link local ip that needed by domR(in power of 2)", null),
-	HypervisorList("Advanced", ManagementServer.class, String.class, "hypervisor.list", HypervisorType.Hyperv
+ "," + HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware
+ "," + HypervisorType.BareMetal + "," + HypervisorType.Ovm + "," + HypervisorType.LXC, "The
list of hypervisors that this deployment will use.", "hypervisorList"),
+	HypervisorList("Advanced", ManagementServer.class, String.class, "hypervisor.list", HypervisorType.Hyperv
+ "," + HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware
+ "," + HypervisorType.BareMetal + "," + HypervisorType.Ovm + "," + HypervisorType.LXC + ","
+ HypervisorType.Docker, "The list of hypervisors that this deployment will use.", "hypervisorList"),
 	ManagementNetwork("Advanced", ManagementServer.class, String.class, "management.network.cidr",
null, "The cidr of management server network", null),
 	EventPurgeDelay("Advanced", ManagementServer.class, Integer.class, "event.purge.delay",
"15", "Events older than specified number days will be purged. Set this value to 0 to never
delete events", null),
 	SecStorageVmMTUSize("Advanced", AgentManager.class, Integer.class, "secstorage.vm.mtu.size",
String.valueOf(SecondaryStorageVmManager.DEFAULT_SS_VM_MTUSIZE), "MTU size (in Byte) of storage
network in secondary storage vms", null),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/src/com/cloud/hypervisor/DockerGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/DockerGuru.java b/server/src/com/cloud/hypervisor/DockerGuru.java
new file mode 100644
index 0000000..bba6927
--- /dev/null
+++ b/server/src/com/cloud/hypervisor/DockerGuru.java
@@ -0,0 +1,41 @@
+package com.cloud.hypervisor;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.GuestOSVO;
+import com.cloud.storage.dao.GuestOSDao;
+import com.cloud.vm.VirtualMachineProfile;
+
+@Local(value = HypervisorGuru.class)
+public class DockerGuru extends HypervisorGuruBase implements HypervisorGuru {
+    @Inject
+    GuestOSDao _guestOsDao;
+
+    @Override
+    public HypervisorType getHypervisorType() {
+        return HypervisorType.Docker;
+    }
+    
+    protected DockerGuru() {
+        super();
+    }
+
+    @Override
+    public VirtualMachineTO implement(VirtualMachineProfile vm) {
+        VirtualMachineTO to = toVirtualMachineTO(vm);
+
+        // Determine the VM's OS description
+        GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
+        to.setOs(guestOS.getDisplayName());
+
+        return to;
+    }
+    
+    @Override
+    public boolean trackVmHostChange() {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/src/com/cloud/hypervisor/kvm/discoverer/DockerServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/DockerServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/DockerServerDiscoverer.java
new file mode 100644
index 0000000..558aa25
--- /dev/null
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/DockerServerDiscoverer.java
@@ -0,0 +1,18 @@
+package com.cloud.hypervisor.kvm.discoverer;
+
+import javax.ejb.Local;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.hypervisor.Hypervisor;
+import com.cloud.resource.Discoverer;
+
+@Local(value = Discoverer.class)
+public class DockerServerDiscoverer extends LibvirtServerDiscoverer {
+	private static final Logger s_logger = Logger.getLogger(DockerServerDiscoverer.class);
+
+    @Override
+    public Hypervisor.HypervisorType getHypervisorType() {
+        return Hypervisor.HypervisorType.Docker;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
old mode 100644
new mode 100755
index d7b5ab8..12bcfea
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
@@ -384,7 +384,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
     public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForceDeleteStorage)
             throws UnableDeleteHostException {
         if (host.getType() != Host.Type.Routing
-                || (host.getHypervisorType() != HypervisorType.KVM && host.getHypervisorType()
!= HypervisorType.LXC)) {
+                || (host.getHypervisorType() != HypervisorType.KVM && host.getHypervisorType()
!= HypervisorType.LXC && host.getHypervisorType() != HypervisorType.Docker)) {
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/src/com/cloud/network/SshKeysDistriMonitor.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/SshKeysDistriMonitor.java b/server/src/com/cloud/network/SshKeysDistriMonitor.java
index 6920062..ff096f2 100755
--- a/server/src/com/cloud/network/SshKeysDistriMonitor.java
+++ b/server/src/com/cloud/network/SshKeysDistriMonitor.java
@@ -37,7 +37,6 @@ import com.cloud.host.Status;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 
-
 public class SshKeysDistriMonitor implements Listener {
 	  private static final Logger s_logger = Logger.getLogger(SshKeysDistriMonitor.class);
 	  	AgentManager _agentMgr;
@@ -74,7 +73,8 @@ public class SshKeysDistriMonitor implements Listener {
 	    	if (cmd instanceof StartupRoutingCommand) {
 	    		if (((StartupRoutingCommand) cmd).getHypervisorType() == HypervisorType.KVM ||
                     ((StartupRoutingCommand) cmd).getHypervisorType() == HypervisorType.XenServer
||
-                    ((StartupRoutingCommand) cmd).getHypervisorType() == HypervisorType.LXC)
{
+                    ((StartupRoutingCommand) cmd).getHypervisorType() == HypervisorType.LXC
||
+                    ((StartupRoutingCommand)cmd).getHypervisorType() == HypervisorType.Docker)
{
 	    			/*TODO: Get the private/public keys here*/
 	    			
 	    			String pubKey = _configDao.getValue("ssh.publickey");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
old mode 100644
new mode 100755
index 4ea09e5..c2f43b8
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
@@ -50,6 +50,8 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA
     static final String RouterTemplateVmwareCK = "router.template.vmware";
     static final String RouterTemplateHyperVCK = "router.template.hyperv";
     static final String RouterTemplateLxcCK = "router.template.lxc";
+    static final String RouterTemplateDockerCK = "router.template.docker";    
+    static final String SetServiceMonitorCK = "network.router.EnableServiceMonitoring";
 
     static final ConfigKey<String> RouterTemplateXen = new ConfigKey<String>(String.class,
RouterTemplateXenCK, "Advanced", "SystemVM Template (XenServer)",
         "Name of the default router template on Xenserver.", true, ConfigKey.Scope.Zone,
null);
@@ -60,7 +62,9 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA
     static final ConfigKey<String> RouterTemplateHyperV = new ConfigKey<String>(String.class,
RouterTemplateHyperVCK, "Advanced", "SystemVM Template (HyperV)",
         "Name of the default router template on Hyperv.", true, ConfigKey.Scope.Zone, null);
     static final ConfigKey<String> RouterTemplateLxc = new ConfigKey<String>(String.class,
RouterTemplateLxcCK, "Advanced", "SystemVM Template (LXC)",
-        "Name of the default router template on LXC.", true, ConfigKey.Scope.Zone, null);
+            "Name of the default router template on LXC.", true, ConfigKey.Scope.Zone, null);
+    static final ConfigKey<String> RouterTemplateDocker = new ConfigKey<String>(String.class,
RouterTemplateDockerCK, "Advanced", "SystemVM Template (Docker)",
+            "Name of the default router template on Docker.", true, ConfigKey.Scope.Zone,
null);
 
     public static final int DEFAULT_ROUTER_VM_RAMSIZE = 128;            // 128M
     public static final int DEFAULT_ROUTER_CPU_MHZ = 500;            	// 500 MHz

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 466b861..0aeba4d 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1666,6 +1666,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
                     case LXC:
                         templateName = RouterTemplateLxc.valueIn(dest.getDataCenter().getId());
                         break;
+                    case Docker:
+                        templateName = RouterTemplateDocker.valueIn(dest.getDataCenter().getId());
+                        break;
                     default: break;
                 }
                 VMTemplateVO template = _templateDao.findRoutingTemplate(hType, templateName);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4444cf/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
old mode 100644
new mode 100755
index b0be6c7..9af1162
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -661,19 +661,24 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults',
'DEFAULT'
 ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT
COMMENT 'id';
 ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `uuid` varchar(40) UNIQUE;
 
--- START: support for LXC
+-- START: support for LXC and Docker
  
 INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version,
max_guests_limit, security_group_enabled) VALUES (UUID(), 'LXC', 'default', 50, 1);
+INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version,
max_guests_limit, security_group_enabled) VALUES (UUID(), 'Docker', 'default', 50, 1);
+
 ALTER TABLE `cloud`.`physical_network_traffic_types` ADD COLUMN `lxc_network_label` varchar(255)
DEFAULT 'cloudbr0' COMMENT 'The network name label of the physical device dedicated to this
traffic on a LXC host';
+ALTER TABLE `cloud`.`physical_network_traffic_types` ADD COLUMN `docker_network_label` varchar(255)
DEFAULT 'cloudbr0' COMMENT 'The network name label of the physical device dedicated to this
traffic on a Docker host';
  
-UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm,LXC' WHERE name='hypervisor.list';
+UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm,LXC,Docker' WHERE name='hypervisor.list';
  
 INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, type, hvm,
bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured,
cross_zones, hypervisor_type)
      VALUES (10, UUID(), 'routing-10', 'SystemVM Template (LXC)', 0, now(), 'SYSTEM', 0,
64, 1, 'http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2', '2755de1f9ef2ce4d6f2bee2efbb4da92',
0, 'SystemVM Template (LXC)', 'QCOW2', 15, 0, 1, 'LXC');
+INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, type, hvm,
bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured,
cross_zones, hypervisor_type)
+     VALUES (10, UUID(), 'routing-10', 'SystemVM Template (Docker)', 0, now(), 'SYSTEM',
0, 64, 1, 'http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2', '2755de1f9ef2ce4d6f2bee2efbb4da92',
0, 'SystemVM Template (Docker)', 'QCOW2', 15, 0, 1, 'Docker');
 
 ALTER TABLE `cloud`.`user_vm` MODIFY user_data TEXT(32768);
 
--- END: support for LXC
+-- END: support for LXC and Docker
 
 CREATE TABLE `cloud`.`vm_snapshots` (
   `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Primary Key',
@@ -2178,6 +2183,7 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT',
'manag
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager',
'router.template.hyperv', 'SystemVM Template (HyperV)', 'Name of the default router template
on Hyperv.');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager',
'router.template.kvm', 'SystemVM Template (KVM)', 'Name of the default router template on
KVM.');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager',
'router.template.lxc', 'SystemVM Template (LXC)', 'Name of the default router template on
LXC.');
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager',
'router.template.docker', 'SystemVM Template (Docker)', 'Name of the default router template
on Docker.');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager',
'router.template.vmware', 'SystemVM Template (vSphere)', 'Name of the default router template
on Vmware.');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager',
'router.template.xen', 'SystemVM Template (XenServer)', 'Name of the default router template
on Xenserver.');
 


Mime
View raw message