cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [1/5] git commit: updated refs/heads/master to f321acd
Date Wed, 05 Jun 2013 07:22:23 GMT
Updated Branches:
  refs/heads/master 6a92f3b8a -> f321acd06


Pulling out Network operations into a separate manager

Network operations like VM, host and storage are pulled into a separate
managaer for simulator.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


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

Branch: refs/heads/master
Commit: 956a5967dd343dd9f50aec7fa8fb446ebe3dc423
Parents: 6a92f3b
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Tue Jun 4 19:15:53 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Wed Jun 5 12:23:07 2013 +0530

----------------------------------------------------------------------
 .../com/cloud/agent/manager/MockAgentManager.java  |   15 +--
 .../src/com/cloud/agent/manager/MockVmManager.java |   72 +++++++-----
 .../com/cloud/agent/manager/MockVmManagerImpl.java |   65 +++++------
 .../cloud/agent/manager/SimulatorManagerImpl.java  |   87 +++++++++++----
 .../src/com/cloud/network/vpc/VpcManagerImpl.java  |   43 ++++----
 5 files changed, 161 insertions(+), 121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/956a5967/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java
index fa02873..a5bdbfb 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java
@@ -16,10 +16,6 @@
 // under the License.
 package com.cloud.agent.manager;
 
-import java.util.Map;
-
-import javax.naming.ConfigurationException;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckHealthCommand;
 import com.cloud.agent.api.CheckNetworkCommand;
@@ -31,13 +27,12 @@ import com.cloud.resource.AgentResourceBase;
 import com.cloud.simulator.MockHost;
 import com.cloud.utils.component.Manager;
 
