@@ -65,9 +65,9 @@ def handleArguments(argv):
6565 '\n --clustername -n <clustername> \t \t Name of the cluster to work with' + \
6666 '\n --ignore-hosts <list>\t \t \t \t Skip work on the specified hosts (for example if you need to resume): ' \
6767 'Example: --ignore-hosts="host1, host2" ' + \
68- '\n --threads <nr>\t \t \t \t Use this number or concurrent migration threads" ' + \
68+ '\n --threads <nr>\t \t \t \t Use this number or concurrent migration threads ' + \
6969 '\n --halt\t \t \t \t \t Instead of the default reboot, halt the hypervisor (useful in case of hardware ' \
70- 'upgrades)" ' + \
70+ 'upgrades) ' + \
7171 '\n --debug\t \t \t \t \t Enable debug mode' + \
7272 '\n --exec\t \t \t \t \t Execute for real' + \
7373 '\n --prepare\t \t \t \t \t Execute some prepare commands'
@@ -268,6 +268,20 @@ def handleArguments(argv):
268268checkBonds = True
269269c .printHypervisors (clusterID , poolmaster .name , checkBonds )
270270
271+ # Set to manage in CloudStack
272+ print "Note: Setting cluster " + clustername + " back to Managed in CloudStack"
273+ clusterUpdateReturn = c .updateCluster (
274+ {'clusterid' : clusterID , 'managedstate' : 'Managed' })
275+
276+ if clusterUpdateReturn == 1 or clusterUpdateReturn is None :
277+ print "Error: Managing cluster " + clustername + " failed. Please check manually."
278+ disconnect_all ()
279+ sys .exit (1 )
280+
281+ # Print cluster info
282+ print "Note: Some info about cluster '" + clustername + "':"
283+ c .printCluster (clusterID )
284+
271285# Then the other hypervisors, one-by-one
272286for h in cluster_hosts :
273287 if h .name in ignoreHosts :
@@ -310,15 +324,6 @@ def handleArguments(argv):
310324 sys .ext (1 )
311325print "Note: The state of HA on cluster " + clustername + " is " + str (pool_ha )
312326
313- # Set to manage in CloudStack
314- clusterUpdateReturn = c .updateCluster (
315- {'clusterid' : clusterID , 'managedstate' : 'Managed' })
316-
317- if clusterUpdateReturn == 1 or clusterUpdateReturn is None :
318- print "Error: Managing cluster " + clustername + " failed. Please check manually."
319- disconnect_all ()
320- sys .exit (1 )
321-
322327# Print cluster info
323328print "Note: Some info about cluster '" + clustername + "':"
324329c .printCluster (clusterID )
0 commit comments