cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 09802e0
Date Mon, 13 Mar 2017 16:44:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 56e851ca4 -> 09802e0f3


CLOUDSTACK-9698 Make the wait timeout for NIC adapter hotplug as configurable

Currently ACS waits for 15 seconds (hard coded) for hot-plugged NIC in VR to get detected
by guest OS.
The time taken to detect hot plugged NIC in guest OS depends on type of NIC adapter like (E1000,
VMXNET3, E1000e etc.)
and guest OS itself. In uncommon scenarios the NIC detection may take longer time than 15
seconds,
in such cases NIC hotplug would be treated as failure which results in VPC tier configuration
failure.
Alternatively making the wait timeout for NIC adapter hotplug as configurable will be helpful
for admins in such scenarios.

Also in future if VMware introduces new NIC adapter types which may take time to get detected
by guest OS, it is good to have flexibility of
configuring the wait timeout as fallback mechanism in such scenarios.

Signed-off-by: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>


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

Branch: refs/heads/master
Commit: d171bb78570416f9a54263805c59422e7be5a195
Parents: 61ce75e
Author: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
Authored: Fri Dec 23 06:21:04 2016 +0530
Committer: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
Committed: Thu Mar 2 03:04:53 2017 +0530

----------------------------------------------------------------------
 .../hypervisor/vmware/manager/VmwareManager.java   |  5 +++++
 .../vmware/manager/VmwareManagerImpl.java          | 17 ++++++++++++++---
 .../hypervisor/vmware/resource/VmwareResource.java |  3 ++-
 3 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d171bb78/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
index 6559050..8a3b201 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
@@ -22,6 +22,8 @@ import java.util.Map;
 
 import com.vmware.vim25.ManagedObjectReference;
 
+import org.apache.cloudstack.framework.config.ConfigKey;
+
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.hypervisor.vmware.mo.HostMO;
 import com.cloud.hypervisor.vmware.util.VmwareContext;
@@ -30,6 +32,9 @@ import com.cloud.utils.Pair;
 public interface VmwareManager {
     public final String CONTEXT_STOCK_NAME = "vmwareMgr";
 
+    public static final ConfigKey<Long> s_vmwareNicHotplugWaitTimeout = new ConfigKey<Long>("Advanced",
Long.class, "vmware.nic.hotplug.wait.timeout", "15000",
+        "Wait timeout (milli seconds) for hot plugged NIC of VM to be detected by guest OS.",
false, ConfigKey.Scope.Global);
+
     String composeWorkerName();
 
     String getSystemVMIsoFileNameOnDatastore();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d171bb78/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index da83283..8688235 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -45,6 +45,8 @@ import org.apache.cloudstack.api.command.admin.zone.ListVmwareDcsCmd;
 import org.apache.cloudstack.api.command.admin.zone.RemoveVmwareDcCmd;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
 
@@ -123,12 +125,11 @@ import com.cloud.utils.script.Script;
 import com.cloud.utils.ssh.SshHelper;
 import com.cloud.vm.DomainRouterVO;
 
-public class VmwareManagerImpl extends ManagerBase implements VmwareManager, VmwareStorageMount,
Listener, VmwareDatacenterService {
+public class VmwareManagerImpl extends ManagerBase implements VmwareManager, VmwareStorageMount,
Listener, VmwareDatacenterService, Configurable {
     private static final Logger s_logger = Logger.getLogger(VmwareManagerImpl.class);
 
     private static final int STARTUP_DELAY = 60000;                 // 60 seconds
     private static final long DEFAULT_HOST_SCAN_INTERVAL = 600000;     // every 10 minutes
-
     private long _hostScanInterval = DEFAULT_HOST_SCAN_INTERVAL;
     private int _timeout;
 
@@ -189,7 +190,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager,
Vmw
 
     private String _rootDiskController = DiskControllerType.ide.toString();
 
-    private String _dataDiskController = DiskControllerType.osdefault.toString();
+    private final String _dataDiskController = DiskControllerType.osdefault.toString();
 
     private final Map<String, String> _storageMounts = new HashMap<String, String>();
 
@@ -205,6 +206,16 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager,
Vmw
     }
 
     @Override
+    public String getConfigComponentName() {
+        return VmwareManagerImpl.class.getSimpleName();
+    }
+
+    @Override
+    public ConfigKey<?>[] getConfigKeys() {
+        return new ConfigKey<?>[] {s_vmwareNicHotplugWaitTimeout};
+    }
+
+    @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
         s_logger.info("Configure VmwareManagerImpl, manager name: " + name);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d171bb78/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index d4e432d..df275aa 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -867,7 +867,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         // when we dynamically plug in a new NIC into virtual router, it may take time to
show up in guest OS
         // we use a waiting loop here as a workaround to synchronize activities in systems
         long startTick = System.currentTimeMillis();
-        while (System.currentTimeMillis() - startTick < 15000) {
+        long waitTimeoutMillis = VmwareManager.s_vmwareNicHotplugWaitTimeout.value();
+        while (System.currentTimeMillis() - startTick < waitTimeoutMillis) {
 
             // TODO : this is a temporary very inefficient solution, will refactor it later
             Pair<Boolean, String> result = SshHelper.sshExecute(routerIp, DefaultDomRSshPort,
"root", mgr.getSystemVMKeyFile(), null, "ls /proc/sys/net/ipv4/conf");


Mime
View raw message