You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2013/09/04 01:11:38 UTC
[09/12] git commit: updated refs/heads/4.2 to f09afea
CLOUDSTACK-4499: Wait until hosts are up before adding storage pools
This works around the delay caused in adding Xen 6.1/6.2 hosts where
host takes two attempts to transition to Up state. We will wait for one
minute per cluster before attempting to add storage pool in the cluster.
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
(cherry picked from commit 22ee499c3571b2a6b6921abb36c679128893c415)
(cherry picked from commit dc071e963e3df9e504f951a28117f567558bb496)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/204f85b0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/204f85b0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/204f85b0
Branch: refs/heads/4.2
Commit: 204f85b0515b9e053c488008e46e430cd9bcac53
Parents: fc77090
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Aug 29 12:33:26 2013 +0530
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:00:37 2013 -0700
----------------------------------------------------------------------
tools/marvin/marvin/deployDataCenter.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/204f85b0/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 5352029..4c34a50 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -22,6 +22,7 @@ import cloudstackTestClient
import logging
from cloudstackAPI import *
from os import path
+from time import sleep
from optparse import OptionParser
@@ -87,9 +88,28 @@ specify a valid config file" % cfgFile)
if cluster.hypervisor.lower() != "vmware":
self.addHosts(cluster.hosts, zoneId, podId, clusterId,
cluster.hypervisor)
+ self.wait_for_host(zoneId, clusterId)
self.createPrimaryStorages(cluster.primaryStorages, zoneId, podId,
clusterId)
+ def wait_for_host(self, zoneId, clusterId):
+ """
+ Wait for the hosts in the zoneid, clusterid to be up
+
+ 2 retries with 30s delay
+ """
+ retry, timeout = 2, 30
+ cmd = listHosts.listHostsCmd()
+ cmd.clusterid, cmd.zoneid = clusterId, zoneId
+ hosts = self.apiClient.listHosts(cmd)
+ while retry != 0:
+ for host in hosts:
+ if host.state != 'Up':
+ break
+ sleep(timeout)
+ retry = retry - 1
+
+
def createPrimaryStorages(self, primaryStorages, zoneId, podId, clusterId):
if primaryStorages is None:
return