Azure

Objective

This document provides instructions on how to install Volterra Node or Cluster (multi-node) using the Azure marketplace image.


Prerequisites

The following prerequisites apply:

Note: By proceeding with the installation, download and/or access and use, as applicable, of the Volterra software, and/or Volterra platform, you acknowledge that you have read, understand, and agree to be bound by this agreement.


Quick Deployment Option

The quickest way to install Volterra Node(s) is by using the Quickstart tool that comes packaged with a setup script and a container with Volterra Terraform deployment scripts.

Step 1 Download the Quickstart tool.

docker run --rm -v $(pwd):/opt/bin:rw docker.io/volterraio/volt-terraform:latest cp /deploy-terraform.sh /opt/bin

Step 2 Create the Azure Service Principal account and save the output.

./deploy-terraform.sh exec az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/<SUBSCRIPTION_ID>"

The following list shows the fields in the output of above command. These are required for preparing the input variables in the next step for deployment:

  • The field appId is the client_id variable.
  • The field password is the client_secret variable.
  • The field tenant is the tenant_idvariable.

Step 3 Create the input variables file for the Quickstart tool with the values obtained in Step 2.

{
    "client_id": "<CLIENT_ID>",
    "client_secret": "<CLIENT_SECRET>",
    "tenant_id": "<TENANT_ID>",
    "subscription_id": "<SUBSRIBTION_ID>",

    "location": "eastus",

    "machine_public_key": "<SSH_PUBLIC_KEY>",

    "deployment": "<VOLTERRA_SITE_NAME>",
    "cluster_token": "<VOLTERRA_SITE_TOKEN>"

}

Step 4 Deploy the node(s) using the apply option of the Quickstart tool. Enter the ce-multi-aws template for multi-node deployments and ce-single-aws templates for single-node deployments.

./deploy-terraform.sh apply -p azure -i <absolute_path_to_vars_file> -tn ce-single-azure --tf-version 0.12 --force

Example command to deploy a single node:

./deploy-terraform.sh apply -p azure -i /var/tmp/azure.tfvars -tn ce-single-azure --tf-version 0.12 --force

Note: In case of two-interface node installation, use ce-single-2nic-azure or ce-multi-2nic-azure as the template name for single-node or multi-node site respectively.


Detailed Deployment Steps

You can customize the default terraform deployment steps used by the Volterra Quickstart tool. Perform the following steps for customizing your deployment.

Step 1: Run the terraform CLI container.

docker run --entrypoint tail --name terraform-cli -d -it \
-w /terraform/templates \
-v ${HOME}/.ssh:/root/.ssh \
volterraio/volt-terraform:latest \
-f /dev/null

Step 2: Enter the terraform CLI container.

docker exec -it terraform-cli sh

Step 3: Login to Azure using your Active Domain(AD) credentials by executing the following command and follow the instructions displayed on the screen.

az login

Step 4: Check the default subscription and resource group.

az account list --output table

Step 5: Set a default subscription by name or uuid.

SUBSCRIPTION_ID=<subscription_id>
az account set -s $SUBSCRIPTION_ID

Step 6: Verify that the correct subscription is set.

 az account list --output table --query '[].{Name:name, IsDefault:isDefault}'

Step 7: Create a service principal account that has permissions to manage resources in the selected subscription. Save the output.

az ad sp create-for-rbac -n <deployment-name> --role="Contributor" --scopes="/subscriptions/$SUBSCRIPTION_ID"

The following is a sample output of the service principal account creation.

 {
        "appId": "00000000-0000-0000-0000-000000000000",
        "displayName": "azure-cli-2017-06-05-10-41-15",
        "name": "http://azure-cli-2017-06-05-10-41-15",
        "password": "0000-0000-0000-0000-000000000000",
        "tenant": "00000000-0000-0000-0000-000000000000"
 }

The following list shows the fields in the output of above command. These are required for preparing the input variables in the next step for deployment:

  • The field appId is the client_id variable.
  • The field password is the client_secret variable.
  • The field tenant is the tenant_idvariable.

Step 10: Create a terraform variables file or copy one from the samples provided. For single-node deployment, change to the ce-single-aws directory. For multi-node deployment, change to the ce-multi-aws directory.

cd <ce-single-azure | ce-multi-azure>
cp sample.tfvars.json azure.tfvars.json

Note: In case of two-interface node installation, change to the ce-single-2nic-azure or ce-multi-2nic-azure directory for single-node or multi-node site respectively.

Step 11: Edit the azure.tfvars.json and set the required Azure parameters.

{
    "client_id": "<CLIENT_ID>",
    "client_secret": "<CLIENT_SECRET>",
    "tenant_id": "<TENANT_ID>",
    "subscription_id": "<SUBSRIBTION_ID>",

    "location": "eastus",

    "machine_public_key": "<SSH_PUBLIC_KEY>",

    "deployment": "<VOLTERRA_SITE_NAME>",
    "cluster_token": "<VOLTERRA_SITE_TOKEN>"

}

Step 12: Deploy the nodes by executing the terraform commands.

terraform init
terraform apply -var-file=azure.tfvars.json

Note: The terraform init command initializes the directory containing terraform configuration files. When the terraform apply command is executed, it prompts for user input to proceed. Enter yes to begin deploying the node(s).

Step 13: Return to the Create Site document to accept the Registration.


Destroy

Destroying the node requires you to first decommission and delete the node from the Volterra console using the Remove Site instructions.

Step 1: Login to terraform-cli container.

docker exec -it terraform-cli sh

Step 2: Destroy the deployments by executing the destroy option from within the directories of your deployment. This example is for destroying a single node.

cd templates/ce-single-azure
terraform destroy -force -var-file=azure.tfvars.json

Example command to destroy single node using quickstart tool.

./deploy-terraform.sh destroy -p azure -i /var/tmp/azure.tfvars -tn ce-single-azure --tf-version 0.12 --force

Step 3: Delete the Azure service principal account.

az ad sp delete --id <deployment-name>

Step 4: Optionally, remove Volterra terraform container.

exit
docker rm -f terraform-cli

Concepts


How-to’s