incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [2/2] git commit: nonoss compiled up til netscaler
Date Thu, 24 Jan 2013 01:19:09 GMT
Updated Branches:
  refs/heads/javelin e67381b76 -> 6088cbfe4


nonoss compiled up til netscaler


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

Branch: refs/heads/javelin
Commit: 6088cbfe479ae54f04546c2f25d9988debc5391a
Parents: 8e2a969
Author: Alex Huang <alex.huang@citrix.com>
Authored: Wed Jan 23 17:18:34 2013 -0800
Committer: Alex Huang <alex.huang@citrix.com>
Committed: Wed Jan 23 17:18:55 2013 -0800

----------------------------------------------------------------------
 .../cloud/api/commands/netapp/AssociateLunCmd.java |    6 +-
 .../cloud/api/commands/netapp/CreateLunCmd.java    |    5 +-
 .../commands/netapp/CreateVolumeOnFilerCmd.java    |    7 +-
 .../api/commands/netapp/CreateVolumePoolCmd.java   |    5 +-
 .../api/commands/netapp/DeleteVolumePoolCmd.java   |    7 +-
 .../cloud/api/commands/netapp/DestroyLunCmd.java   |    5 +-
 .../commands/netapp/DestroyVolumeOnFilerCmd.java   |    7 +-
 .../api/commands/netapp/DissociateLunCmd.java      |    5 +-
 .../com/cloud/api/commands/netapp/ListLunsCmd.java |    5 +-
 .../api/commands/netapp/ListVolumePoolsCmd.java    |    5 +-
 .../api/commands/netapp/ListVolumesOnFilerCmd.java |    7 +-
 .../api/commands/netapp/ModifyVolumePoolCmd.java   |    8 +-
 .../src/com/cloud/hypervisor/guru/VMwareGuru.java  |  358 +++++++-------
 .../cloud/hypervisor/vmware/VmwareCleanupMaid.java |   23 +-
 .../vmware/resource/VmwareContextFactory.java      |    6 +-
 15 files changed, 234 insertions(+), 225 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
index 62c94ca..5d9ad07 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/AssociateLunCmd.java
@@ -18,6 +18,8 @@ package com.cloud.api.commands.netapp;
 
 import java.rmi.ServerException;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -70,10 +72,10 @@ public class AssociateLunCmd extends BaseCmd {
 		return s_name;
 	}
 	
