generated from equinix-labs/terraform-equinix-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marques Johansson <[email protected]>
- Loading branch information
Showing
22 changed files
with
181 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
|
||
# Manual Installation | ||
|
||
## Step 1: Deploy L2 Gateway | ||
|
||
Assuming we don't have another gateway deployed, we'll need to create one. | ||
|
||
<!-- TODO: migrate this script to live in the TF repo --> | ||
We'll be using the helper scripts developed for running the test suite for Nutanix to simplify this installation. | ||
|
||
```sh | ||
#!/bin/bash | ||
|
||
export EMAPI_AUTH_TOKEN=<your-metal-auth-token-here> | ||
export L2GATEWAY_VLAN_DESCRIPTION=ntnx-demo | ||
|
||
curl https://artifacts.platformequinix.com/images/nutanix/misc/scripts/install-l2gateway.sh | sh 2>&1 | tee /root/install-l2gw.log | ||
``` | ||
|
||
## Step 2: Deploy one or more Nutanix Nodes (m3.xlarge) | ||
|
||
## Step 3: Once installation is complete, move nodes to L2 mode | ||
|
||
## Step 4: Reboot Nutanix nodes (to allow them to re-dhcp from new l2 gateway) | ||
|
||
## Step 5: Discover CVM IPs | ||
|
||
Look at the lease table on the dhcp server, and find all the kvm mac leases. | ||
|
||
```sh | ||
curl -s http://192.168.0.1/leases | ||
``` | ||
|
||
## Step 5: Login to Nutanix CVM node and create cluster | ||
|
||
```sh | ||
ssh nutanix@$CVM_IP | ||
cluster -s "CVM_IP1,CVM_IP2,CVM_IP3" create | ||
``` | ||
|
||
## Step 6: Access Prism's UI | ||
|
||
Open `https://$CVM_IP:9440` in your browser | ||
|
||
Default login is `admin` and `nutanix/4u` | ||
|
||
A password change will be required, we'll use `Nutanix.123` | ||
|
||
Follow the account steps. | ||
|
||
### Spawning a VM | ||
|
||
#### Step 1: Configure DNS | ||
|
||
Settings -> Name Servers | ||
Add | ||
8.8.8.8 | ||
|
||
#### Step 2: Add image | ||
|
||
Settings -> Image Configuration | ||
Upload Image | ||
|
||
Name: Rocky8 | ||
Type: ISO | ||
URL: <https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.5-x86_64-minimal.iso> | ||
|
||
#### Step 3: Configure a network | ||
|
||
Settings -> Network Configuration | ||
|
||
Create Network | ||
|
||
Network Name: vlan0 | ||
VLAN ID: 0 | ||
|
||
#### Step 4: Create VM | ||
|
||
Settings -> VM | ||
|
||
Create VM | ||
|
||
Name: rocky8 | ||
vCPU(s): 8 | ||
Memory: 8 | ||
|
||
Disks | ||
CDROM: Edit, use rocky8 | ||
Add New Disk: | ||
Size: 100 | ||
|
||
Save | ||
|
||
Power on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,47 @@ | ||
# TEMPLATE: Before using "provider" blocks, consider https://www.terraform.io/docs/language/modules/develop/providers.html#implicit-provider-inheritance | ||
# TEMPLATE: | ||
# TEMPLATE: All ".tf" files are parsed at once. There is no benefit to numerically prefixed filenames. Keep all resource definitions in "main.tf". | ||
# TEMPLATE: | ||
# TEMPLATE: When main.tf becomes unwieldy, consider submodules (https://www.terraform.io/docs/language/modules/develop/structure.html) | ||
# TEMPLATE: and dependency inversion (https://www.terraform.io/docs/language/modules/develop/composition.html). | ||
# TEMPLATE: | ||
|
||
# TEMPLATE: Replace sample provider described below with your own. | ||
terraform { | ||
required_version = ">= 1.3" | ||
|
||
provider_meta "equinix" { | ||
# TEMPLATE: Replace the module name with your own. | ||
module_name = "template" | ||
} | ||
|
||
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = ">= 1.8.0" | ||
} | ||
} | ||
data "equinix_metal_project" "nutanix" { | ||
name = "devrel-marques-testing" | ||
} | ||
|
||
# TEMPLATE: Replace sample provider described below with your own. | ||
provider "equinix" { | ||
auth_token = var.metal_auth_token | ||
resource "equinix_metal_vlan" "test" { | ||
project_id = data.equinix_metal_project.nutanix.id | ||
description = var.metal_vlan_description | ||
metro = "da" | ||
} | ||
|
||
# TEMPLATE: Replace sample resource described below with your own. | ||
resource "equinix_metal_device" "example_device" { | ||
hostname = "example-device" | ||
resource "equinix_metal_device" "bastion" { | ||
project_id = data.equinix_metal_project.nutanix.id | ||
hostname = "bastion" | ||
user_data = templatefile("bastion-userdata.tmpl", { | ||
metal_auth_token = var.metal_auth_token | ||
metal_vlan_description = var.metal_vlan_description | ||
}) | ||
operating_system = "rocky_9" | ||
plan = "c3.small.x86" | ||
metro = "sv" | ||
operating_system = "ubuntu_20_04" | ||
billing_cycle = "hourly" | ||
project_id = var.metal_project_id | ||
metro = "da" | ||
} | ||
|
||
# TEMPLATE: Run `terraform get` to install local module | ||
# TEMPLATE: Run `terraform init` to initialize backends and install plugins | ||
# TEMPLATE: Replace sample in-line local module described below with your own. | ||
# TEMPLATE | ||
module "inline_module" { | ||
source = "./modules/inline-module" | ||
resource "equinix_metal_port" "bastion_bond0" { | ||
port_id = [for p in equinix_metal_device.bastion.ports : p.id if p.name == "bond0"][0] | ||
layer2 = false | ||
bonded = true | ||
vlan_ids = [equinix_metal_vlan.test.id] | ||
} | ||
|
||
# Define any required variables | ||
inline_module_project_id = var.metal_project_id | ||
resource "equinix_metal_device" "nutanix" { | ||
count = 1 | ||
project_id = data.equinix_metal_project.nutanix.id | ||
hostname = "nutanix-devrel-test-{count.index}" | ||
user_data = templatefile("nutanix-userdata.tmpl", {}) | ||
operating_system = "nutanix_lts_6_5" | ||
plan = "m3.large.x86" | ||
metro = "da" | ||
} | ||
|
||
resource "equinix_metal_port" "nutanix_bond0" { | ||
for_each = equinix_metal_device.nutanix | ||
port_id = [for p in each.value.ports : p.id if p.name == "bond0"][0] | ||
layer2 = true | ||
bonded = true | ||
vlan_ids = [equinix_metal_vlan.test.id] | ||
} | ||
|
Oops, something went wrong.