Skip to content

Sample JSONs for a Multi (Two) Node Cluster

Nitish Krishna edited this page Sep 21, 2017 · 12 revisions

The JSON schema for provisioning containers for contrail 4.0 has been revamped. The contents under the "contrail_4" section follows the JSON representation of the contrail-ansible inventory here

Key-value pairs under the "contrail_4" section are passed directly to the contrail-ansible playbook used to provision the containers and compute. Most of the required parameters that were given explicitly in prior builds are now derived automatically from the existing legacy JSON definitions. Use the "contrail_4" section to override the calculated values if required.

Server level key-value pairs can also be specified by setting them under the "contrail_4" section in the server JSON.

For a comprehensive list of options available under the "contrail_4" section, refer new-cluster-contrail-4.x.json

For a comprehensive list of options available for server JSON, to add TOR switch config, IPMI config, Static Routes, etc please refer to new-server-contrail-4.x.json

The compute node can be a container or a bare-metal compute based on the value of the role - "contrail-compute" for bare-metal and "contrail-agent" for container. For 4.0, the default recommended and supported mode for the agent is as a bare-metal mode for 14.04 and as a container for ubuntu 16.04.

Contrail Cluster JSON

{
"cluster" : [
    {  
        "id": "cluster1",
        "parameters" : {
            "domain": "sm-domain.com",
            "subnet_mask": "255.255.255.0",
            "gateway": "192.168.1.1",
            "provision": {
                "contrail_4": {
                },
                "contrail": {
                },
                "openstack":{
                    "openstack_manage_amqp": true
                }
            }
        }
    }
]
}

Ubuntu 14.04 Image JSON

{
    "image": [
        {
            "category": "image",
            "id": "ubuntu-14.04.04",
            "parameters": {
                "kickseed": "/etc/contrail_smgr/kickstarts/contrail-ubuntu_trusty.seed",
                "kickstart": "/etc/contrail_smgr/kickstarts/contrail-ubuntu_trusty.ks"
            },
            "path": "/path/to/ubuntu-image.iso",
            "type": "ubuntu",
            "version": "14.04.04"
        }
    ]
}

Contrail-Cloud-Docker TGZ Image JSON

{
"image": [
    {   
        "category": "package",
        "id": "contrail_4_0_0_3053",
        "path": "/sm-shared-folder/bin/contrail-cloud-docker_4.0.0.0-3053-mitaka.tgz",
        "type": "contrail-ubuntu-package",
        "version": "4.0.0-3053"                     
    }
]
}

Server JSONs

{
"server": [
    {
        "cluster_id": "cluster1",
        "domain": "sm-domain.com",
        "id": "<Hostname of contrail-container server>",
        "parameters" : {
            "partition": "/dev/vda",
            "provision": {
                "contrail": {
                    "compute": {
                        "dpdk": {
                            "core_mask": "",
                            "huge_pages": ""
                        }
                    }
                }
            }
        },
        "contrail": {
            "control_data_interface": "eth2"
        },
        "network" : {
            "interfaces": [
                {
                    "name": "eth1",
                    "dhcp": false,
                    "mac_address": "52:54:00:00:01:21",
                    "ip_address": "192.168.1.21/24",
                    "default_gateway": "192.168.1.1"
                },
                {
                    "name": "eth2",
                    "mac_address": "52:54:00:00:10:21",
                    "ip_address": "192.168.10.21/24",
                    "default_gateway": "192.168.10.1"
                }
            ],
            "management_interface": "eth1",
            "provisioning": "kickstart"
        },
        "password": "c0ntrail123",
        "ipmi_address": "",
        "roles": [
                 "contrail-controller",
                 "contrail-analytics",
                 "contrail-analyticsdb",
                 "contrail-compute" ]
    },
    {
        "cluster_id": "cluster1",
        "domain": "sm-domain.com",
        "id": "<Hostname of openstack server>",
        "parameters" : {
            "partition": "/dev/vda",
            "provision": {
                "contrail": {
                    "compute": {
                        "dpdk": {
                            "core_mask": "",
                            "huge_pages": ""
                        }
                    }
                }
            }
        },
        "contrail": {
            "control_data_interface": "eth2"
        },
        "network" : {
            "interfaces": [
                {
                    "name": "eth1",
                    "dhcp": false,
                    "mac_address": "52:54:00:00:01:22",
                    "ip_address": "192.168.1.22/24",
                    "default_gateway": "192.168.1.1"
                },
                {
                    "name": "eth2",
                    "mac_address": "52:54:00:00:10:22",
                    "ip_address": "192.168.10.22/24",
                    "default_gateway": "192.168.10.1"
                }
            ],
            "management_interface": "eth1",
            "provisioning": "kickstart"
        },
        "password": "c0ntrail123",
        "ipmi_address": "",
        "roles": [
                 "openstack"
                 ]
    }
]
}
Clone this wiki locally