cluster_id, status, resp) # set each host config in cluster. for host_id in host_ids: if ROLES_LIST: roles = ROLES_LIST.pop(0) else: roles = [] status, resp = client.update_host_config(host_id, hostname='%s%s' % (HOST_NAME_PREFIX, host_id), roles=roles) print 'set roles to host %s status: %s, resp: %s' % (host_id, status, resp) # deploy cluster. status, resp = client.deploy_hosts(cluster_id) print 'deploy cluster %s status: %s, resp: %s' % (cluster_id, status, resp) # get intalling progress. while True: status, resp = client.get_cluster_installing_progress(cluster_id) print 'get cluster %s installing progress status: %s, resp: %s' % ( cluster_id, status, resp) progress = resp['progress'] if (progress['state'] not in ['UNINITIALIZED', 'INSTALLING'] or progress['percentage'] >= 1.0): break for host_id in host_ids: status, resp = client.get_host_installing_progress(host_id) print 'get host %s installing progress status: %s, resp: %s' % (
# set each host config in cluster. ROLES_LIST = [PRESET_VALUES['ROLES_LIST'].split()] for host_id in host_ids: if ROLES_LIST: roles = ROLES_LIST.pop(0) else: roles = [] status, resp = client.update_host_config( host_id, hostname='%s%s' % (HOST_NAME_PREFIX, host_id), roles=roles) print 'set roles to host %s status: %s, resp: %s' % ( host_id, status, resp) # deploy cluster. status, resp = client.deploy_hosts(cluster_id) print 'deploy cluster %s status: %s, resp: %s' % (cluster_id, status, resp) # get intalling progress. BUILD_TIMEOUT = float(PRESET_VALUES['BUILD_TIMEOUT']) timeout = time.time() + BUILD_TIMEOUT * 60 while True: status, resp = client.get_cluster_installing_progress(cluster_id) print 'get cluster %s installing progress status: %s, resp: %s' % ( cluster_id, status, resp) progress = resp['progress'] if ( progress['state'] not in ['UNINITIALIZED', 'INSTALLING'] or progress['percentage'] >= 1.0 ):