Skip to content

Latest commit

 

History

History
84 lines (58 loc) · 4.73 KB

TERRAFORM.md

File metadata and controls

84 lines (58 loc) · 4.73 KB

Deploying Nuage Networks Components using Terraform and MetroAE

Nuage Network components can be deployed using Terraform by allowing the tool to perform the predeploy role while utilizing MetroAE for deploy and postdeploy roles. The predeploy role performs the steps to define and spin up VM resources. The deploy role installs, configures and activates the Nuage Network software on the VM resources. The postdeploy role provides health checking to ensure that the software is indeed running properly.

Steps for Deploying using Terraform and MetroAE

1. Install Terraform and MetroAE
2. Customize MetroAE Deployment
3. Create Terraform Configuration
4. Add Terraform Provisioners and Dependencies
5. Apply Using Terraform

1. Install Terraform and MetroAE

Both Terraform and MetroAE are required to be installed using standard installation procedures. Terraform can be installed via the installation tutorial. MetroAE is installed via the setup guide.

2. Customize MetroAE Deployment

A set of MetroAE deployment files is required to provide configuration for MetroAE to perform the deploy steps. These should be written as if MetroAE were to be performing all of the roles of the deployment using the steps described in the customize deployment guide.

3. Create Terraform Configuration

The Terraform configuration files are required to describe the required providers and resource definitions to allocate compute nodes for components. These can be written according to the build infrastructure guide.

Note that Terraform will need to perform all of the steps that MetroAE would have done during the predeploy role. These include the following for most VM machine types:

  • Define VM resources including number of CPU cores and memory
  • Create required dependencies (i.e. disks, networks, etc.)
  • Disable cloud-init for the component
  • Configure networking for the component
  • Set the hostname for the component
  • Copy in authorized SSH keys
  • Configure autostart for the VM
  • Start the VM

4. Add Terraform Provisioners and Dependencies

Terraform will be providing the predeploy role, however, MetroAE will need to be triggered to perform the deploy and postdeploy roles. This is accomplished using provisioners.

resource "<provider>" "vsd1" {
    resource definitions...

    provisioner "local-exec" {
        command = "./metroae-container install vsds deploy"
        working_dir = "<metro-directory>/nuage-metroae"
    }

    provisioner "local-exec" {
        command = "./metroae-container install vsds postdeploy"
        working_dir = "<metro-directory>/nuage-metroae"
    }
}

The provisioners will trigger MetroAE to execute the deploy and postdeploy roles after the component VM is running. Provisioners will need to be added for each component to be deployed.

MetroAE should not be run in parallel and playbooks need to be run in the correct order (i.e. VSDs, VSCs, VSTATS...). To ensure that this is the case, resources need to be defined using dependencies as follows.

resource "<provider>" "vsd1" {
    resource definitions...
}
resource "<provider>" "vsc1" {
    resource definitions...
    depends_on = [<provider>.vsd1]
}
resource "<provider>" "vstat1" {
    resource definitions...
    depends_on = [<provider>.vsd1, <provider>.vsc1]
}

5. Apply Using Terraform

With all of the tools installed and properly configured, Terraform can perform the entire deployment using apply as described by change infrastructure.

terraform plan
terraform apply

Questions, Feedback, and Contributing

Get support via the forums on the MetroAE site. You may also contact us directly. Ask questions and contact us directly at devops@nuagenetworks.net.

Report bugs you find and suggest new features and enhancements via the GitHub Issues feature.

You may also contribute to MetroAE by submitting your own code to the project.