Skip to content

Commit 9a8ddda

Browse files
author
Likitha Shetty
committed
Revert "CLOUDSTACK-3715. Socket timeout error is observed in VMware setup if a VMware task (RelocateVM_Task, CloneVM_Task etc.) takes more than 10 minutes. Making this value configurable to allow admins to modify the timeout if required. It defaults to the current value i.e. 10 minutes."
This reverts commit 0a10128.
1 parent ed76e8a commit 9a8ddda

7 files changed

Lines changed: 3 additions & 39 deletions

File tree

‎plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,5 @@ List<ManagedObjectReference> addHostToPodCluster(VmwareContext serviceContext, l
6969

7070
public String getRootDiskController();
7171

72-
public int getVcenterSessionTimeout();
73-
7472
boolean isLegacyZone(long dcId);
7573
}

‎plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
174174
int _additionalPortRangeStart;
175175
int _additionalPortRangeSize;
176176
int _routerExtraPublicNics = 2;
177-
int _vCenterSessionTimeout = 600000; // Timeout in milliseconds
178177

179178
String _reserveCpu = "false";
180179

@@ -277,9 +276,6 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
277276

278277
_routerExtraPublicNics = NumbersUtil.parseInt(_configDao.getValue(Config.RouterExtraPublicNics.key()), 2);
279278

280-
_vCenterSessionTimeout = NumbersUtil.parseInt(_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 600) * 1000;
281-
s_logger.info("VmwareManagerImpl config - vmware.vcenter.session.timeout: " + _vCenterSessionTimeout);
282-
283279
_reserveCpu = _configDao.getValue(Config.VmwareReserveCpu.key());
284280
if(_reserveCpu == null || _reserveCpu.isEmpty()) {
285281
_reserveCpu = "false";
@@ -984,11 +980,6 @@ public String getRootDiskController() {
984980
return _rootDiskController;
985981
}
986982

987-
@Override
988-
public int getVcenterSessionTimeout() {
989-
return _vCenterSessionTimeout;
990-
}
991-
992983
@Override
993984
public List<Class<?>> getCommands() {
994985
List<Class<?>> cmdList = new ArrayList<Class<?>>();

‎plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public static VmwareContext create(String vCenterAddress, String vCenterUserName
6363
s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));
6464

6565
VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
66-
vimClient.setVcenterSessionTimeout(s_vmwareMgr.getVcenterSessionTimeout());
6766
vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);
6867

6968
VmwareContext context = new VmwareContext(vimClient, vCenterAddress);

‎plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,32 @@
1616
// under the License.
1717
package com.cloud.storage.resource;
1818

19-
import javax.annotation.PostConstruct;
20-
import javax.inject.Inject;
21-
2219
import org.apache.log4j.Logger;
2320

24-
import com.cloud.configuration.Config;
25-
import com.cloud.configuration.dao.ConfigurationDao;
2621
import com.cloud.hypervisor.vmware.util.VmwareClient;
2722
import com.cloud.hypervisor.vmware.util.VmwareContext;
2823
import com.cloud.hypervisor.vmware.util.VmwareContextPool;
29-
import com.cloud.utils.NumbersUtil;
3024

3125
public class VmwareSecondaryStorageContextFactory {
3226
private static final Logger s_logger = Logger.getLogger(VmwareSecondaryStorageContextFactory.class);
3327

3428
private static volatile int s_seq = 1;
3529

3630
private static VmwareContextPool s_pool;
37-
private static ConfigurationDao s_configDao;
38-
39-
@Inject ConfigurationDao _configDao;
4031

4132
public static void initFactoryEnvironment() {
4233
System.setProperty("axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory");
4334
s_pool = new VmwareContextPool();
4435
}
4536

46-
@PostConstruct
47-
void init() {
48-
s_configDao = _configDao;
49-
}
50-
5137
public static VmwareContext create(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception {
5238
assert(vCenterAddress != null);
5339
assert(vCenterUserName != null);
5440
assert(vCenterPassword != null);
5541

5642
String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
57-
int vCenterSessionTimeout = NumbersUtil.parseInt(s_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 600) * 1000;
5843
VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
59-
vimClient.setVcenterSessionTimeout(vCenterSessionTimeout);
60-
vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);
44+
vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);
6145
VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
6246
assert(context != null);
6347

‎server/src/com/cloud/configuration/Config.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ public enum Config {
306306
VmwareRecycleHungWorker("Advanced", ManagementServer.class, Boolean.class, "vmware.recycle.hung.wokervm", "false", "Specify whether or not to recycle hung worker VMs", null),
307307
VmwareHungWorkerTimeout("Advanced", ManagementServer.class, Long.class, "vmware.hung.wokervm.timeout", "7200", "Worker VM timeout in seconds", null),
308308
VmwareEnableNestedVirtualization("Advanced", ManagementServer.class, Boolean.class, "vmware.nested.virtualization", "false", "When set to true this will enable nested virtualization when this is supported by the hypervisor", null),
309-
VmwareVcenterSessionTimeout("Advanced", ManagementServer.class, Long.class, "vmware.vcenter.session.timeout", "600", "VMware client timeout in seconds", null),
310309

311310
// Midonet
312311
MidoNetAPIServerAddress("Network", ManagementServer.class, String.class, "midonet.apiserver.address", "http://localhost:8081", "Specify the address at which the Midonet API server can be contacted (if using Midonet)", null),

‎vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ private static void trustAllHttpsCertificates() throws Exception {
111111
private VimPortType vimPort;
112112
private String serviceCookie;
113113
private final String SVC_INST_NAME = "ServiceInstance";
114-
private int vCenterSessionTimeout = 600000; // Timeout in milliseconds
115114

116115
private boolean isConnected = false;
117116

@@ -135,8 +134,8 @@ public void connect(String url, String userName, String password) throws Excepti
135134
ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
136135
ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
137136

138-
ctxt.put("com.sun.xml.internal.ws.request.timeout", vCenterSessionTimeout);
139-
ctxt.put("com.sun.xml.internal.ws.connect.timeout", vCenterSessionTimeout);
137+
ctxt.put("com.sun.xml.internal.ws.request.timeout", 600000);
138+
ctxt.put("com.sun.xml.internal.ws.connect.timeout", 600000);
140139

141140
ServiceContent serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF);
142141

@@ -700,9 +699,4 @@ public ManagedObjectReference getMoRefProp(ManagedObjectReference objMor, String
700699
}
701700
return propmor;
702701
}
703-
704-
public void setVcenterSessionTimeout(int vCenterSessionTimeout) {
705-
this.vCenterSessionTimeout = vCenterSessionTimeout;
706-
}
707-
708702
}

‎vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public static VmwareContext create(String vCenterAddress, String vCenterUserName
4848
s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));
4949

5050
VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
51-
vimClient.setVcenterSessionTimeout(600000); // Timeout in milliseconds
5251
vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);
5352

5453
VmwareContext context = new VmwareContext(vimClient, vCenterAddress);

0 commit comments

Comments
 (0)