You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2012/06/29 02:21:14 UTC

[1/3] git commit: moving out OVS code to plugins/network-elements/ovs

Updated Branches:
  refs/heads/master 4c6738266 -> c41094154


moving out OVS code to plugins/network-elements/ovs


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

Branch: refs/heads/master
Commit: c41094154d8956b2c4b134a4807f0972d545e170
Parents: 4c67382
Author: Murali reddy <Mu...@citrix.com>
Authored: Thu Jun 28 17:23:41 2012 -0700
Committer: Murali reddy <Mu...@citrix.com>
Committed: Thu Jun 28 17:23:41 2012 -0700

----------------------------------------------------------------------
 .../network/ovs/OvsCreateGreTunnelAnswer.java      |   81 ---
 .../network/ovs/OvsCreateGreTunnelCommand.java     |   54 --
 .../cloud/network/ovs/OvsCreateTunnelAnswer.java   |   86 ---
 .../cloud/network/ovs/OvsCreateTunnelCommand.java  |   69 --
 .../cloud/network/ovs/OvsDeleteFlowCommand.java    |   36 -
 .../cloud/network/ovs/OvsDestroyBridgeCommand.java |   61 --
 .../cloud/network/ovs/OvsDestroyTunnelCommand.java |   50 --
 .../cloud/network/ovs/OvsFetchInterfaceAnswer.java |   75 ---
 .../network/ovs/OvsFetchInterfaceCommand.java      |   55 --
 .../cloud/network/ovs/OvsSetTagAndFlowAnswer.java  |   40 --
 .../cloud/network/ovs/OvsSetTagAndFlowCommand.java |   60 --
 .../cloud/network/ovs/OvsSetupBridgeCommand.java   |   67 --
 build/build-cloud-plugins.xml                      |   11 +-
 client/tomcatconf/components.xml.in                |    3 +
 plugins/network-elements/ovs/.classpath            |   11 +
 plugins/network-elements/ovs/.project              |   17 +
 plugins/network-elements/ovs/build.xml             |  129 ++++
 .../src/com/cloud/network/element/OvsElement.java  |  132 ++++
 .../cloud/network/guru/OvsGuestNetworkGuru.java    |   91 +++
 .../com/cloud/network/ovs/GreTunnelException.java  |   19 +
 .../network/ovs/OvsCreateGreTunnelAnswer.java      |   81 +++
 .../network/ovs/OvsCreateGreTunnelCommand.java     |   54 ++
 .../cloud/network/ovs/OvsCreateTunnelAnswer.java   |   86 +++
 .../cloud/network/ovs/OvsCreateTunnelCommand.java  |   69 ++
 .../cloud/network/ovs/OvsDeleteFlowCommand.java    |   36 +
 .../cloud/network/ovs/OvsDestroyBridgeCommand.java |   61 ++
 .../cloud/network/ovs/OvsDestroyTunnelCommand.java |   50 ++
 .../cloud/network/ovs/OvsFetchInterfaceAnswer.java |   75 +++
 .../network/ovs/OvsFetchInterfaceCommand.java      |   55 ++
 .../cloud/network/ovs/OvsSetTagAndFlowAnswer.java  |   40 ++
 .../cloud/network/ovs/OvsSetTagAndFlowCommand.java |   60 ++
 .../cloud/network/ovs/OvsSetupBridgeCommand.java   |   67 ++
 .../com/cloud/network/ovs/OvsTunnelManager.java    |   30 +
 .../cloud/network/ovs/OvsTunnelManagerImpl.java    |  512 +++++++++++++++
 .../network/ovs/dao/OvsTunnelInterfaceDao.java     |   32 +
 .../network/ovs/dao/OvsTunnelInterfaceDaoImpl.java |   65 ++
 .../network/ovs/dao/OvsTunnelInterfaceVO.java      |  111 ++++
 .../cloud/network/ovs/dao/OvsTunnelNetworkDao.java |   31 +
 .../network/ovs/dao/OvsTunnelNetworkDaoImpl.java   |   91 +++
 .../cloud/network/ovs/dao/OvsTunnelNetworkVO.java  |  106 +++
 .../configuration/DefaultComponentLibrary.java     |    6 -
 .../src/com/cloud/network/element/OvsElement.java  |  132 ----
 .../network/guru/ExternalGuestNetworkGuru.java     |   21 +-
 .../cloud/network/guru/OvsGuestNetworkGuru.java    |   91 ---
 .../com/cloud/network/ovs/GreTunnelException.java  |   19 -
 .../com/cloud/network/ovs/OvsTunnelManager.java    |   30 -
 .../cloud/network/ovs/OvsTunnelManagerImpl.java    |  512 ---------------
 .../network/ovs/dao/OvsTunnelInterfaceDao.java     |   32 -
 .../network/ovs/dao/OvsTunnelInterfaceDaoImpl.java |   65 --
 .../network/ovs/dao/OvsTunnelInterfaceVO.java      |  111 ----
 .../cloud/network/ovs/dao/OvsTunnelNetworkDao.java |   31 -
 .../network/ovs/dao/OvsTunnelNetworkDaoImpl.java   |   91 ---
 .../cloud/network/ovs/dao/OvsTunnelNetworkVO.java  |  106 ---
 53 files changed, 2134 insertions(+), 1972 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java b/api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