+	@Inject NetappManager netappMgr;
+	
     @Override
     public void execute(){
-    	ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	
     	try {
     		AssociateLunCmdResponse response = new AssociateLunCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
index d94b7c9..a0c1983 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateLunCmd.java
@@ -18,6 +18,8 @@ package com.cloud.api.commands.netapp;
 
 import java.rmi.ServerException;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -58,13 +60,12 @@ public class CreateLunCmd extends BaseCmd {
     public long getLunSize() {
     	return size;
     }
+    @Inject NetappManager netappMgr;
 
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	
     	try {
     		CreateLunCmdResponse response = new CreateLunCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java
index 9480c85..56e9441 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumeOnFilerCmd.java
@@ -19,6 +19,8 @@ package com.cloud.api.commands.netapp;
 import java.net.UnknownHostException;
 import java.rmi.ServerException;
 
+import javax.inject.Inject;
+
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseCmd;
@@ -102,6 +104,8 @@ public class CreateVolumeOnFilerCmd extends BaseCmd {
     public String getPassword() {
     	return password;
     }
+    
+    @Inject NetappManager netappMgr;
 
 	@Override
 	public void execute() throws ResourceUnavailableException,
@@ -111,9 +115,6 @@ public class CreateVolumeOnFilerCmd extends BaseCmd {
 		if(snapshotReservation != null && (snapshotReservation<0 || snapshotReservation>100))
 			throw new InvalidParameterValueException("Invalid snapshot reservation");
 		
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
-    	
 		StringBuilder s = new StringBuilder(getVolSize().toString());
 		s.append("g");
 	

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
index ae0e411..a83b2c9 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/CreateVolumePoolCmd.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.api.commands.netapp;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -51,13 +53,12 @@ public class CreateVolumePoolCmd extends BaseCmd {
     public String getAlgorithm() {
     	return algorithm;
     }
+    @Inject NetappManager netappMgr;
 
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	
     	try {
     		CreateVolumePoolCmdResponse response = new CreateVolumePoolCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
index f5da74a..f17c61c 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DeleteVolumePoolCmd.java
@@ -17,6 +17,8 @@
 package com.cloud.api.commands.netapp;
 
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -32,7 +34,6 @@ import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceInUseException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.netapp.NetappManager;
-import com.cloud.server.ManagementService;
 import com.cloud.server.api.response.netapp.DeleteVolumePoolCmdResponse;
 
 
@@ -43,13 +44,13 @@ public class DeleteVolumePoolCmd extends BaseCmd {
     
     @Parameter(name=ApiConstants.POOL_NAME, type=CommandType.STRING, required = true, description="pool
name.")
 	private String poolName;
+    
+    @Inject NetappManager netappMgr;
 
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	try {
 			netappMgr.deletePool(poolName);
 			DeleteVolumePoolCmdResponse response = new DeleteVolumePoolCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
index d6a857c..f08defc 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyLunCmd.java
@@ -18,6 +18,8 @@ package com.cloud.api.commands.netapp;
 
 import java.rmi.ServerException;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -45,12 +47,11 @@ public class DestroyLunCmd extends BaseCmd {
     @Parameter(name=ApiConstants.PATH, type=CommandType.STRING, required = true, description="LUN
path.")
 	private String path;
 
+    @Inject NetappManager netappMgr;
     @Override
     public void execute() throws ResourceUnavailableException,
     InsufficientCapacityException, ServerApiException,
     ConcurrentOperationException, ResourceAllocationException {
-    	ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	try {
 			netappMgr.destroyLunOnFiler(path);
     		DeleteLUNCmdResponse response = new DeleteLUNCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
index ab1e0df..0541370 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DestroyVolumeOnFilerCmd.java
@@ -18,6 +18,8 @@ package com.cloud.api.commands.netapp;
 
 import java.rmi.ServerException;
 
+import javax.inject.Inject;
+
 import org.apache.cloudstack.api.*;
 import org.apache.log4j.Logger;
 
@@ -29,7 +31,6 @@ import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceInUseException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.netapp.NetappManager;
-import com.cloud.server.ManagementService;
 import com.cloud.server.api.response.netapp.DeleteVolumeOnFilerCmdResponse;
 
 
@@ -47,13 +48,13 @@ public class DestroyVolumeOnFilerCmd extends BaseCmd {
     @Parameter(name=ApiConstants.VOLUME_NAME, type=CommandType.STRING, required = true, description="volume
name.")
 	private String volumeName;
     
+    @Inject NetappManager netappMgr;
+    
     
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	try {
     		netappMgr.destroyVolumeOnFiler(ipAddr, aggrName, volumeName);
     		DeleteVolumeOnFilerCmdResponse response = new DeleteVolumeOnFilerCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
index 1fc42ea..ac6dbf0 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/DissociateLunCmd.java
@@ -18,6 +18,8 @@ package com.cloud.api.commands.netapp;
 
 import java.rmi.ServerException;
 
+import javax.inject.Inject;
+
 import org.apache.cloudstack.api.*;
 import org.apache.log4j.Logger;
 
@@ -43,12 +45,11 @@ public class DissociateLunCmd extends BaseCmd {
     @Parameter(name=ApiConstants.IQN, type=CommandType.STRING, required = true, description="Guest
IQN.")
 	private String guestIQN;
     
+    @Inject NetappManager netappMgr;
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	try {
     		netappMgr.disassociateLun(guestIQN, path);
     		DissociateLunCmdResponse response = new DissociateLunCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
index d1bf7ea..90bc5f3 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListLunsCmd.java
@@ -19,6 +19,8 @@ package com.cloud.api.commands.netapp;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -48,12 +50,11 @@ public class ListLunsCmd extends BaseCmd
     @Parameter(name=ApiConstants.POOL_NAME, type=CommandType.STRING, required = true, description="pool
name.")
 	private String poolName;
 
+    @Inject NetappManager netappMgr;
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	try {
     		List<LunVO> lunList = netappMgr.listLunsOnFiler(poolName);
     		ListResponse<ListLunsCmdResponse> listResponse = new ListResponse<ListLunsCmdResponse>();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
index 6ab551e..fd9b17d 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumePoolsCmd.java
@@ -19,6 +19,8 @@ package com.cloud.api.commands.netapp;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -42,13 +44,12 @@ public class ListVolumePoolsCmd extends BaseCmd {
 	public static final Logger s_logger = Logger.getLogger(ListVolumePoolsCmd.class.getName());
     private static final String s_name = "listpoolresponse";
 
+    @Inject NetappManager netappMgr;
 
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
     	try {
     		List<PoolVO> poolList = netappMgr.listPools();
     		ListResponse<ListVolumePoolsCmdResponse> listResponse = new ListResponse<ListVolumePoolsCmdResponse>();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
index 7d26365..ac839ba 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ListVolumesOnFilerCmd.java
@@ -19,6 +19,8 @@ package com.cloud.api.commands.netapp;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import org.apache.cloudstack.api.*;
 import org.apache.log4j.Logger;
 
@@ -42,14 +44,13 @@ public class ListVolumesOnFilerCmd extends BaseCmd {
     
     @Parameter(name=ApiConstants.POOL_NAME, type=CommandType.STRING, required = true, description="pool
name.")
 	private String poolName;
+    
+    @Inject NetappManager netappMgr;
 
 	@Override
 	public void execute() throws ResourceUnavailableException,
 			InsufficientCapacityException, ServerApiException,
 			ConcurrentOperationException, ResourceAllocationException {
-		ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
-    	
     	try {
     		List<NetappVolumeVO> volumes = netappMgr.listVolumesOnFiler(poolName);
     		ListResponse<ListVolumesOnFilerCmdResponse> listResponse = new ListResponse<ListVolumesOnFilerCmdResponse>();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
----------------------------------------------------------------------
diff --git a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
index 6282a64..268345a 100644
--- a/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
+++ b/plugins/file-systems/netapp/src/com/cloud/api/commands/netapp/ModifyVolumePoolCmd.java
@@ -17,6 +17,8 @@
 package com.cloud.api.commands.netapp;
 
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -29,7 +31,6 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.netapp.NetappManager;
-import com.cloud.server.ManagementService;
 import com.cloud.server.api.response.netapp.ModifyVolumePoolCmdResponse;
 
 
@@ -43,14 +44,13 @@ public class ModifyVolumePoolCmd extends BaseCmd {
 
     @Parameter(name=ApiConstants.ALGORITHM, type=CommandType.STRING, required = true, description="algorithm.")
 	private String algorithm;
+    
+    @Inject NetappManager netappMgr;
 
     @Override
     public void execute() throws ResourceUnavailableException,
     InsufficientCapacityException, ServerApiException,
     ConcurrentOperationException, ResourceAllocationException {
-    	ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
-    	NetappManager netappMgr = locator.getManager(NetappManager.class);
-
     	netappMgr.modifyPool(poolName, algorithm);
 
     	ModifyVolumePoolCmdResponse response = new ModifyVolumePoolCmdResponse();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index 65fbf4a..638b0e3 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -38,7 +38,6 @@ import com.cloud.agent.api.storage.CopyVolumeCommand;
 import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.agent.api.to.VirtualMachineTO;
-import com.cloud.cluster.CheckPointManager;
 import com.cloud.cluster.ClusterManager;
 import com.cloud.exception.InsufficientAddressCapacityException;
 import com.cloud.host.HostVO;
@@ -47,7 +46,6 @@ import com.cloud.host.dao.HostDetailsDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.hypervisor.HypervisorGuru;
 import com.cloud.hypervisor.HypervisorGuruBase;
-import com.cloud.hypervisor.vmware.VmwareCleanupMaid;
 import com.cloud.hypervisor.vmware.manager.VmwareManager;
 import com.cloud.hypervisor.vmware.mo.VirtualEthernetCardType;
 import com.cloud.network.NetworkModel;
@@ -75,23 +73,22 @@ import com.cloud.vm.VmDetailConstants;
 @Component
 @Local(value=HypervisorGuru.class)
 public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru {
-	private static final Logger s_logger = Logger.getLogger(VMwareGuru.class);
+    private static final Logger s_logger = Logger.getLogger(VMwareGuru.class);
 
-	@Inject NetworkDao _networkDao;
-	@Inject GuestOSDao _guestOsDao;
+    @Inject NetworkDao _networkDao;
+    @Inject GuestOSDao _guestOsDao;
     @Inject HostDao _hostDao;
     @Inject HostDetailsDao _hostDetailsDao;
     @Inject CommandExecLogDao _cmdExecLogDao;
     @Inject ClusterManager _clusterMgr;
     @Inject VmwareManager _vmwareMgr;
     @Inject SecondaryStorageVmManager _secStorageMgr;
-    @Inject CheckPointManager _checkPointMgr;
     @Inject NetworkModel _networkMgr;
 
     protected VMwareGuru() {
-    	super();
+        super();
     }
-    
+
     @Override
     public HypervisorType getHypervisorType() {
         return HypervisorType.VMware;
@@ -102,117 +99,117 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru
{
         VirtualMachineTO to = toVirtualMachineTO(vm);
         to.setBootloader(BootloaderType.HVM);
 
-    	Map<String, String> details = to.getDetails();
-    	if(details == null)
-    		details = new HashMap<String, String>();
-        
-    	String nicDeviceType = details.get(VmDetailConstants.NIC_ADAPTER);
+        Map<String, String> details = to.getDetails();
+        if(details == null)
+            details = new HashMap<String, String>();
+
+        String nicDeviceType = details.get(VmDetailConstants.NIC_ADAPTER);
         if(vm.getVirtualMachine() instanceof DomainRouterVO || vm.getVirtualMachine() instanceof
ConsoleProxyVO 
-        	|| vm.getVirtualMachine() instanceof SecondaryStorageVmVO) {
-        	
-        	if(nicDeviceType == null) {
-        		details.put(VmDetailConstants.NIC_ADAPTER, _vmwareMgr.getSystemVMDefaultNicAdapterType());
-        	} else {
-        		try {
-        			VirtualEthernetCardType.valueOf(nicDeviceType);
-        		} catch (Exception e) {
-        			s_logger.warn("Invalid NIC device type " + nicDeviceType + " is specified in VM
details, switch to default E1000");
-            		details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
-        		}
-        	}
+                || vm.getVirtualMachine() instanceof SecondaryStorageVmVO) {
+
+            if(nicDeviceType == null) {
+                details.put(VmDetailConstants.NIC_ADAPTER, _vmwareMgr.getSystemVMDefaultNicAdapterType());
+            } else {
+                try {
+                    VirtualEthernetCardType.valueOf(nicDeviceType);
+                } catch (Exception e) {
+                    s_logger.warn("Invalid NIC device type " + nicDeviceType + " is specified
in VM details, switch to default E1000");
+                    details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
+                }
+            }
         } else {
-        	// for user-VM, use E1000 as default
-        	if(nicDeviceType == null) {
-        		details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
-        	} else {
-        		try {
-        			VirtualEthernetCardType.valueOf(nicDeviceType);
-        		} catch (Exception e) {
-        			s_logger.warn("Invalid NIC device type " + nicDeviceType + " is specified in VM
details, switch to default E1000");
-            		details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
-        		}
-        	}
+            // for user-VM, use E1000 as default
+            if(nicDeviceType == null) {
+                details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
+            } else {
+                try {
+                    VirtualEthernetCardType.valueOf(nicDeviceType);
+                } catch (Exception e) {
+                    s_logger.warn("Invalid NIC device type " + nicDeviceType + " is specified
in VM details, switch to default E1000");
+                    details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
+                }
+            }
+        }
+        to.setDetails(details);
+
+        if(vm.getVirtualMachine() instanceof DomainRouterVO) {
+            List<NicProfile> nicProfiles = vm.getNics();
+            NicProfile publicNicProfile = null;
+
+            for(NicProfile nicProfile : nicProfiles) {
+                if(nicProfile.getTrafficType() == TrafficType.Public) {
+                    publicNicProfile = nicProfile;
+                    break;
+                }
+            }
+
+            if(publicNicProfile != null) {
+                NicTO[] nics = to.getNics();
+
+                // reserve extra NICs
+                NicTO[] expandedNics = new NicTO[nics.length + _vmwareMgr.getRouterExtraPublicNics()];
+                int i = 0;
+                int deviceId = -1;
+                for(i = 0; i < nics.length; i++) {
+                    expandedNics[i] = nics[i];
+                    if(nics[i].getDeviceId() > deviceId)
+                        deviceId = nics[i].getDeviceId();
+                }
+                deviceId++;
+
+                long networkId = publicNicProfile.getNetworkId();
+                NetworkVO network = _networkDao.findById(networkId);
+
+                for(; i < nics.length + _vmwareMgr.getRouterExtraPublicNics(); i++) {
+                    NicTO nicTo = new NicTO();
+
+                    nicTo.setDeviceId(deviceId++);
+                    nicTo.setBroadcastType(publicNicProfile.getBroadcastType());
+                    nicTo.setType(publicNicProfile.getTrafficType());
+                    nicTo.setIp("0.0.0.0");
+                    nicTo.setNetmask("255.255.255.255");
+
+                    try {
+                        String mac = _networkMgr.getNextAvailableMacAddressInNetwork(networkId);
+                        nicTo.setMac(mac);
+                    } catch (InsufficientAddressCapacityException e) {
+                        throw new CloudRuntimeException("unable to allocate mac address on
network: " + networkId);
+                    }
+                    nicTo.setDns1(publicNicProfile.getDns1());
+                    nicTo.setDns2(publicNicProfile.getDns2());
+                    if (publicNicProfile.getGateway() != null) {
+                        nicTo.setGateway(publicNicProfile.getGateway());
+                    } else {
+                        nicTo.setGateway(network.getGateway());
+                    }
+                    nicTo.setDefaultNic(false);
+                    nicTo.setBroadcastUri(publicNicProfile.getBroadCastUri());
+                    nicTo.setIsolationuri(publicNicProfile.getIsolationUri());
+
+                    Integer networkRate = _networkMgr.getNetworkRate(network.getId(), null);
+                    nicTo.setNetworkRateMbps(networkRate);
+
+                    expandedNics[i] = nicTo;
+                }
+
+                to.setNics(expandedNics);
+            }
+
+            StringBuffer sbMacSequence = new StringBuffer();
+            for(NicTO nicTo : sortNicsByDeviceId(to.getNics())) {
+                sbMacSequence.append(nicTo.getMac()).append("|");
+            }
+            sbMacSequence.deleteCharAt(sbMacSequence.length() - 1);
+            String bootArgs = to.getBootArgs();
+            to.setBootArgs(bootArgs + " nic_macs=" + sbMacSequence.toString());
         }
-    	to.setDetails(details);
-
-    	if(vm.getVirtualMachine() instanceof DomainRouterVO) {
-    		List<NicProfile> nicProfiles = vm.getNics();
-    		NicProfile publicNicProfile = null;
-    		
-    		for(NicProfile nicProfile : nicProfiles) {
-    			if(nicProfile.getTrafficType() == TrafficType.Public) {
-    				publicNicProfile = nicProfile;
-    				break;
-    			}
-    		}
-    		
-    		if(publicNicProfile != null) {
-	    		NicTO[] nics = to.getNics();
-
-	    		// reserve extra NICs
-	    		NicTO[] expandedNics = new NicTO[nics.length + _vmwareMgr.getRouterExtraPublicNics()];
-	    		int i = 0;
-	    		int deviceId = -1;
-	    		for(i = 0; i < nics.length; i++) {
-	    			expandedNics[i] = nics[i];
-	    			if(nics[i].getDeviceId() > deviceId)
-	    				deviceId = nics[i].getDeviceId();
-	    		}
-	    		deviceId++;
-	    		
-	    		long networkId = publicNicProfile.getNetworkId();
-	    		NetworkVO network = _networkDao.findById(networkId);
-	    		
-	    		for(; i < nics.length + _vmwareMgr.getRouterExtraPublicNics(); i++) {
-	    			NicTO nicTo = new NicTO();
-	    			
-	    			nicTo.setDeviceId(deviceId++);
-	    			nicTo.setBroadcastType(publicNicProfile.getBroadcastType());
-	    			nicTo.setType(publicNicProfile.getTrafficType());
-	    			nicTo.setIp("0.0.0.0");
-	    			nicTo.setNetmask("255.255.255.255");
-	    			
-	    			try {
-	    				String mac = _networkMgr.getNextAvailableMacAddressInNetwork(networkId);
-						nicTo.setMac(mac);
-					} catch (InsufficientAddressCapacityException e) {
-						throw new CloudRuntimeException("unable to allocate mac address on network: " + networkId);
-					}
-	    			nicTo.setDns1(publicNicProfile.getDns1());
-	    			nicTo.setDns2(publicNicProfile.getDns2());
-	    	        if (publicNicProfile.getGateway() != null) {
-	    	        	nicTo.setGateway(publicNicProfile.getGateway());
-	    	        } else {
-	    	        	nicTo.setGateway(network.getGateway());
-	    	        }
-	    	        nicTo.setDefaultNic(false);
-	    	        nicTo.setBroadcastUri(publicNicProfile.getBroadCastUri());
-	    	        nicTo.setIsolationuri(publicNicProfile.getIsolationUri());
-
-	    	        Integer networkRate = _networkMgr.getNetworkRate(network.getId(), null);
-	    	        nicTo.setNetworkRateMbps(networkRate);
-	    	        
-	    	        expandedNics[i] = nicTo;
-	    		}
-	    		
-	    		to.setNics(expandedNics);
-    		}
-    		
-    		StringBuffer sbMacSequence = new StringBuffer();
-        	for(NicTO nicTo : sortNicsByDeviceId(to.getNics())) {
-    			sbMacSequence.append(nicTo.getMac()).append("|");
-        	}
-    		sbMacSequence.deleteCharAt(sbMacSequence.length() - 1);
-    		String bootArgs = to.getBootArgs();
-    		to.setBootArgs(bootArgs + " nic_macs=" + sbMacSequence.toString());
-    	}
 
         // Determine the VM's OS description
         GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
         to.setOs(guestOS.getDisplayName());
         return to;
     }
-    
+
     private NicTO[] sortNicsByDeviceId(NicTO[] nics) {
 
         List<NicTO> listForSort = new ArrayList<NicTO>();
@@ -235,83 +232,86 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru
{
 
         return listForSort.toArray(new NicTO[0]);
     }
-    
+
     @Override @DB
     public long getCommandHostDelegation(long hostId, Command cmd) {
-    	boolean needDelegation = false;
-    	
-    	if(cmd instanceof PrimaryStorageDownloadCommand || 
-    		cmd instanceof BackupSnapshotCommand ||
-    		cmd instanceof CreatePrivateTemplateFromVolumeCommand ||
-    		cmd instanceof CreatePrivateTemplateFromSnapshotCommand ||
-    		cmd instanceof CopyVolumeCommand ||
-    		cmd instanceof CreateVolumeFromSnapshotCommand) {
-    		needDelegation = true;
-    	}
-
-    	if(needDelegation) {
-    		HostVO host = _hostDao.findById(hostId);
-    		assert(host != null);
-    		assert(host.getHypervisorType() == HypervisorType.VMware);
-    		long dcId = host.getDataCenterId();
-    		
-    		Pair<HostVO, SecondaryStorageVmVO> cmdTarget = _secStorageMgr.assignSecStorageVm(dcId,
cmd);
-    		if(cmdTarget != null) {
-    			// TODO, we need to make sure agent is actually connected too
-    			cmd.setContextParam("hypervisor", HypervisorType.VMware.toString());
-    		    Map<String, String> hostDetails = _hostDetailsDao.findDetails(hostId);
-    		    cmd.setContextParam("guid", resolveNameInGuid(hostDetails.get("guid")));
-    		    cmd.setContextParam("username", hostDetails.get("username"));
-    		    cmd.setContextParam("password", hostDetails.get("password"));
-    			cmd.setContextParam("serviceconsole", _vmwareMgr.getServiceConsolePortGroupName());
-    			cmd.setContextParam("manageportgroup", _vmwareMgr.getManagementPortGroupName());
-    			
-    			CommandExecLogVO execLog = new CommandExecLogVO(cmdTarget.first().getId(), cmdTarget.second().getId(),
cmd.getClass().getSimpleName(), 1);
-    			_cmdExecLogDao.persist(execLog);
-    			cmd.setContextParam("execid", String.valueOf(execLog.getId()));
-    			
-    			if(cmd instanceof BackupSnapshotCommand || 
-    				cmd instanceof CreatePrivateTemplateFromVolumeCommand || 
-    				cmd instanceof CreatePrivateTemplateFromSnapshotCommand ||
-    				cmd instanceof CopyVolumeCommand ||
-    				cmd instanceof CreateVolumeFromSnapshotCommand) {
-    				
-    				String workerName = _vmwareMgr.composeWorkerName();
-    				long checkPointId = _checkPointMgr.pushCheckPoint(new VmwareCleanupMaid(hostDetails.get("guid"),
workerName));
-    				cmd.setContextParam("worker", workerName);
-    				cmd.setContextParam("checkpoint", String.valueOf(checkPointId));
-
-    				// some commands use 2 workers
+        boolean needDelegation = false;
+
+        if(cmd instanceof PrimaryStorageDownloadCommand || 
+                cmd instanceof BackupSnapshotCommand ||
+                cmd instanceof CreatePrivateTemplateFromVolumeCommand ||
+                cmd instanceof CreatePrivateTemplateFromSnapshotCommand ||
+                cmd instanceof CopyVolumeCommand ||
+                cmd instanceof CreateVolumeFromSnapshotCommand) {
+            needDelegation = true;
+        }
+
+        if(needDelegation) {
+            HostVO host = _hostDao.findById(hostId);
+            assert(host != null);
+            assert(host.getHypervisorType() == HypervisorType.VMware);
+            long dcId = host.getDataCenterId();
+
+            Pair<HostVO, SecondaryStorageVmVO> cmdTarget = _secStorageMgr.assignSecStorageVm(dcId,
cmd);
+            if(cmdTarget != null) {
+                // TODO, we need to make sure agent is actually connected too
+                cmd.setContextParam("hypervisor", HypervisorType.VMware.toString());
+                Map<String, String> hostDetails = _hostDetailsDao.findDetails(hostId);
+                cmd.setContextParam("guid", resolveNameInGuid(hostDetails.get("guid")));
+                cmd.setContextParam("username", hostDetails.get("username"));
+                cmd.setContextParam("password", hostDetails.get("password"));
+                cmd.setContextParam("serviceconsole", _vmwareMgr.getServiceConsolePortGroupName());
+                cmd.setContextParam("manageportgroup", _vmwareMgr.getManagementPortGroupName());
+
+                CommandExecLogVO execLog = new CommandExecLogVO(cmdTarget.first().getId(),
cmdTarget.second().getId(), cmd.getClass().getSimpleName(), 1);
+                _cmdExecLogDao.persist(execLog);
+                cmd.setContextParam("execid", String.valueOf(execLog.getId()));
+
+                if(cmd instanceof BackupSnapshotCommand || 
+                        cmd instanceof CreatePrivateTemplateFromVolumeCommand || 
+                        cmd instanceof CreatePrivateTemplateFromSnapshotCommand ||
+                        cmd instanceof CopyVolumeCommand ||
+                        cmd instanceof CreateVolumeFromSnapshotCommand) {
+
+                    String workerName = _vmwareMgr.composeWorkerName();
+                    long checkPointId = 1;
+// FIXME: Fix                    long checkPointId = _checkPointMgr.pushCheckPoint(new VmwareCleanupMaid(hostDetails.get("guid"),
workerName));
+                    cmd.setContextParam("worker", workerName);
+                    cmd.setContextParam("checkpoint", String.valueOf(checkPointId));
+
+                    // some commands use 2 workers
                     String workerName2 = _vmwareMgr.composeWorkerName();
-                    long checkPointId2 = _checkPointMgr.pushCheckPoint(new VmwareCleanupMaid(hostDetails.get("guid"),
workerName2));
+                    long checkPointId2 = 1;
+// FIXME: Fix                    long checkPointId2 = _checkPointMgr.pushCheckPoint(new VmwareCleanupMaid(hostDetails.get("guid"),
workerName2));
                     cmd.setContextParam("worker2", workerName2);
                     cmd.setContextParam("checkpoint2", String.valueOf(checkPointId2));
-    			}
-    			
-    			return cmdTarget.first().getId();
-    		}
-    	}
-  
-    	return hostId;
+                }
+
+                return cmdTarget.first().getId();
+            }
+        }
+
+        return hostId;
     }
-    
+
+    @Override
     public boolean trackVmHostChange() {
-    	return true;
+        return true;
     }
-    
+
     private static String resolveNameInGuid(String guid) {
-    	String tokens[] = guid.split("@");
-    	assert(tokens.length == 2);
-
-    	String vCenterIp = NetUtils.resolveToIp(tokens[1]);
-    	if(vCenterIp == null) {
-    		s_logger.error("Fatal : unable to resolve vCenter address " + tokens[1] + ", please
check your DNS configuration");
-    		return guid;
-    	}
-    	
-    	if(vCenterIp.equals(tokens[1]))
-    		return guid;
-    	
-    	return tokens[0] + "@" + vCenterIp;
+        String tokens[] = guid.split("@");
+        assert(tokens.length == 2);
+
+        String vCenterIp = NetUtils.resolveToIp(tokens[1]);
+        if(vCenterIp == null) {
+            s_logger.error("Fatal : unable to resolve vCenter address " + tokens[1] + ",
please check your DNS configuration");
+            return guid;
+        }
+
+        if(vCenterIp.equals(tokens[1]))
+            return guid;
+
+        return tokens[0] + "@" + vCenterIp;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java
index a3e2fca..bae8857 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java
@@ -23,8 +23,6 @@ import java.util.Map;
 
 import org.apache.log4j.Logger;
 
-import com.cloud.cluster.CheckPointManager;
-import com.cloud.cluster.CleanupMaid;
 import com.cloud.hypervisor.vmware.manager.VmwareManager;
 import com.cloud.hypervisor.vmware.mo.ClusterMO;
 import com.cloud.hypervisor.vmware.mo.DatacenterMO;
@@ -32,7 +30,7 @@ import com.cloud.hypervisor.vmware.mo.HostMO;
 import com.cloud.hypervisor.vmware.mo.VirtualMachineMO;
 import com.cloud.hypervisor.vmware.util.VmwareContext;
 
-public class VmwareCleanupMaid implements CleanupMaid {
+public class VmwareCleanupMaid {
     private static final Logger s_logger = Logger.getLogger(VmwareCleanupMaid.class);
     
     private static Map<String, List<VmwareCleanupMaid>> s_leftoverDummyVMs =
new HashMap<String, List<VmwareCleanupMaid>>();
@@ -67,16 +65,15 @@ public class VmwareCleanupMaid implements CleanupMaid {
 		_vmName = vmName;
 	}
 	
-	@Override
-	public int cleanup(CheckPointManager checkPointMgr) {
-		
-		// save a check-point in case we crash at current run so that we won't lose it
-		_checkPoint = checkPointMgr.pushCheckPoint(new VmwareCleanupMaid(_vCenterAddress, _dcMorValue,
_vmName));
-		addLeftOverVM(this);
-		return 0;
-	}
+//	@Override
+//	public int cleanup(CheckPointManager checkPointMgr) {
+//		
+//		// save a check-point in case we crash at current run so that we won't lose it
+//		_checkPoint = checkPointMgr.pushCheckPoint(new VmwareCleanupMaid(_vCenterAddress, _dcMorValue,
_vmName));
+//		addLeftOverVM(this);
+//		return 0;
+//	}
 
-	@Override
 	public String getCleanupProcedure() {
 		return null;
 	}
@@ -137,7 +134,7 @@ public class VmwareCleanupMaid implements CleanupMaid {
                 } catch(Throwable e) {
                     s_logger.warn("Unable to destroy left over dummy VM " + cleanupMaid.getVmName());
                 } finally {
-                	mgr.popCleanupCheckpoint(cleanupMaid.getCheckPoint());
+// FIXME                	mgr.popCleanupCheckpoint(cleanupMaid.getCheckPoint());
                 }
             }
             

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6088cbfe/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java
index 7ec0657..ab10e5e 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java
@@ -19,8 +19,10 @@ package com.cloud.hypervisor.vmware.resource;
 import org.apache.log4j.Logger;
 
 import com.cloud.hypervisor.vmware.manager.VmwareManager;
+import com.cloud.hypervisor.vmware.manager.VmwareManagerImpl;
 import com.cloud.hypervisor.vmware.util.VmwareContext;
 import com.cloud.utils.StringUtils;
+import com.cloud.utils.component.ComponentContext;
 
 import com.vmware.apputils.version.ExtendedAppUtil;
 
@@ -34,9 +36,7 @@ public class VmwareContextFactory {
 	static {
 		// skip certificate check
 		System.setProperty("axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory");
-		
-		ComponentLocator locator = ComponentLocator.getLocator("management-server");
-		s_vmwareMgr = locator.getManager(VmwareManager.class);
+		s_vmwareMgr = ComponentContext.inject(VmwareManagerImpl.class);
 	}
 
 	public static VmwareContext create(String vCenterAddress, String vCenterUserName, String
vCenterPassword) throws Exception {


Mime
View raw message