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 2014/04/25 13:52:34 UTC
git commit: updated refs/heads/master to bf188fc
Repository: cloudstack
Updated Branches:
refs/heads/master cf4db845f -> bf188fc13
CLOUDSTACK-6431: OVS migrating vm to a new host added to the cluster
does not create gre tunnel port on the new host
ensure OveElement gets a chance to setup tunnel network on the host
before VM is migrated.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bf188fc1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bf188fc1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bf188fc1
Branch: refs/heads/master
Commit: bf188fc13b0162a98146f5cc12cc196571b87910
Parents: cf4db84
Author: Murali Reddy <mu...@gmail.com>
Authored: Fri Apr 25 17:18:24 2014 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Fri Apr 25 17:22:21 2014 +0530
----------------------------------------------------------------------
.../com/cloud/network/element/OvsElement.java | 39 +++++++++++++++++++-
1 file changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf188fc1/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
index d767834..faf58fc 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
@@ -54,6 +54,7 @@ import com.cloud.network.PublicIpAddress;
import com.cloud.network.dao.NetworkServiceMapDao;
import com.cloud.network.lb.LoadBalancingRule;
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
+import com.cloud.network.NetworkMigrationResponder;
import com.cloud.network.ovs.OvsTunnelManager;
import com.cloud.network.router.VirtualRouter.Role;
import com.cloud.network.router.VpcVirtualNetworkApplianceManager;
@@ -79,10 +80,10 @@ import com.cloud.vm.VirtualMachine;
@Local(value = {NetworkElement.class, ConnectivityProvider.class,
SourceNatServiceProvider.class, StaticNatServiceProvider.class,
- PortForwardingServiceProvider.class, IpDeployer.class})
+ PortForwardingServiceProvider.class, IpDeployer.class, NetworkMigrationResponder.class})
public class OvsElement extends AdapterBase implements NetworkElement,
OvsElementService, ConnectivityProvider, ResourceStateAdapter,
-PortForwardingServiceProvider, LoadBalancingServiceProvider,
+PortForwardingServiceProvider, LoadBalancingServiceProvider, NetworkMigrationResponder,
StaticNatServiceProvider, IpDeployer {
@Inject
OvsTunnelManager _ovsTunnelMgr;
@@ -658,4 +659,38 @@ StaticNatServiceProvider, IpDeployer {
}
return true;
}
+
+ @Override
+ public boolean prepareMigration(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) {
+ if (!canHandle(network, Service.Connectivity)) {
+ return false;
+ }
+
+ if (nic.getBroadcastType() != Networks.BroadcastDomainType.Vswitch) {
+ return false;
+ }
+
+ if (nic.getTrafficType() != Networks.TrafficType.Guest) {
+ return false;
+ }
+
+ if (vm.getType() != VirtualMachine.Type.User && vm.getType() != VirtualMachine.Type.DomainRouter) {
+ return false;
+ }
+
+ // prepare the tunnel network on the host, in order for VM to get launched
+ _ovsTunnelMgr.checkAndPrepareHostForTunnelNetwork(network, dest.getHost());
+
+ return true;
+ }
+
+ @Override
+ public void rollbackMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) {
+ return;
+ }
+
+ @Override
+ public void commitMigration(NicProfile nic, Network network, VirtualMachineProfile vm, ReservationContext src, ReservationContext dst) {
+ return;
+ }
}