+import javax.naming.ConfigurationException;
+import java.util.Map;
+
 public interface MockAgentManager extends Manager {
-	public static final long DEFAULT_HOST_MEM_SIZE = 8 * 1024 * 1024 * 1024L; // 8G,
-																				// unit
-																				// of
-	// Mbytes
-	public static final int DEFAULT_HOST_CPU_CORES = 4; // 2 dual core CPUs (2 x
-	// 2)
+	public static final long DEFAULT_HOST_MEM_SIZE = 8 * 1024 * 1024 * 1024L; // 8G, unit of
Mbytes
+    public static final int DEFAULT_HOST_CPU_CORES = 4; // 2 dual core CPUs (2 x 2)
 	public static final int DEFAULT_HOST_SPEED_MHZ = 8000; // 1 GHz CPUs
 
 	boolean configure(String name, Map<String, Object> params) throws ConfigurationException;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/956a5967/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java
index c5f93b7..113bcaa 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java
@@ -16,88 +16,98 @@
 // under the License.
 package com.cloud.agent.manager;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.BumpUpPriorityCommand;
 import com.cloud.agent.api.CheckRouterAnswer;
 import com.cloud.agent.api.CheckRouterCommand;
 import com.cloud.agent.api.CheckVirtualMachineCommand;
 import com.cloud.agent.api.CleanupNetworkRulesCmd;
+import com.cloud.agent.api.CreateVMSnapshotCommand;
+import com.cloud.agent.api.DeleteVMSnapshotCommand;
 import com.cloud.agent.api.GetDomRVersionAnswer;
 import com.cloud.agent.api.GetDomRVersionCmd;
 import com.cloud.agent.api.GetVmStatsCommand;
 import com.cloud.agent.api.GetVncPortCommand;
 import com.cloud.agent.api.MigrateAnswer;
 import com.cloud.agent.api.MigrateCommand;
-import com.cloud.agent.api.NetworkUsageCommand;
+import com.cloud.agent.api.NetworkRulesVmSecondaryIpCommand;
 import com.cloud.agent.api.PrepareForMigrationAnswer;
 import com.cloud.agent.api.PrepareForMigrationCommand;
+import com.cloud.agent.api.RebootAnswer;
 import com.cloud.agent.api.RebootCommand;
+import com.cloud.agent.api.RevertToVMSnapshotCommand;
+import com.cloud.agent.api.ScaleVmCommand;
 import com.cloud.agent.api.SecurityGroupRuleAnswer;
 import com.cloud.agent.api.SecurityGroupRulesCmd;
+import com.cloud.agent.api.StartAnswer;
 import com.cloud.agent.api.StartCommand;
+import com.cloud.agent.api.StopAnswer;
 import com.cloud.agent.api.StopCommand;
 import com.cloud.agent.api.check.CheckSshAnswer;
 import com.cloud.agent.api.check.CheckSshCommand;
 import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
 import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
-import com.cloud.agent.api.routing.DhcpEntryCommand;
-import com.cloud.agent.api.routing.IpAssocCommand;
-import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
 import com.cloud.agent.api.routing.SavePasswordCommand;
-import com.cloud.agent.api.routing.SetFirewallRulesCommand;
-import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
-import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
 import com.cloud.agent.api.routing.VmDataCommand;
 import com.cloud.simulator.MockVMVO;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
 import com.cloud.vm.VirtualMachine.State;
 
+import java.util.HashMap;
+import java.util.Map;
+
 public interface MockVmManager extends Manager {
-    public Answer stopVM(StopCommand cmd);
-	public Answer rebootVM(RebootCommand cmd);
 
-    public Answer checkVmState(CheckVirtualMachineCommand cmd);
-    public Map<String, State> getVmStates(String hostGuid);
-    public Answer getVncPort(GetVncPortCommand cmd);
+    Map<String, State> getVmStates(String hostGuid);
 
-	Answer startVM(StartCommand cmd, SimulatorInfo info);
+    Map<String, MockVMVO> getVms(String hostGuid);
 
-	Answer getVmStats(GetVmStatsCommand cmd);
-    public CheckSshAnswer checkSshCommand(CheckSshCommand cmd);
+    HashMap<String, Pair<Long, Long>> syncNetworkGroups(SimulatorInfo info);
 
-    Answer SetStaticNatRules(SetStaticNatRulesCommand cmd);
+    StartAnswer startVM(StartCommand cmd, SimulatorInfo info);
 
-    Answer SetPortForwardingRules(SetPortForwardingRulesCommand cmd);
+    StopAnswer stopVM(StopCommand cmd);
 
-    Answer SetFirewallRules(SetFirewallRulesCommand cmd);
+    RebootAnswer rebootVM(RebootCommand cmd);
 
-    Answer getNetworkUsage(NetworkUsageCommand cmd);
+    Answer checkVmState(CheckVirtualMachineCommand cmd);
 
-    Answer IpAssoc(IpAssocCommand cmd);
+    Answer getVncPort(GetVncPortCommand cmd);
 
-    Answer LoadBalancerConfig(LoadBalancerConfigCommand cmd);
+	Answer getVmStats(GetVmStatsCommand cmd);
 
-    Answer AddDhcpEntry(DhcpEntryCommand cmd);
+    CheckSshAnswer checkSshCommand(CheckSshCommand cmd);
 
     Answer setVmData(VmDataCommand cmd);
-    Answer CleanupNetworkRules(CleanupNetworkRulesCmd cmd, SimulatorInfo info);
 
     Answer CheckConsoleProxyLoad(CheckConsoleProxyLoadCommand cmd);
+
     Answer WatchConsoleProxyLoad(WatchConsoleProxyLoadCommand cmd);
 
     Answer SavePassword(SavePasswordCommand cmd);
-    HashMap<String, Pair<Long, Long>> syncNetworkGroups(SimulatorInfo info);
-    SecurityGroupRuleAnswer AddSecurityGroupRules(SecurityGroupRulesCmd cmd, SimulatorInfo
info);
-	MigrateAnswer Migrate(MigrateCommand cmd, SimulatorInfo info);
+
+    MigrateAnswer Migrate(MigrateCommand cmd, SimulatorInfo info);
+
     PrepareForMigrationAnswer prepareForMigrate(PrepareForMigrationCommand cmd);
-	GetDomRVersionAnswer getDomRVersion(GetDomRVersionCmd cmd);
-	Map<String, MockVMVO> getVms(String hostGuid);
+
+    SecurityGroupRuleAnswer AddSecurityGroupRules(SecurityGroupRulesCmd cmd, SimulatorInfo
info);
+
+    GetDomRVersionAnswer getDomRVersion(GetDomRVersionCmd cmd);
 
     CheckRouterAnswer checkRouter(CheckRouterCommand cmd);
 
     Answer bumpPriority(BumpUpPriorityCommand cmd);
+
+    Answer CleanupNetworkRules(CleanupNetworkRulesCmd cmd, SimulatorInfo info);
+
+    Answer scaleVm(ScaleVmCommand cmd);
+
+    Answer plugSecondaryIp(NetworkRulesVmSecondaryIpCommand cmd);
+
+    Answer createVmSnapshot(CreateVMSnapshotCommand cmd);
+
+    Answer deleteVmSnapshot(DeleteVMSnapshotCommand cmd);
+
+    Answer revertVmSnapshot(RevertToVMSnapshotCommand cmd);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/956a5967/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
index c0ccbe4..356284c 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
@@ -346,7 +346,7 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
     }
 
     @Override
-    public Answer startVM(StartCommand cmd, SimulatorInfo info) {
+    public StartAnswer startVM(StartCommand cmd, SimulatorInfo info) {
         VirtualMachineTO vm = cmd.getVirtualMachine();
         String result = startVM(vm.getName(), vm.getNics(), vm.getCpus()* vm.getMaxSpeed(),
vm.getMaxRam(), vm.getBootArgs(), info.getHostUuid());
         if (result != null) {
@@ -361,28 +361,9 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
         return new CheckSshAnswer(cmd);
     }
 
-    @Override
-    public Answer SetStaticNatRules(SetStaticNatRulesCommand cmd) {
-        return new Answer(cmd);
-    }
-
-    @Override
-    public Answer SetPortForwardingRules(SetPortForwardingRulesCommand cmd) {
-        return new Answer(cmd);
-    }
-
-    @Override
-    public Answer SetFirewallRules(SetFirewallRulesCommand cmd) {
-        return new Answer(cmd);
-    }
 
 
     @Override
-    public NetworkUsageAnswer getNetworkUsage(NetworkUsageCommand cmd) {
-        return new NetworkUsageAnswer(cmd, null, 100L, 100L);
-    }
-
-    @Override
     public MigrateAnswer Migrate(MigrateCommand cmd, SimulatorInfo info) {
         Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
         try {
@@ -438,21 +419,6 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
     }
 
     @Override
-    public Answer IpAssoc(IpAssocCommand cmd) {
-        return new Answer(cmd);
-    }
-
-    @Override
-    public Answer LoadBalancerConfig(LoadBalancerConfigCommand cmd) {
-        return new Answer(cmd);
-    }
-
-    @Override
-    public Answer AddDhcpEntry(DhcpEntryCommand cmd) {
-        return new Answer(cmd);
-    }
-
-    @Override
     public Answer setVmData(VmDataCommand cmd) {
         return new Answer(cmd);
     }
@@ -482,7 +448,32 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
     }
 
     @Override
-    public Answer stopVM(StopCommand cmd) {
+    public Answer scaleVm(ScaleVmCommand cmd) {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    @Override
+    public Answer plugSecondaryIp(NetworkRulesVmSecondaryIpCommand cmd) {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    @Override
+    public Answer createVmSnapshot(CreateVMSnapshotCommand cmd) {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    @Override
+    public Answer deleteVmSnapshot(DeleteVMSnapshotCommand cmd) {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    @Override
+    public Answer revertVmSnapshot(RevertToVMSnapshotCommand cmd) {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    @Override
+    public StopAnswer stopVM(StopCommand cmd) {
         Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
         try {
             txn.start();
@@ -509,7 +500,7 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
     }
 
     @Override
-    public Answer rebootVM(RebootCommand cmd) {
+    public RebootAnswer rebootVM(RebootCommand cmd) {
         Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
         try {
             txn.start();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/956a5967/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
index ab6eec3..8f6116c 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
@@ -16,16 +16,6 @@
 // under the License.
 package com.cloud.agent.manager;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.AttachIsoCommand;
 import com.cloud.agent.api.AttachVolumeCommand;
@@ -34,6 +24,7 @@ import com.cloud.agent.api.BumpUpPriorityCommand;
 import com.cloud.agent.api.CheckHealthCommand;
 import com.cloud.agent.api.CheckNetworkCommand;
 import com.cloud.agent.api.CheckRouterCommand;
+import com.cloud.agent.api.CheckS2SVpnConnectionsCommand;
 import com.cloud.agent.api.CheckVirtualMachineCommand;
 import com.cloud.agent.api.CleanupNetworkRulesCmd;
 import com.cloud.agent.api.ClusterSyncCommand;
@@ -42,9 +33,11 @@ import com.cloud.agent.api.ComputeChecksumCommand;
 import com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand;
 import com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand;
 import com.cloud.agent.api.CreateStoragePoolCommand;
+import com.cloud.agent.api.CreateVMSnapshotCommand;
 import com.cloud.agent.api.CreateVolumeFromSnapshotCommand;
 import com.cloud.agent.api.DeleteSnapshotBackupCommand;
 import com.cloud.agent.api.DeleteStoragePoolCommand;
+import com.cloud.agent.api.DeleteVMSnapshotCommand;
 import com.cloud.agent.api.GetDomRVersionCmd;
 import com.cloud.agent.api.GetHostStatsCommand;
 import com.cloud.agent.api.GetStorageStatsCommand;
@@ -54,26 +47,38 @@ import com.cloud.agent.api.MaintainCommand;
 import com.cloud.agent.api.ManageSnapshotCommand;
 import com.cloud.agent.api.MigrateCommand;
 import com.cloud.agent.api.ModifyStoragePoolCommand;
+import com.cloud.agent.api.NetworkRulesVmSecondaryIpCommand;
 import com.cloud.agent.api.NetworkUsageCommand;
 import com.cloud.agent.api.PingTestCommand;
+import com.cloud.agent.api.PlugNicCommand;
 import com.cloud.agent.api.PrepareForMigrationCommand;
+import com.cloud.agent.api.PvlanSetupCommand;
 import com.cloud.agent.api.RebootCommand;
+import com.cloud.agent.api.RevertToVMSnapshotCommand;
+import com.cloud.agent.api.ScaleVmCommand;
 import com.cloud.agent.api.SecStorageSetupCommand;
 import com.cloud.agent.api.SecStorageVMSetupCommand;
 import com.cloud.agent.api.SecurityGroupRulesCmd;
 import com.cloud.agent.api.StartCommand;
 import com.cloud.agent.api.StopCommand;
 import com.cloud.agent.api.StoragePoolInfo;
+import com.cloud.agent.api.UnPlugNicCommand;
 import com.cloud.agent.api.check.CheckSshCommand;
 import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
 import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
 import com.cloud.agent.api.routing.DhcpEntryCommand;
 import com.cloud.agent.api.routing.IpAssocCommand;
+import com.cloud.agent.api.routing.IpAssocVpcCommand;
 import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
 import com.cloud.agent.api.routing.SavePasswordCommand;
 import com.cloud.agent.api.routing.SetFirewallRulesCommand;
+import com.cloud.agent.api.routing.SetNetworkACLCommand;
 import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
+import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand;
+import com.cloud.agent.api.routing.SetSourceNatCommand;
 import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.agent.api.routing.SetStaticRouteCommand;
+import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand;
 import com.cloud.agent.api.routing.VmDataCommand;
 import com.cloud.agent.api.storage.CopyVolumeCommand;
 import com.cloud.agent.api.storage.CreateCommand;
@@ -96,19 +101,29 @@ import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.VirtualMachine.State;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.HashMap;
+import java.util.Map;
 
 @Component
 @Local(value = { SimulatorManager.class })
 public class SimulatorManagerImpl extends ManagerBase implements SimulatorManager {
     private static final Logger s_logger = Logger.getLogger(SimulatorManagerImpl.class);
     @Inject
-    MockVmManager _mockVmMgr = null;
+    MockVmManager _mockVmMgr;
+    @Inject
+    MockStorageManager _mockStorageMgr;
     @Inject
-    MockStorageManager _mockStorageMgr = null;
+    MockAgentManager _mockAgentMgr;
     @Inject
-    MockAgentManager _mockAgentMgr = null;
+    MockNetworkManager _mockNetworkMgr;
     @Inject
-    MockConfigurationDao _mockConfigDao = null;
+    MockConfigurationDao _mockConfigDao;
     @Inject
     MockHostDao _mockHost = null;
     private ConnectionConcierge _concierge;
@@ -213,19 +228,19 @@ public class SimulatorManagerImpl extends ManagerBase implements SimulatorManage
             } else if (cmd instanceof CheckVirtualMachineCommand) {
                 return _mockVmMgr.checkVmState((CheckVirtualMachineCommand) cmd);
             } else if (cmd instanceof SetStaticNatRulesCommand) {
-                return _mockVmMgr.SetStaticNatRules((SetStaticNatRulesCommand) cmd);
+                return _mockNetworkMgr.SetStaticNatRules((SetStaticNatRulesCommand) cmd);
             } else if (cmd instanceof SetFirewallRulesCommand) {
-                return _mockVmMgr.SetFirewallRules((SetFirewallRulesCommand) cmd);
+                return _mockNetworkMgr.SetFirewallRules((SetFirewallRulesCommand) cmd);
             } else if (cmd instanceof SetPortForwardingRulesCommand) {
-                return _mockVmMgr.SetPortForwardingRules((SetPortForwardingRulesCommand)
cmd);
+                return _mockNetworkMgr.SetPortForwardingRules((SetPortForwardingRulesCommand)
cmd);
             } else if (cmd instanceof NetworkUsageCommand) {
-                return _mockVmMgr.getNetworkUsage((NetworkUsageCommand) cmd);
+                return _mockNetworkMgr.getNetworkUsage((NetworkUsageCommand) cmd);
             } else if (cmd instanceof IpAssocCommand) {
-                return _mockVmMgr.IpAssoc((IpAssocCommand) cmd);
+                return _mockNetworkMgr.IpAssoc((IpAssocCommand) cmd);
             } else if (cmd instanceof LoadBalancerConfigCommand) {
-                return _mockVmMgr.LoadBalancerConfig((LoadBalancerConfigCommand) cmd);
+                return _mockNetworkMgr.LoadBalancerConfig((LoadBalancerConfigCommand) cmd);
             } else if (cmd instanceof DhcpEntryCommand) {
-                return _mockVmMgr.AddDhcpEntry((DhcpEntryCommand) cmd);
+                return _mockNetworkMgr.AddDhcpEntry((DhcpEntryCommand) cmd);
             } else if (cmd instanceof VmDataCommand) {
                 return _mockVmMgr.setVmData((VmDataCommand) cmd);
             } else if (cmd instanceof CleanupNetworkRulesCmd) {
@@ -306,6 +321,36 @@ public class SimulatorManagerImpl extends ManagerBase implements SimulatorManage
                 return new Answer(cmd);
             } else if (cmd instanceof CopyVolumeCommand) {
                 return _mockStorageMgr.CopyVolume((CopyVolumeCommand) cmd);
+            } else if (cmd instanceof PlugNicCommand) {
+                return _mockNetworkMgr.plugNic((PlugNicCommand) cmd);
+            } else if (cmd instanceof UnPlugNicCommand) {
+                return _mockNetworkMgr.unplugNic((UnPlugNicCommand) cmd);
+            } else if (cmd instanceof IpAssocVpcCommand) {
+                return _mockNetworkMgr.ipAssoc((IpAssocVpcCommand) cmd);
+            } else if (cmd instanceof SetSourceNatCommand) {
+                return _mockNetworkMgr.setSourceNat((SetSourceNatCommand) cmd);
+            } else if (cmd instanceof SetNetworkACLCommand) {
+                return _mockNetworkMgr.setNetworkAcl((SetNetworkACLCommand) cmd);
+            } else if (cmd instanceof SetPortForwardingRulesVpcCommand) {
+                return _mockNetworkMgr.setVpcPortForwards((SetPortForwardingRulesVpcCommand)
cmd);
+            } else if (cmd instanceof SetStaticRouteCommand) {
+                return _mockNetworkMgr.setStaticRoute((SetStaticRouteCommand) cmd);
+            } else if (cmd instanceof Site2SiteVpnCfgCommand) {
+                return _mockNetworkMgr.siteToSiteVpn((Site2SiteVpnCfgCommand) cmd);
+            } else if (cmd instanceof CheckS2SVpnConnectionsCommand) {
+                return _mockNetworkMgr.checkSiteToSiteVpnConnection((CheckS2SVpnConnectionsCommand)
cmd);
+            } else if (cmd instanceof CreateVMSnapshotCommand) {
+                return _mockVmMgr.createVmSnapshot((CreateVMSnapshotCommand)cmd);
+            } else if (cmd instanceof DeleteVMSnapshotCommand) {
+                return _mockVmMgr.deleteVmSnapshot((DeleteVMSnapshotCommand)cmd);
+            } else if (cmd instanceof RevertToVMSnapshotCommand) {
+                return _mockVmMgr.revertVmSnapshot((RevertToVMSnapshotCommand)cmd);
+            } else if (cmd instanceof NetworkRulesVmSecondaryIpCommand) {
+                return _mockVmMgr.plugSecondaryIp((NetworkRulesVmSecondaryIpCommand)cmd);
+            } else if (cmd instanceof ScaleVmCommand) {
+                return _mockVmMgr.scaleVm((ScaleVmCommand) cmd);
+            } else if (cmd instanceof PvlanSetupCommand) {
+                return _mockNetworkMgr.setupPVLAN((PvlanSetupCommand) cmd);
             } else {
                 return Answer.createUnsupportedCommandAnswer(cmd);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/956a5967/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 1c4adde..b41003a 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -16,27 +16,6 @@
 // under the License.
 package com.cloud.network.vpc;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-import org.apache.cloudstack.api.command.user.vpc.ListPrivateGatewaysCmd;
-import org.apache.cloudstack.api.command.user.vpc.ListStaticRoutesCmd;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import com.cloud.configuration.Config;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.Resource.ResourceType;
@@ -80,6 +59,7 @@ import com.cloud.network.dao.Site2SiteVpnGatewayDao;
 import com.cloud.network.element.StaticNatServiceProvider;
 import com.cloud.network.element.VpcProvider;
 import com.cloud.network.vpc.VpcOffering.State;
+import com.cloud.network.vpc.dao.NetworkACLDao;
 import com.cloud.network.vpc.dao.PrivateIpDao;
 import com.cloud.network.vpc.dao.StaticRouteDao;
 import com.cloud.network.vpc.dao.VpcDao;
@@ -87,7 +67,6 @@ import com.cloud.network.vpc.dao.VpcGatewayDao;
 import com.cloud.network.vpc.dao.VpcOfferingDao;
 import com.cloud.network.vpc.dao.VpcOfferingServiceMapDao;
 import com.cloud.network.vpc.dao.VpcServiceMapDao;
-import com.cloud.network.vpc.dao.NetworkACLDao;
 import com.cloud.network.vpn.Site2SiteVpnManager;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.NetworkOfferingServiceMapVO;
@@ -121,6 +100,25 @@ import com.cloud.utils.net.NetUtils;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.ReservationContextImpl;
 import com.cloud.vm.dao.DomainRouterDao;
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.api.command.user.vpc.ListPrivateGatewaysCmd;
+import org.apache.cloudstack.api.command.user.vpc.ListStaticRoutesCmd;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
 
 
 @Component
@@ -2115,6 +2113,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         hTypes.add(HypervisorType.XenServer);
         hTypes.add(HypervisorType.VMware);
         hTypes.add(HypervisorType.KVM);
+        hTypes.add(HypervisorType.Simulator);
         return hTypes;
     }
 


Mime
View raw message