Reply
New Contributor
Posts: 5
Registered: ‎08-10-2017

cm_api apply_host_template command not working properly

Hi,

We have cm_api scripts that create a multi-node CDH cluster, which are working fine.

we've written a script that adds new hosts to cluster, inspect host and then apply host template.

 

CMD_WAIT=30
try:
template.apply_host_template(host_ids=list(HOST),start_roles=True).wait(CMD_WAIT)
except Exception,err:
logger('warn',"Template issue, unable to apply Host template");
logger('error',err);
print(err);

 

Template format :

{
    "clusterRef": {
        "clusterName": "CLUSTERNAME"
    },
    "name": "DataNode_CLUSTERNAME",
    "roleConfigGroupRefs": [
        {
            "roleConfigGroupName": "hbase-GATEWAY-BASE"
        },
        {
            "roleConfigGroupName": "hdfs-DATANODE"
        },
        {
            "roleConfigGroupName": "hdfs-GATEWAY-1"
        },
        {
            "roleConfigGroupName": "hive-GATEWAY-BASE"
        },
        {
            "roleConfigGroupName": "impala-IMPALAD"
        },
        {
            "roleConfigGroupName": "spark_on_yarn-GATEWAY-BASE"
        },
        {
            "roleConfigGroupName": "yarn-GATEWAY-1"
        },
        {
            "roleConfigGroupName": "yarn-NODEMANAGER"
        }
    ]
}

Commands for adding Host, inspect  and apply host template working fine, but after execution roles are not assigned to host.

 

add_node.PNG

add_node_1.PNG

 No Role is visible here. Kindly suggest

 

Announcements