Skip to content

Sample JSONs for a Six Node Contrail HA and OpenStack HA Cluster

Nitish Krishna edited this page May 17, 2017 · 8 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": {
                    "ha": {
                        "contrail_internal_vip": "192.168.1.24",
                        "contrail_external_vip": "192.168.1.24"
                    }
                },
                "openstack":{
                    "openstack_manage_amqp": true,
                    "ha": {
                        "internal_vip": "192.168.10.100",
                        "external_vip": "192.168.1.100",
                        "internal_virtual_router_id": 102,
                        "external_virtual_router_id": 101
                    }
                }
            }
        }
    }
]
}

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"
        }
    ]
}

Consolidated Contrail Debian Image/Containers 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": "server1",
        "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",
                 "openstack"
                 ]
    },
    {
        "cluster_id": "cluster1",
        "domain": "sm-domain.com",
        "id": "server2",
        "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": [
                 "contrail-controller",
                 "contrail-analytics",
                 "contrail-analyticsdb",
                 "openstack"
                 ]
    },
    {
        "cluster_id": "cluster1",
        "domain": "sm-domain.com",
        "id": "server3",
        "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:23",
                    "ip_address": "192.168.1.23/24",
                    "default_gateway": "192.168.1.1"
                },
                {
                    "name": "eth2",
                    "mac_address": "52:54:00:00:10:23",
                    "ip_address": "192.168.10.23/24",
                    "default_gateway": "192.168.10.1"
                }
            ],
            "management_interface": "eth1",
            "provisioning": "kickstart"
        },
        "password": "c0ntrail123",
        "ipmi_address": "",
        "roles": [
                 "contrail-controller",
                 "contrail-analytics",
                 "contrail-analyticsdb",
                 "openstack"
                 ]
    },
    {
        "cluster_id": "cluster1",
        "domain": "sm-domain.com",
        "id": "server4",
        "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:24",
                    "ip_address": "192.168.1.24/24",
                    "default_gateway": "192.168.1.1"
                },
                {
                    "name": "eth2",
                    "mac_address": "52:54:00:00:10:24",
                    "ip_address": "192.168.10.24/24",
                    "default_gateway": "192.168.10.1"
                }
            ],
            "management_interface": "eth1",
            "provisioning": "kickstart"
        },
        "password": "c0ntrail123",
        "ipmi_address": "",
        "roles": [
                 "contrail-lb"
                 ]
    },
    {
        "cluster_id": "cluster1",
        "domain": "sm-domain.com",
        "id": "server5",
        "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:25",
                    "ip_address": "192.168.1.25/24",
                    "default_gateway": "192.168.1.1"
                },
                {
                    "name": "eth2",
                    "mac_address": "52:54:00:00:10:25",
                    "ip_address": "192.168.10.25/24",
                    "default_gateway": "192.168.10.1"
                }
            ],
            "management_interface": "eth1",
            "provisioning": "kickstart"
        },
        "password": "c0ntrail123",
        "ipmi_address": "",
        "roles": [
                 "contrail-compute" ]
    },
    {
        "cluster_id": "cluster1",
        "domain": "sm-domain.com",
        "id": "server6",
        "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:26",
                    "ip_address": "192.168.1.26/24",
                    "default_gateway": "192.168.1.1"
                },
                {
                    "name": "eth2",
                    "mac_address": "52:54:00:00:10:26",
                    "ip_address": "192.168.10.26/24",
                    "default_gateway": "192.168.10.1"
                }
            ],
            "management_interface": "eth1",
            "provisioning": "kickstart"
        },
        "password": "c0ntrail123",
        "ipmi_address": "",
        "roles": [
                 "contrail-compute" ]
    }
]
}
Clone this wiki locally