deleted file mode 100644
index 5f0f8c1..0000000
--- a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsCreateGreTunnelAnswer extends Answer {
-    String hostIp;
-    String remoteIp;
-    String bridge;
-    String key;
-    long from;
-    long to;
-    int port;
-
-    public OvsCreateGreTunnelAnswer(Command cmd, boolean success, String details) {
-        super(cmd, success, details);
-    }
-
-    public OvsCreateGreTunnelAnswer(Command cmd, boolean success,
-            String details, String hostIp, String bridge) {
-        super(cmd, success, details);
-        OvsCreateGreTunnelCommand c = (OvsCreateGreTunnelCommand) cmd;
-        this.hostIp = hostIp;
-        this.bridge = bridge;
-        this.remoteIp = c.getRemoteIp();
-        this.key = c.getKey();
-        this.port = -1;
-        this.from = c.getFrom();
-        this.to = c.getTo();
-    }
-
-    public OvsCreateGreTunnelAnswer(Command cmd, boolean success,
-            String details, String hostIp, String bridge, int port) {
-        this(cmd, success, details, hostIp, bridge);
-        this.port = port;
-    }
-
-    public String getHostIp() {
-        return hostIp;
-    }
-
-    public String getRemoteIp() {
-        return remoteIp;
-    }
-
-    public String getBridge() {
-        return bridge;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public long getFrom() {
-        return from;
-    }
-
-    public long getTo() {
-        return to;
-    }
-
-    public int getPort() {
-        return port;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java b/api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
deleted file mode 100644
index e2cd2d8..0000000
--- a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsCreateGreTunnelCommand extends Command {
-    String remoteIp;
-    String key;
-    long from;
-    long to;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsCreateGreTunnelCommand(String remoteIp, String key, long from, long to) {
-        this.remoteIp = remoteIp;
-        this.key = key;
-        this.from = from;
-        this.to = to;
-    }
-
-    public String getRemoteIp() {
-        return remoteIp;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public long getFrom() {
-        return from;
-    }
-
-    public long getTo() {
-        return to;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java b/api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
deleted file mode 100644
index fc2eb8a..0000000
--- a/api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsCreateTunnelAnswer extends Answer {
-    Long from;
-    Long to;
-    long networkId;
-    String inPortName;
-    
-    //for debug info
-    String fromIp;
-    String toIp;
-    int key;
-    String bridge;
-    
-    public OvsCreateTunnelAnswer(Command cmd, boolean success, String details, String bridge) {
-        super(cmd, success, details);
-        OvsCreateTunnelCommand c = (OvsCreateTunnelCommand)cmd;
-        from = c.getFrom();
-        to = c.getTo();
-        networkId = c.getNetworkId();
-        inPortName = "[]";
-        fromIp = c.getFromIp();
-        toIp = c.getRemoteIp();
-        key = c.getKey();
-        this.bridge = bridge;
-    }
-    
-    public OvsCreateTunnelAnswer(Command cmd, boolean success, String details, String inPortName, String bridge) {
-        this(cmd, success, details, bridge);
-        this.inPortName = inPortName;
-    }
-    
-    
-    public Long getFrom() {
-        return from;
-    }
-    
-    public Long getTo() {
-        return to;
-    }
-    
-    public long getNetworkId() {
-        return networkId;
-    }
-    
-    public String getInPortName() {
-        return inPortName;
-    }
-    
-    public String getFromIp() {
-        return fromIp;
-    }
-    
-    public String getToIp() {
-        return toIp;
-    }
-    
-    public int getKey() {
-        return key;
-    }
-    
-    public String getBridge() {
-        return bridge;
-    }
-}
-
-

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java b/api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
deleted file mode 100644
index 1ececa0..0000000
--- a/api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsCreateTunnelCommand extends Command {
-    Integer key;
-    String remoteIp;
-    Long from;
-    Long to;
-    long networkId;
-
-    // for debug info
-    String fromIp;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsCreateTunnelCommand(String remoteIp, Integer key, Long from, Long to, long networkId, String fromIp) {
-        this.remoteIp = remoteIp;
-        this.key = key;
-        this.from = from;
-        this.to = to;
-        this.networkId = networkId;
-        this.fromIp = fromIp;
-    }
-
-    public Integer getKey() {
-        return key;
-    }
-
-    public String getRemoteIp() {
-        return remoteIp;
-    }
-
-    public Long getFrom() {
-        return from;
-    }
-
-    public Long getTo() {
-        return to;
-    }
-
-    public long getNetworkId() {
-        return networkId;
-    }
-
-    public String getFromIp() {
-        return fromIp;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java b/api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
deleted file mode 100644
index 2a6d5d7..0000000
--- a/api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsDeleteFlowCommand extends Command {
-    String vmName;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public String getVmName() {
-        return vmName;
-    }
-
-    public OvsDeleteFlowCommand(String vmName) {
-        this.vmName = vmName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java b/api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
deleted file mode 100644
index c3b5414..0000000
--- a/api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-/**
- *  Copyright (C) 2012 Cloud.com, Inc.  All rights reserved.
- * 
- * This software is licensed under the GNU General Public License v3 or later.
- * 
- * It is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- */
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsDestroyBridgeCommand extends Command {
-
-    Long networkId;
-    Integer key;
-    
-    public OvsDestroyBridgeCommand(Long networkId, Integer key) {
-        this.networkId = networkId;
-        this.key = key;
-    }
-    
-    public Long getNetworkId() {
-        return networkId;
-    }
-    
-    public Integer getKey() {
-    	return key;
-    }
-    
-	@Override
-	public boolean executeInSequence() {
-		return true;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java b/api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
deleted file mode 100644
index 4594d99..0000000
--- a/api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsDestroyTunnelCommand extends Command {
-    
-	Long networkId;
-	Integer key;
-    String inPortName;
-    
-    public OvsDestroyTunnelCommand(Long networkId, Integer key, String inPortName) {
-        this.networkId = networkId;
-        this.inPortName = inPortName;
-        this.key = key;
-    }
-    
-    public Long getNetworkId() {
-        return networkId;
-    }
-    
-    public String getInPortName() {
-        return inPortName;
-    }
-    
-    public Integer getKey() {
-    	return key;
-    }
-    
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java b/api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
deleted file mode 100644
index feff5dc..0000000
--- a/api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
+++ /dev/null
@@ -1,75 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-/**
- *  Copyright (C) 2010 Cloud.com, Inc.  All rights reserved.
- * 
- * This software is licensed under the GNU General Public License v3 or later.
- * 
- * It is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- */
-
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsFetchInterfaceAnswer extends Answer {
-	String ip;
-    String netmask;
-    String mac;
-    String label;
-
-    public OvsFetchInterfaceAnswer(Command cmd, boolean success, String details) {
-        super(cmd, success, details);
-        this.label = ((OvsFetchInterfaceCommand)cmd).getLabel();
-    }
-
-    public OvsFetchInterfaceAnswer(Command cmd, boolean success,
-            String details, String ip, String netmask, String mac) {
-        super(cmd, success, details);
-        this.ip = ip;
-        this.netmask = netmask;
-        this.mac = mac;
-        this.label = ((OvsFetchInterfaceCommand)cmd).getLabel();
-    }
-
-    public String getIp() {
-        return ip;
-    }
-
-    public String getNetmask() {
-        return netmask;
-    }
-
-    public String getMac() {
-        return mac;
-    }
-
-    public String getLabel() {
-    	return label;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java b/api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
deleted file mode 100644
index 0f82a33..0000000
--- a/api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-/**
- *  Copyright (C) 2010 Cloud.com, Inc.  All rights reserved.
- * 
- * This software is licensed under the GNU General Public License v3 or later.
- * 
- * It is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- */
-
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsFetchInterfaceCommand extends Command {
-    String label;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsFetchInterfaceCommand(String label) {
-        this.label = label;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java b/api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
deleted file mode 100644
index ba16839..0000000
--- a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsSetTagAndFlowAnswer extends Answer {
-    Long vmId;
-    Long seqno;
-
-    public OvsSetTagAndFlowAnswer(Command cmd, boolean success, String details) {
-        super(cmd, success, details);
-        OvsSetTagAndFlowCommand c = (OvsSetTagAndFlowCommand) cmd;
-        this.vmId = c.getVmId();
-        this.seqno = Long.parseLong(c.getSeqNo());
-    }
-
-    public Long getVmId() {
-        return vmId;
-    }
-
-    public Long getSeqNo() {
-        return seqno;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java b/api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
deleted file mode 100644
index 17121a0..0000000
--- a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsSetTagAndFlowCommand extends Command {
-    String vlans;
-    String vmName;
-    String seqno;
-    String tag;
-    Long vmId;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public String getSeqNo() {
-        return seqno;
-    }
-
-    public String getVlans() {
-        return vlans;
-    }
-
-    public String getVmName() {
-        return vmName;
-    }
-
-    public Long getVmId() {
-        return vmId;
-    }
-
-    public String getTag() {
-        return tag;
-    }
-
-    public OvsSetTagAndFlowCommand(String vmName, String tag, String vlans, String seqno, Long vmId) {
-        this.vmName = vmName;
-        this.tag = tag;
-        this.vlans = vlans;
-        this.seqno = seqno;
-        this.vmId = vmId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java b/api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
deleted file mode 100644
index 910138c..0000000
--- a/api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-/**
- *  Copyright (C) 2010 Cloud.com, Inc.  All rights reserved.
- * 
- * This software is licensed under the GNU General Public License v3 or later.
- * 
- * It is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- */
-
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsSetupBridgeCommand extends Command {
-    Integer key;
-    Long hostId;
-    Long networkId;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsSetupBridgeCommand(Integer key, Long hostId, Long networkId) {
-        this.key = key;
-        this.hostId = hostId;
-        this.networkId = networkId;
-    }
-
-    public Integer getKey() {
-        return key;
-    }
-
-    public Long getHostId() {
-        return hostId;
-    }
-
-    public Long getNetworkId() {
-    	return networkId;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/build/build-cloud-plugins.xml
----------------------------------------------------------------------
diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml
index 53dc1d3..a464de9 100755
--- a/build/build-cloud-plugins.xml
+++ b/build/build-cloud-plugins.xml
@@ -207,7 +207,7 @@
   <target name="build-ovm" depends="compile-ovm" />
 
 
-  <target name="compile-xen" depends="-init, compile-server" description="Compiles Xen ">
+  <target name="compile-xen" depends="-init, compile-server, compile-ovs" description="Compiles Xen ">
   	<ant antfile="${base.dir}/plugins/hypervisors/xen/build.xml" target="build"/>
   </target>
   <target name="build-xen" depends="compile-xen" />
@@ -279,8 +279,8 @@
 
   <!-- ===================== Network Elements ===================== -->
 
-  <target name="compile-network-elements" depends="compile-netscaler, compile-f5, compile-srx" description="Compile all network elements"/>
-  <target name="build-network-elements" depends="build-netscaler, build-f5, build-srx" description="build all network elements"/>
+  <target name="compile-network-elements" depends="compile-netscaler, compile-f5, compile-srx, compile-ovs" description="Compile all network elements"/>
+  <target name="build-network-elements" depends="build-netscaler, build-f5, build-srx, build-ovs" description="build all network elements"/>
  
   <target name="compile-netscaler" depends="-init, compile-server" description="Compile NetScaler plugin">
   	<ant antfile="${base.dir}/plugins/network-elements/netscaler/build.xml" target="build"/>
@@ -297,4 +297,9 @@
   </target>
   <target name="build-srx" depends="compile-srx"/>
 
+  <target name="compile-ovs" depends="-init, compile-server" description="Compile Ovs plugin">
+  	<ant antfile="${base.dir}/plugins/network-elements/ovs/build.xml" target="build"/>
+  </target>
+  <target name="build-ovs" depends="compile-ovs"/>
+
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/client/tomcatconf/components.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/components.xml.in b/client/tomcatconf/components.xml.in
index 5add24c..be3218e 100755
--- a/client/tomcatconf/components.xml.in
+++ b/client/tomcatconf/components.xml.in
@@ -158,6 +158,7 @@
             <adapter name="BasicAgentAuthorizer" class="com.cloud.agent.manager.authn.impl.BasicAgentAuthManager"/>
         </adapters>
         <manager name="VmwareManager" key="com.cloud.hypervisor.vmware.manager.VmwareManager" class="com.cloud.hypervisor.vmware.manager.VmwareManagerImpl"/>
+        <manager name="OvsTunnelManager" key="com.cloud.network.ovs.OvsTunnelManager" class="com.cloud.network.ovs.OvsTunnelManagerImpl"/>
         <pluggableservice name="VirtualRouterElementService" key="com.cloud.network.element.VirtualRouterElementService" class="com.cloud.network.element.VirtualRouterElement"/>
         <pluggableservice name="NetscalerExternalLoadBalancerElementService" key="com.cloud.network.element.NetscalerLoadBalancerElementService" class="com.cloud.network.element.NetscalerElement"/>
         <pluggableservice name="F5ExternalLoadBalancerElementService" key="com.cloud.network.element.F5ExternalLoadBalancerElementService" class="com.cloud.network.element.F5ExternalLoadBalancerElement"/>
@@ -165,6 +166,8 @@
         <pluggableservice name="CiscoNexusVSMElementService" key="com.coud.network.element.CiscoNexusVSMElementService" class="com.cloud.network.element.CiscoNexusVSMElement"/>
         <dao name="NetScalerPodDao" class="com.cloud.network.dao.NetScalerPodDaoImpl" singleton="false"/>
         <dao name="CiscoNexusVSMDeviceDao" class="com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl" singleton="false"/>
+        <dao name="OvsTunnelInterfaceDao" class="com.cloud.network.dao.OvsTunnelInterfaceDaoImpl" singleton="false"/>
+        <dao name="OvsTunnelAccountDao" class="com.cloud.network.dao.OvsTunnelNetworkDaoImpl" singleton="false"/>
     </management-server>
 
     <configuration-server class="com.cloud.server.ConfigurationServerImpl">

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/.classpath
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/.classpath b/plugins/network-elements/ovs/.classpath
new file mode 100644
index 0000000..a3f5d12
--- /dev/null
+++ b/plugins/network-elements/ovs/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/api"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/core"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/server"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/utils"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/deps"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/.project
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/.project b/plugins/network-elements/ovs/.project
new file mode 100644
index 0000000..0423b30
--- /dev/null
+++ b/plugins/network-elements/ovs/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ovs</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/build.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/build.xml b/plugins/network-elements/ovs/build.xml
new file mode 100755
index 0000000..718720b
--- /dev/null
+++ b/plugins/network-elements/ovs/build.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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 name="Cloud Stack Ovs network element" default="help" basedir=".">
+  <description>
+		Cloud Stack ant build file
+    </description>
+
+  <dirname property="ovs.base.dir" file="${ant.file.Cloud Stack Ovs network element}/"/>
+  <!-- This directory must be set -->
+  <property name="top.dir" location="${ovs.base.dir}/../../.."/>
+  <property name="build.dir" location="${top.dir}/build"/>
+	
+	<echo message="build.dir=${build.dir}; top.dir=${top.dir}; ovs.base.dir=${ovs.base.dir}"/>
+
+  <!-- Import anything that the user wants to set-->
+  <!-- Import properties files and environment variables here -->
+
+  <property environment="env" />
+
+  <condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
+    <available file="${build.dir}/override/build-cloud.properties" />
+  </condition>
+
+  <condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
+    <available file="${build.dir}/override/cloud.properties" />
+  </condition>
+
+  <condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
+    <available file="${build.dir}/override/replace.properties" />
+  </condition>
+
+  <echo message="Using build parameters from ${build-cloud.properties.file}" />
+  <property file="${build-cloud.properties.file}" />
+
+  <echo message="Using company info from ${cloud.properties.file}" />
+  <property file="${cloud.properties.file}" />
+
+  <echo message="Using override file from ${override.file}" />
+  <property file="${override.file}" />
+
+  <property file="${build.dir}/build.number" />
+
+  <!-- In case these didn't get defined in the build-cloud.properties -->
+  <property name="branding.name" value="default" />
+  <property name="deprecation" value="off" />
+  <property name="target.compat.version" value="1.6" />
+  <property name="source.compat.version" value="1.6" />
+  <property name="debug" value="true" />
+  <property name="debuglevel" value="lines,source"/>
+
+  <echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
+  <!-- directories for build and distribution -->
+  <property name="target.dir" location="${top.dir}/target" />
+  <property name="classes.dir" location="${target.dir}/classes" />
+  <property name="jar.dir" location="${target.dir}/jar" />
+  <property name="dep.cache.dir" location="${target.dir}/dep-cache" />
+  <property name="build.log" location="${target.dir}/ant_verbose.txt" />
+
+  <property name="deps.dir" location="${top.dir}/deps" />
+  
+  <property name="cloud-plugin-ovs.jar" value="cloud-plugin-ovs.jar" />
+	
+  <import file="${build.dir}/build-common.xml"/>
+
+  <echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
+	
+  <!-- This section needs to be replaced by some kind of dependency library-->
+  <path id="deps.classpath">
+    <!--filelist files="${deps.classpath}" /-->
+    <fileset dir="${deps.dir}" erroronmissingdir="false">
+      <include name="*.jar" />
+    </fileset>
+  </path>
+	
+  <path id="cloudstack.classpath">
+  	<fileset dir="${jar.dir}">
+  	  <include name="*.jar"/>
+    </fileset>
+  </path>
+	
+  <path id="ovs.classpath">
+	<path refid="deps.classpath"/>
+  	<path refid="cloudstack.classpath"/>
+  </path>
+	
+  <!-- This section needs to be replaced by some kind of dependency library-->
+
+  <target name="deploy-ovs" >
+  </target>
+
+  <target name="init" description="Initialize binaries directory">
+  	<mkdir dir="${classes.dir}/${cloud-plugin-ovs.jar}"/>
+  	<mkdir dir="${jar.dir}"/>
+  </target>
+
+  <target name="compile-ovs" depends="init" description="Compile Ovs">
+    <compile-java jar.name="${cloud-plugin-ovs.jar}" top.dir="${ovs.base.dir}" classpath="ovs.classpath" />
+  </target>
+
+  <target name="clean-ovs">
+    <delete dir="${classes.dir}/${cloud-plugin-ovs.jar}"/>
+  </target>
+	
+  <target name="build" depends="compile-ovs"/>
+  <target name="clean" depends="clean-ovs"/>
+
+  <target name="help" description="help">
+    <echo level="info" message="This is the build file for Ovs"/>
+    <echo level="info" message="You can do a build by doing ant build or clean by doing ant clean" />
+  </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
new file mode 100644
index 0000000..9a73667
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
@@ -0,0 +1,132 @@
+// Copyright 2012 Citrix Systems, Inc. Licensed under the
+// Apache License, Version 2.0 (the "License"); you may not use this
+// file except in compliance with the License.  Citrix Systems, Inc.
+// reserves all rights not expressly granted by 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.
+// 
+// Automatically generated by addcopyright.py at 04/03/2012
+package com.cloud.network.element;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+
+import com.cloud.deploy.DeployDestination;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.Network;
+import com.cloud.network.Network.Capability;
+import com.cloud.network.Network.Provider;
+import com.cloud.network.Network.Service;
+import com.cloud.network.Networks;
+import com.cloud.network.PhysicalNetworkServiceProvider;
+import com.cloud.network.ovs.OvsTunnelManager;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.utils.component.AdapterBase;
+import com.cloud.utils.component.Inject;
+import com.cloud.vm.NicProfile;
+import com.cloud.vm.ReservationContext;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachineProfile;
+
+@Local(value = NetworkElement.class)
+public class OvsElement extends AdapterBase implements NetworkElement {
+    @Inject
+    OvsTunnelManager _ovsTunnelMgr;
+
+    @Override
+    public boolean destroy(Network network)
+            throws ConcurrentOperationException, ResourceUnavailableException {
+        return true;
+    }
+
+    @Override
+    public Map<Service, Map<Capability, String>> getCapabilities() {
+        return null;
+    }
+
+    @Override
+    public Provider getProvider() {
+        return null;
+    }
+
+    @Override
+    public boolean implement(Network network, NetworkOffering offering,
+            DeployDestination dest, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException,
+            InsufficientCapacityException {
+        //Consider actually implementing the network here
+    	return true;
+    }
+
+    @Override
+    public boolean prepare(Network network, NicProfile nic,
+            VirtualMachineProfile<? extends VirtualMachine> vm,
+            DeployDestination dest, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException,
+            InsufficientCapacityException {
+        if (nic.getBroadcastType() != Networks.BroadcastDomainType.Vswitch) {
+            return true;
+        }
+
+        if (nic.getTrafficType() != Networks.TrafficType.Guest) {
+            return true;
+        }
+
+        _ovsTunnelMgr.VmCheckAndCreateTunnel(vm, network, dest);
+        //_ovsTunnelMgr.applyDefaultFlow(vm.getVirtualMachine(), dest);
+
+        return true;
+    }
+
+    @Override
+    public boolean release(Network network, NicProfile nic,
+            VirtualMachineProfile<? extends VirtualMachine> vm,
+            ReservationContext context) throws ConcurrentOperationException,
+            ResourceUnavailableException {
+        if (nic.getBroadcastType() != Networks.BroadcastDomainType.Vswitch) {
+            return true;
+        }
+
+        if (nic.getTrafficType() != Networks.TrafficType.Guest) {
+            return true;
+        }
+
+        _ovsTunnelMgr.CheckAndDestroyTunnel(vm.getVirtualMachine(), network);
+        return true;
+    }
+
+    @Override
+    public boolean shutdown(Network network, ReservationContext context, boolean cleanup)
+            throws ConcurrentOperationException, ResourceUnavailableException {
+        return true;
+    }
+
+    @Override
+    public boolean isReady(PhysicalNetworkServiceProvider provider) {
+    	return true;
+    }
+
+    @Override
+    public boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException {
+        return true;
+    }
+
+    @Override
+    public boolean canEnableIndividualServices() {
+        return false;
+    }
+
+    @Override
+    public boolean verifyServicesCombination(List<String> services) {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
new file mode 100644
index 0000000..d031fee
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
@@ -0,0 +1,91 @@
+// Copyright 2012 Citrix Systems, Inc. Licensed under the
+// Apache License, Version 2.0 (the "License"); you may not use this
+// file except in compliance with the License.  Citrix Systems, Inc.
+// reserves all rights not expressly granted by 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.
+// 
+// Automatically generated by addcopyright.py at 04/03/2012
+package com.cloud.network.guru;
+
+import javax.ejb.Local;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.dc.DataCenter;
+import com.cloud.deploy.DeployDestination;
+import com.cloud.deploy.DeploymentPlan;
+import com.cloud.event.EventTypes;
+import com.cloud.event.EventUtils;
+import com.cloud.event.EventVO;
+import com.cloud.exception.InsufficientAddressCapacityException;
+import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
+import com.cloud.network.Network;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.NetworkVO;
+import com.cloud.network.ovs.OvsTunnelManager;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+import com.cloud.utils.component.Inject;
+import com.cloud.vm.Nic.ReservationStrategy;
+import com.cloud.vm.NicProfile;
+import com.cloud.vm.ReservationContext;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachineProfile;
+import com.cloud.network.Networks.BroadcastDomainType;
+import com.cloud.network.Network.State;
+
+@Local(value=NetworkGuru.class)
+public class OvsGuestNetworkGuru extends GuestNetworkGuru {
+	private static final Logger s_logger = Logger.getLogger(OvsGuestNetworkGuru.class);
+	
+	@Inject NetworkManager _externalNetworkManager;
+	@Inject OvsTunnelManager _ovsTunnelMgr;
+	
+	@Override
+    public Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner) {
+      
+		if (!_ovsTunnelMgr.isOvsTunnelEnabled()) {
+			return null;
+		}
+		
+        NetworkVO config = (NetworkVO) super.design(offering, plan, userSpecified, owner); 
+        if (config == null) {
+        	return null;
+        }
+        
+        config.setBroadcastDomainType(BroadcastDomainType.Vswitch);
+        
+        return config;
+	}
+	
+    protected void allocateVnet(Network network, NetworkVO implemented, long dcId,
+    		long physicalNetworkId, String reservationId) throws InsufficientVirtualNetworkCapcityException {
+        if (network.getBroadcastUri() == null) {
+            String vnet = _dcDao.allocateVnet(dcId, physicalNetworkId, network.getAccountId(), reservationId);
+            if (vnet == null) {
+                throw new InsufficientVirtualNetworkCapcityException("Unable to allocate vnet as a part of network " + network + " implement ", DataCenter.class, dcId);
+            }
+            implemented.setBroadcastUri(BroadcastDomainType.Vswitch.toUri(vnet));
+            EventUtils.saveEvent(UserContext.current().getCallerUserId(), network.getAccountId(), EventVO.LEVEL_INFO, EventTypes.EVENT_ZONE_VLAN_ASSIGN, "Assigned Zone Vlan: "+vnet+ " Network Id: "+network.getId(), 0);
+        } else {
+            implemented.setBroadcastUri(network.getBroadcastUri());
+        }
+    }
+	
+	@Override
+	public Network implement(Network config, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException {
+		 assert (config.getState() == State.Implementing) : "Why are we implementing " + config;
+		 if (!_ovsTunnelMgr.isOvsTunnelEnabled()) {
+			 return null;
+		 }
+		 NetworkVO implemented = (NetworkVO)super.implement(config, offering, dest, context);		 
+         return implemented;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java
new file mode 100644
index 0000000..a364501
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java
@@ -0,0 +1,19 @@
+// Copyright 2012 Citrix Systems, Inc. Licensed under the
+// Apache License, Version 2.0 (the "License"); you may not use this
+// file except in compliance with the License.  Citrix Systems, Inc.
+// reserves all rights not expressly granted by 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.
+// 
+// Automatically generated by addcopyright.py at 04/03/2012
+package com.cloud.network.ovs;
+
+public class GreTunnelException extends Exception {
+	public GreTunnelException(String msg) {
+		super(msg);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
new file mode 100644
index 0000000..5f0f8c1
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class OvsCreateGreTunnelAnswer extends Answer {
+    String hostIp;
+    String remoteIp;
+    String bridge;
+    String key;
+    long from;
+    long to;
+    int port;
+
+    public OvsCreateGreTunnelAnswer(Command cmd, boolean success, String details) {
+        super(cmd, success, details);
+    }
+
+    public OvsCreateGreTunnelAnswer(Command cmd, boolean success,
+            String details, String hostIp, String bridge) {
+        super(cmd, success, details);
+        OvsCreateGreTunnelCommand c = (OvsCreateGreTunnelCommand) cmd;
+        this.hostIp = hostIp;
+        this.bridge = bridge;
+        this.remoteIp = c.getRemoteIp();
+        this.key = c.getKey();
+        this.port = -1;
+        this.from = c.getFrom();
+        this.to = c.getTo();
+    }
+
+    public OvsCreateGreTunnelAnswer(Command cmd, boolean success,
+            String details, String hostIp, String bridge, int port) {
+        this(cmd, success, details, hostIp, bridge);
+        this.port = port;
+    }
+
+    public String getHostIp() {
+        return hostIp;
+    }
+
+    public String getRemoteIp() {
+        return remoteIp;
+    }
+
+    public String getBridge() {
+        return bridge;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public long getFrom() {
+        return from;
+    }
+
+    public long getTo() {
+        return to;
+    }
+
+    public int getPort() {
+        return port;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
new file mode 100644
index 0000000..e2cd2d8
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
@@ -0,0 +1,54 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsCreateGreTunnelCommand extends Command {
+    String remoteIp;
+    String key;
+    long from;
+    long to;
+
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+    public OvsCreateGreTunnelCommand(String remoteIp, String key, long from, long to) {
+        this.remoteIp = remoteIp;
+        this.key = key;
+        this.from = from;
+        this.to = to;
+    }
+
+    public String getRemoteIp() {
+        return remoteIp;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public long getFrom() {
+        return from;
+    }
+
+    public long getTo() {
+        return to;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
new file mode 100644
index 0000000..fc2eb8a
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
@@ -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.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class OvsCreateTunnelAnswer extends Answer {
+    Long from;
+    Long to;
+    long networkId;
+    String inPortName;
+    
+    //for debug info
+    String fromIp;
+    String toIp;
+    int key;
+    String bridge;
+    
+    public OvsCreateTunnelAnswer(Command cmd, boolean success, String details, String bridge) {
+        super(cmd, success, details);
+        OvsCreateTunnelCommand c = (OvsCreateTunnelCommand)cmd;
+        from = c.getFrom();
+        to = c.getTo();
+        networkId = c.getNetworkId();
+        inPortName = "[]";
+        fromIp = c.getFromIp();
+        toIp = c.getRemoteIp();
+        key = c.getKey();
+        this.bridge = bridge;
+    }
+    
+    public OvsCreateTunnelAnswer(Command cmd, boolean success, String details, String inPortName, String bridge) {
+        this(cmd, success, details, bridge);
+        this.inPortName = inPortName;
+    }
+    
+    
+    public Long getFrom() {
+        return from;
+    }
+    
+    public Long getTo() {
+        return to;
+    }
+    
+    public long getNetworkId() {
+        return networkId;
+    }
+    
+    public String getInPortName() {
+        return inPortName;
+    }
+    
+    public String getFromIp() {
+        return fromIp;
+    }
+    
+    public String getToIp() {
+        return toIp;
+    }
+    
+    public int getKey() {
+        return key;
+    }
+    
+    public String getBridge() {
+        return bridge;
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
new file mode 100644
index 0000000..1ececa0
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
@@ -0,0 +1,69 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsCreateTunnelCommand extends Command {
+    Integer key;
+    String remoteIp;
+    Long from;
+    Long to;
+    long networkId;
+
+    // for debug info
+    String fromIp;
+
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+    public OvsCreateTunnelCommand(String remoteIp, Integer key, Long from, Long to, long networkId, String fromIp) {
+        this.remoteIp = remoteIp;
+        this.key = key;
+        this.from = from;
+        this.to = to;
+        this.networkId = networkId;
+        this.fromIp = fromIp;
+    }
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getRemoteIp() {
+        return remoteIp;
+    }
+
+    public Long getFrom() {
+        return from;
+    }
+
+    public Long getTo() {
+        return to;
+    }
+
+    public long getNetworkId() {
+        return networkId;
+    }
+
+    public String getFromIp() {
+        return fromIp;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
new file mode 100644
index 0000000..2a6d5d7
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
@@ -0,0 +1,36 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsDeleteFlowCommand extends Command {
+    String vmName;
+
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    public OvsDeleteFlowCommand(String vmName) {
+        this.vmName = vmName;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
new file mode 100644
index 0000000..c3b5414
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
@@ -0,0 +1,61 @@
+// 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.
+/**
+ *  Copyright (C) 2012 Cloud.com, Inc.  All rights reserved.
+ * 
+ * This software is licensed under the GNU General Public License v3 or later.
+ * 
+ * It is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * 
+ */
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsDestroyBridgeCommand extends Command {
+
+    Long networkId;
+    Integer key;
+    
+    public OvsDestroyBridgeCommand(Long networkId, Integer key) {
+        this.networkId = networkId;
+        this.key = key;
+    }
+    
+    public Long getNetworkId() {
+        return networkId;
+    }
+    
+    public Integer getKey() {
+    	return key;
+    }
+    
+	@Override
+	public boolean executeInSequence() {
+		return true;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
new file mode 100644
index 0000000..4594d99
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
@@ -0,0 +1,50 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsDestroyTunnelCommand extends Command {
+    
+	Long networkId;
+	Integer key;
+    String inPortName;
+    
+    public OvsDestroyTunnelCommand(Long networkId, Integer key, String inPortName) {
+        this.networkId = networkId;
+        this.inPortName = inPortName;
+        this.key = key;
+    }
+    
+    public Long getNetworkId() {
+        return networkId;
+    }
+    
+    public String getInPortName() {
+        return inPortName;
+    }
+    
+    public Integer getKey() {
+    	return key;
+    }
+    
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
new file mode 100644
index 0000000..feff5dc
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
@@ -0,0 +1,75 @@
+// 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.
+/**
+ *  Copyright (C) 2010 Cloud.com, Inc.  All rights reserved.
+ * 
+ * This software is licensed under the GNU General Public License v3 or later.
+ * 
+ * It is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * 
+ */
+
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class OvsFetchInterfaceAnswer extends Answer {
+	String ip;
+    String netmask;
+    String mac;
+    String label;
+
+    public OvsFetchInterfaceAnswer(Command cmd, boolean success, String details) {
+        super(cmd, success, details);
+        this.label = ((OvsFetchInterfaceCommand)cmd).getLabel();
+    }
+
+    public OvsFetchInterfaceAnswer(Command cmd, boolean success,
+            String details, String ip, String netmask, String mac) {
+        super(cmd, success, details);
+        this.ip = ip;
+        this.netmask = netmask;
+        this.mac = mac;
+        this.label = ((OvsFetchInterfaceCommand)cmd).getLabel();
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public String getNetmask() {
+        return netmask;
+    }
+
+    public String getMac() {
+        return mac;
+    }
+
+    public String getLabel() {
+    	return label;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
new file mode 100644
index 0000000..0f82a33
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
@@ -0,0 +1,55 @@
+// 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.
+/**
+ *  Copyright (C) 2010 Cloud.com, Inc.  All rights reserved.
+ * 
+ * This software is licensed under the GNU General Public License v3 or later.
+ * 
+ * It is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * 
+ */
+
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsFetchInterfaceCommand extends Command {
+    String label;
+
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+    public OvsFetchInterfaceCommand(String label) {
+        this.label = label;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
new file mode 100644
index 0000000..ba16839
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
@@ -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.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class OvsSetTagAndFlowAnswer extends Answer {
+    Long vmId;
+    Long seqno;
+
+    public OvsSetTagAndFlowAnswer(Command cmd, boolean success, String details) {
+        super(cmd, success, details);
+        OvsSetTagAndFlowCommand c = (OvsSetTagAndFlowCommand) cmd;
+        this.vmId = c.getVmId();
+        this.seqno = Long.parseLong(c.getSeqNo());
+    }
+
+    public Long getVmId() {
+        return vmId;
+    }
+
+    public Long getSeqNo() {
+        return seqno;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
new file mode 100644
index 0000000..17121a0
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsSetTagAndFlowCommand extends Command {
+    String vlans;
+    String vmName;
+    String seqno;
+    String tag;
+    Long vmId;
+
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+    public String getSeqNo() {
+        return seqno;
+    }
+
+    public String getVlans() {
+        return vlans;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    public Long getVmId() {
+        return vmId;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public OvsSetTagAndFlowCommand(String vmName, String tag, String vlans, String seqno, Long vmId) {
+        this.vmName = vmName;
+        this.tag = tag;
+        this.vlans = vlans;
+        this.seqno = seqno;
+        this.vmId = vmId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
new file mode 100644
index 0000000..910138c
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
@@ -0,0 +1,67 @@
+// 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.
+/**
+ *  Copyright (C) 2010 Cloud.com, Inc.  All rights reserved.
+ * 
+ * This software is licensed under the GNU General Public License v3 or later.
+ * 
+ * It is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * 
+ */
+
+package com.cloud.network.ovs;
+
+import com.cloud.agent.api.Command;
+
+public class OvsSetupBridgeCommand extends Command {
+    Integer key;
+    Long hostId;
+    Long networkId;
+
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+    public OvsSetupBridgeCommand(Integer key, Long hostId, Long networkId) {
+        this.key = key;
+        this.hostId = hostId;
+        this.networkId = networkId;
+    }
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public Long getHostId() {
+        return hostId;
+    }
+
+    public Long getNetworkId() {
+    	return networkId;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4109415/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java
new file mode 100644
index 0000000..5b1e1bf
--- /dev/null
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java
@@ -0,0 +1,30 @@
+// Copyright 2012 Citrix Systems, Inc. Licensed under the
+// Apache License, Version 2.0 (the "License"); you may not use this
+// file except in compliance with the License.  Citrix Systems, Inc.
+// reserves all rights not expressly granted by 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.
+// 
+// Automatically generated by addcopyright.py at 04/03/2012
+package com.cloud.network.ovs;
+
+import com.cloud.deploy.DeployDestination;
+import com.cloud.network.Network;
+import com.cloud.utils.component.Manager;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachineProfile;
+
+public interface OvsTunnelManager extends Manager {
+	
+	boolean isOvsTunnelEnabled();
+
+    public void VmCheckAndCreateTunnel(VirtualMachineProfile<? extends VirtualMachine> vm,
+    		Network nw, DeployDestination dest);
+    
+    public void CheckAndDestroyTunnel(VirtualMachine vm, Network nw);
+
+}