cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject git commit: updated refs/heads/docker to d00d44c
Date Mon, 17 Mar 2014 15:22:33 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/docker ea0dec77d -> d00d44c38


init docker


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

Branch: refs/heads/docker
Commit: d00d44c38c6af1a83a06eaf7a4e5614dbefc1598
Parents: ea0dec7
Author: ng.tuna@gmail.com <apple@Tuna.local>
Authored: Mon Mar 17 22:22:05 2014 +0700
Committer: ng.tuna@gmail.com <apple@Tuna.local>
Committed: Mon Mar 17 22:22:05 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   |   3 +
 .../spring-server-compute-context.xml           |   4 +
 .../spring-server-discoverer-context.xml        |   5 +
 server/src/com/cloud/configuration/Config.java  |   4 +-
 server/src/com/cloud/hypervisor/DockerGuru.java |  41 +++++++
 .../kvm/discoverer/DockerServerDiscoverer.java  |  18 +++
 .../kvm/discoverer/LibvirtServerDiscoverer.java |   2 +-
 .../com/cloud/network/SshKeysDistriMonitor.java |   2 +-
 .../router/VirtualNetworkApplianceManager.java  |   5 +-
 .../VirtualNetworkApplianceManagerImpl.java     |   3 +
 setup/db/db/schema-410to420.sql                 |  12 +-
 18 files changed, 351 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d00d44c3/agent/conf/agent.properties
----------------------------------------------------------------------
diff --git a/agent/conf/agent.properties b/agent/conf/agent.properties
old mode 100644
new mode 100755
index b8b7a7c..a0a50bb
--- a/agent/conf/agent.properties
+++ b/agent/conf/agent.properties
@@ -92,12 +92,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/d00d44c3/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 f8b98cf..fa13ef7
--- 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/d00d44c3/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/d00d44c3/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/d00d44c3/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/d00d44c3/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/d00d44c3/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/d00d44c3/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 8b82306..7ed5064
--- 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
@@ -748,6 +748,9 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements
In
                     case LXC:
                         templateName = VirtualNetworkApplianceManager.RouterTemplateLxc.valueIn(dest.getDataCenter().getId());
                         break;
+                    case Docker:
+                        templateName = VirtualNetworkApplianceManager.RouterTemplateDocker.valueIn(dest.getDataCenter().getId());
+                        break;
                     default:
                         break;
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d00d44c3/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/d00d44c3/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/d00d44c3/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 98e5d34..ec63d30 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -716,7 +716,7 @@ public enum Config {
             String.class,
             "system.vm.default.hypervisor",
             null,
-            "Hypervisor type used to create system vm, valid values are: XenServer, KVM,
VMware, Hyperv, VirtualBox, Parralels, BareMetal, Ovm, LXC, Any",
+            "Hypervisor type used to create system vm, valid values are: XenServer, KVM,
VMware, Hyperv, VirtualBox, Parralels, BareMetal, Ovm, LXC, Docker, Any",
             null),
     SystemVMRandomPassword(
             "Advanced",
@@ -733,7 +733,7 @@ public enum Config {
             String.class,
             "hypervisor.list",
             HypervisorType.Hyperv + "," + HypervisorType.KVM + "," + HypervisorType.XenServer
+ "," + HypervisorType.VMware + "," + HypervisorType.BareMetal + "," +
-                HypervisorType.Ovm + "," + HypervisorType.LXC,
+                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),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d00d44c3/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/d00d44c3/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/d00d44c3/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 770099c..7879c0c
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
@@ -366,7 +366,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
 
     @Override
     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)) {
+        if (host.getType() != Host.Type.Routing || (host.getHypervisorType() != HypervisorType.KVM
&& host.getHypervisorType() != HypervisorType.LXC && host.getHypervisorType()
!= HypervisorType.Docker)) {
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d00d44c3/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 1eeb3a3..2640cc4 100755
--- a/server/src/com/cloud/network/SshKeysDistriMonitor.java
+++ b/server/src/com/cloud/network/SshKeysDistriMonitor.java
@@ -71,7 +71,7 @@ public class SshKeysDistriMonitor implements Listener {
     public void processConnect(Host host, StartupCommand cmd, boolean forRebalance) throws
ConnectionException {
         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/d00d44c3/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 9097b87..436a092
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
@@ -50,6 +50,7 @@ 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)",
@@ -61,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);
 
     static final ConfigKey<String> SetServiceMonitor = new ConfigKey<String>(String.class,
SetServiceMonitorCK, "Advanced", "true",
             "service monitoring in router enable/disable option, default true", true, ConfigKey.Scope.Zone,
null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d00d44c3/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 37171f5..200b2a6 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1648,6 +1648,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;
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d00d44c3/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 ebbcfef..3316d05
--- 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',
@@ -2190,6 +2195,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