Skip to content

Adapting the server cluster JSON files used to provision Contrail Docker Containers to support new configuration for various modules

Ramprakash Ram Mohan edited this page Jan 25, 2017 · 1 revision

Some sample JSON files used in Server Manager to provision Contrail Docker Containers is given here.

A comprehensive list of options that can be used in the JSON files for each corresponding container can be found here.

For the sake of illustration consider the snippet below taken from the controller.conf file from the link above:

[CONTROL]
asn = 64512
external_routers =

#BGP port number
bgp_port=179

#Introspect port for debugging
introspect_port = 8083

#xmpp server port
xmpp_server_port=5269

#Log file and log level
log_file=/var/log/contrail/contrail-control.log
log_level=SYS_NOTICE

# Sandesh send rate limit can be used to throttle system logs transmitted per
# second. System logs are dropped if the sending rate is exceeded
sandesh_send_rate_limit=100

The corresponding cluster JSON snippet for the controller.conf file is shown below:

{
"cluster": [
    {
        "id": "contrail_cluster",
        "parameters": {
            "provision": {
                "containers": {
                    "control": {                   
                        "CONTROL" : {
                            "asn" : "6245",
                            "external_routers" : "[]",
                            "bgp_port" : "179"
                            "introspect_port" : "8083"
                            "xmpp_server_port" : "5269"
                            "log_file" : "/var/log/contrail/contrail-control.log"
                            "log_level" : "SYS_NOTICE"
                            "sandesh_send_rate_limit": "100"
                        },
                    },
                },
            },
        },
    },
}

Now, assume that for a new feature the config file adds 1 new config parameter named new_param_1 and a whole new section in the config file called NEW_CONFIG that contains one other new parameter named new_param_2. So the config file will now look like below:

    [CONTROL]
    asn = 64512
    external_routers =
    
    #BGP port number
    bgp_port=179
    
    #Introspect port for debugging
    introspect_port = 8083
    
    #xmpp server port
    xmpp_server_port=5269
    
    #Log file and log level
    log_file=/var/log/contrail/contrail-control.log
    log_level=SYS_NOTICE
    
    # Sandesh send rate limit can be used to throttle system logs transmitted per
    # second. System logs are dropped if the sending rate is exceeded
    sandesh_send_rate_limit=100

    # new param 1
    "new_param_1" : "new_value_1"

    [NEW_CONFIG]
    "new_param_2" : "new_value_2"

In this case, the corresponding cluster JSON file will have the following contents:

{
    "cluster": [
        {
            "id": "contrail_cluster",
            "parameters": {
                "provision": {
                    "containers": {
                        "control": {                   `
                            "CONTROL" : {
                                "asn" : "6245",
                                "external_routers" : "[]",
                                "bgp_port" : "179",
                                "introspect_port" : "8083",
                                "xmpp_server_port" : "5269",
                                "log_file" : "/var/log/contrail/contrail-control.log"
                                "log_level" : "SYS_NOTICE",
                                "sandesh_send_rate_limit100",
                                "new_param_1" : "new_value_1"
                            },
                            "NEW_CONFIG" : {
                                "new_param_2" : "new_value_2"
                            }
                        },
                    },
                },
            }.
        }.
    }
Clone this wiki locally