Skip to content

Spirent-Terraform-Modules/terraform-vsphere-aion

Repository files navigation

vSphere Spirent AION Platform Terraform

Image of Spirent AION

Description

Spirent AION is a cloud platform for Spirent products and license management. This Terraform module deploys the Spirent AION Image on vSphere using your spirentaion.com account.

After terraform apply finishes you will be able to point your browser at the instance_public_ips addresses to use the platform or perform additional configuration.

Set enable_provisioner=false to run the configuration wizard manually in a web browser. Otherwise, when enable_provisioner=true login to https://<your_public_ip> using the values of admin_email and admin_password.

See product configuration for automated and manual configuration details.

Prerequisites

Prior to running Terraform the following must be completed:

  1. Install govc
  2. Install genisoimage
  3. Download AION image
  4. Create AION image vSphere Template
  5. Create public and private key files

Install govc

govc is a vSphere command line interface (CLI). Follow installation instructions here.

Set govc environmental variables specific to your vSphere: GOVC_URL, GOVC_INSECURE, GOVC_USERNAME, GOVC_PASSWORD

Verify vSphere list inventory works:

govc ls -l "*"

Install genisoimage

genisoimage is a tool to create ISO images. This terraform module uses genisomage to pass NoCloud cloud-init configuration to the instances. Install genisoimage using your package manager.

Ubuntu/Debian:

apt-get install genisoimage

Red Hat/CentOS:

yum install genisoimage

Download AION image

The AION platform OVA image can be downloaded from spirentaion.com in the AION Downloads of http::<your_organization>/spirentaion.com.

Create AION image vSphere Template

Create vSphere AION template using the following commands:

./import-spec.sh <vsphere_network> > aion-spec.json
govc import.ova -ds=<datastore> -options=aion-spec.json -name=aion_template <aion-platform-image-xxxx.ova>

Terraform examples

Terraform examples are located in the examples folder.

Basic usage

module "aion" {
  source = "git::https://github.com/Spirent-Terraform-Modules/terraform-vsphere-aion"

  datacenter            = "dc"
  datastore             = "ds"
  resource_pool_id      = "resgroup-123"
  mgmt_plane_network_id = "dvportgroup-123"
  template_name         = "aion_template"
  ips                   = ["10.0.0.11"]
  ip_netmask            = "255.255.255.0"
  ip_gateway            = "10.0.0.1"
  macs                  = ["00:00:00:11:22:33"]
  dest_datastore_folder = "iso"

  public_key_file  = "./bootstrap_public_key_file"
  private_key_file = "./bootstrap_private_key_file"

  aion_url       = "https://spirent.spirentaion.com"
  aion_user      = "[email protected]"
  aion_password  = "aion-password"
  admin_password = "admin-password"
}

Requirements

Name Version
vsphere 1.24.3

Providers

Name Version
local n/a
null n/a
random n/a
template n/a
vsphere 1.24.3

Modules

No Modules.

Resources

Name
local_file
null_resource
random_id
template_file
vsphere_datacenter
vsphere_datastore
vsphere_file
vsphere_virtual_machine
vsphere_virtual_machine

Inputs

Name Description Type Default Required
admin_email Cluster admin user email. Use this to login to instance web page. Default is obtained from AION user information. string "" no
admin_first_name Cluster admin user first name. Default is obtained from AION user information. string "" no
admin_last_name Cluster admin user last name. Default is obtained from AION user information. string "" no
admin_password Cluster admin user password. Use this to login to to the instance web page. string n/a yes
aion_password AION user password for aion_url string n/a yes
aion_url AION URL. An example URL would be https://example.spirentaion.com. string n/a yes
aion_user AION user registered on aion_url string n/a yes
cluster_names Instance cluster names. List length must equal instance_count. list(string) [] no
datacenter vSphere datacenter name string n/a yes
datastore vSphere datastore name string n/a yes
deploy_location Location name for deployed product instances. string "location1" no
deploy_products List of products to deploy. See Product List below for details. list(map(string)) [] no
dest_datastore_folder Destination datastore folder for cloud-init ISO images string n/a yes
dest_dir Destination directory on the instance where provisioning files will be copied string "~" no
enable_provisioner Enable provisioning. When enabled instances will be initialized with the specified variables. bool true no
entitlements Install hosted entitlements from organization's AION platform. See Entitlement List below for details. list(map(string)) [] no
http_enabled Allow HTTP access as well as HTTPS. Normally this is not recommended. bool false no
instance_count Number of AION instances to create number 1 no
instance_name Name assigned to the instance. An instance number will be appended to the name. string "AION" no
ip_gateway IPv4 gateway string n/a yes
ip_netmask IPv4 netmask string n/a yes
ips Static IPv4 address list list(string) n/a yes
local_admin_password Cluster local admin password for instance SSH access. Will use admin_password if not specified. string "" no
macs MAC address list. Automatically set if not specified. list(string) [] no
memory Size of the virtual machine's memory, in MB number "2048" no
metrics_opt_out Opt-out of Spirent metrics data collection bool false no
mgmt_plane_network_id Management network ID string n/a yes
node_names Instance cluster node names. List length must equal instance_count. list(string) [] no
node_storage_provider Cluster node storage provider string "local" no
node_storage_remote_uri Cluster node storage URI. Leave blank for default when provider is local string "" no
num_cpus Number of virtual processor cores assigned to an instance number "2" no
os_disk_size_gb Size of the OS disk in GB. When null size will be determined from the template image. number null no
private_key_file SSH private key file string n/a yes
public_key_file SSH public key file string n/a yes
resource_pool_id vSphere resource pool ID string n/a yes
template_name Name of the template created from the OVA string n/a yes

Outputs

Name Description
instance_uuids List of UUIDs assigned to the instances.

Product Configuration

Product configuration specifies product deployment and license entitlements for the platform.

Automated

Use Terraform variables for automated configuration.

Entitlement List

The entitlement list specifies which license entitlements are hosted to the new AION platform. An empty list will not add entitlements. Use the following options to define each entitlement:

Name Description Type Default Required
product Product name string n/a yes
license License name string n/a yes
number Entitlement number. When specified number must match otherwise any will match. number n/a no

Product List

The product list specifies which products will be deployed. An empty list will not deploy any products. Use the following options to define each product deployment:

Name Description Type Default Required
name Product name string n/a yes
version Product version string n/a yes

Manual

Use the web browser to perform additional manual configuration after the intance is deployed.

Add License Entitlements

  1. From Settings navigate to License Manager, Entitlements
  2. Click Install Entitlements
  3. Use one of the following methods to add entitlements (#1 is prefered)
    1. Login to <your_org>.spirentaion.com and select entitlements to host in the new instance
      Note: Hosted entitlements should be released before destroying the instance. As a convenience terraform destroy will unhost remaining entitlements. However, if instance state is manually manipulated you may need to contact Spirent support to release entitlements for you.
    2. Install a license entitlement file obtained from Spirent support

Add Products

  1. From Settings navigate to Settings, Add New Products
  2. Click Install New Products
  3. Select products and versions and click Install

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published