Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Deploying Contrail Multicloud using REST API

 

This section explains how to deploy Contrail Multicloud using REST API.

Prerequisites and Assumptions

The following are the assumptions for Contrail Multicloud deployment:

Objective and Workflow

The deployment consists of the following steps:

  1. Create an entire public cloud infrastructure that includes Virtual Private Cloud (VPC)/virtual network, virtual machines, routes, and so on.

  2. Deploy multicloud gateway roles for both on-premise site and public cloud sites.

  3. Deploy Contrail and Kubernetes components needed on the public cloud site.

  4. Establish connectivity between on-premise site and public cloud.

Deploying the Public Cloud Infrastructure

When deploying the following example deploy_public_cloud_infra.yml file, multiple resources for Amazon Web Services (AWS) infrastructure are created. Summarized are important resources created using this yaml file.

  • One VPC (192.168.100.0/24)

  • One private subnet (192.168.100.128/25).

  • Two security group rules.

  • Two Elastic Compute Cloud (EC2) instances (gateway and compute)

Verify that the correct access key and secret key are entered in the cloud_user object.

Example: deploy_public_cloud_infra.yml

Creating Contrail Roles Specific to Public Cloud Instances

Use these guidelines in the create_contrail_roles_for_cloud_objects.yml file in this procedure:

  • a5063dde-2681-11e9-8021-0050568a3bf0 is the contrail_cluster UUID. Also a50635c8-2681-11e9-8021-0050568a3bf0 is the kubernetes_cluster UUID. It is assumed that both UUIDs are already created.

  • node_refs is the UUID of the nodes that were created in the previous topic “Deploy Public Cloud Infrastructure.”

  • parent_uuid is the UUID of the kubernetes_cluster for the kubernetes_node role object.

  • For contrail_multicloud_gw_node and contrail_vrouter_node role, object parent_uuid is the contrail_cluster objects UUID.

To create Contrail roles specific to public cloud instances, perform the following steps:

  1. Enter these requests to locate the Contrail and Kubernetes cluster UUIDs.
  2. Use the following request payload to create the contrail roles for cloud objects.

    Example: create_contrail_roles_for_cloud_objects.yml

  3. Update the provisioning_state of cloud object to NOSTATE to trigger the deployment of the public cloud.



    Wait for the cloud deployment logs in /var/log/contrail/cloud.log to complete before proceeding to the next steps. When completed, the provisioning_state of the cloud resource change from NOSTATE to either UPDATED or UPDATE_FAILED.

Creating On-Premise Cloud Objects

In the following create_onprem_pvt_port.yml file, node objects were already created. You are updating the cloud_private_subnet and tag_refs. Per the requirement, you need to have multicloud gateway and other roles on the on-premise cluster (Contrail controller, Kubernetes nodes, OpenStack nodes) on two different networks connected through a TOR. Hence, in the following yaml file there are two private subnets created. Be careful when adding the cloud_private_subnet_refs to the nodes.

To create on-premise cloud objects:

  1. Create the private port.

    If the private interface is not already created for the on-premise cluster nodes by using the UI, create them here. In the following example file, you are using the UUID of each on-premise cluster node resource.

    Example: create_onprem_pvt_port.yml

  2. Update the on-premise credential with the public cloud keypair reference.
    1. Use the UUID of the already created credential resource. List the credentials using the following requests to obtain the UUID.

    2. In keypair_refs use the UUID of the keypair created as part of deploying public cloud in the previous topic “Deploy Public Cloud Infrastructure.”

      Example: update_onprem_keypair.yml

  3. Create the on-premise cloud_user with the credential_refs pointing to the on-premise credential UUID, that was updated in Step 3.

    Example: create_onprem_clouduser.yml

  4. Create the on-premise cloud objects.

    Cloud object refers to cloud_user created in Step 4 and the virtual_cloud reference tag created in Step 2.

    Example: create_onprem_cloud_objects.yml

  5. Create the on-premise gateway node.
    • tag_refs, credential_refs, and cloud_private_subnet_refs are the UUID of the respective resources created or updated in Step 2, Step 3, and Step 5 respectively.

    • cloud_private_subnet_refs is specifically from the cloud_private_subnet created for the on-premise gateway.

    Example: create_onprem_mcgw_node.yml

  6. Create the on-premise contrail_multicloud_gateway_node role and update parent_uuid with contrail_cluster UUID.

    Use the following request to get the contrail_cluster UUID:

    Update node_refs UUID with the gateway node created earlier in this step.

    Example: create_onprem_mcgw_node_role.yml

  7. Update the on-premise compute and controller node.

    Link the on-premise cluster nodes (compute/controller) to the virtual_cloud created for the on-premise cluster using tag. Use the UUID of the node object created using the UI as part of the Contrail cluster deployment.

    Use the following request to get the node UUID:

    tag_refs, and cloud_private_subnet_refs are the UUID of the respective resources created or updated in Step 2 and Step 5.

    Example: update_onprem_nodes.yml

  8. Update the on-premise cloud state with NOSTATE to trigger deployment of the on-premise cloud. Use the onprem_cloud objects UUID created in Step 5.



    Wait for the cloud deployment logs in /var/log/contrail/cloud.log to complete before proceeding to the next steps. When completed, the provisioning_state of the cloud resource changes from NOSTATE to either UPDATED or UPDATE_FAILED.

Extending On-Premise Contrail Cluster to Public Cloud

To extend the on-premise Contrail cluster to the public cloud:

  1. Use the following request to get the cloud UUIDs.
  2. Use the following request to get the UUID of the contrail_cluster.
  3. Run the following request payload to extend the on-premise Contrail cluster to the public cloud.

    Example: extend_onprem_to_coud.yml

    With this request, you trigger the Contrail multicloud Ansible playbooks to start deploying Contrail roles on the public cloud, which includes the Contrail multicloud gateway role.



    Wait for the cloud deployment logs in /var/log/contrail/cloud.log to complete before proceeding to the next steps. When completed, the provisioning_state of the cloud resource changes from NOSTATE to either UPDATED or UPDATE_FAILED.