-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: update version and example in index.md + added example for multi…
…ple NICs on an IP Failover (#242)
- Loading branch information
Showing
6 changed files
with
249 additions
and
35 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
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 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 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,11 @@ | ||
# Multiple NICs under the same IP Failover | ||
|
||
This example aims to exemplify the way in which a secondary NIC can be added to an IP Failover, following these steps: | ||
1) Creating NIC A with failover IP on LAN 1 | ||
2) Create NIC B unde the same LAN but with a different IP | ||
3) Create the IP Failover on LAN 1 with NIC A and failover IP of NIC A (A becomes now "master", no slaves) | ||
4) Update NIC B IP to be the failover IP ( B becomes now a slave, A remains master) | ||
|
||
To test this please run firstly [the main.tf from inital_structure folder](initial_infrastructure/main.tf), followed by [the one in update_nic folder](update_nic/main.tf). | ||
|
||
After this you can create a new NIC C, NIC D and so on, in LAN 1, directly with the failover IP. |
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,92 @@ | ||
terraform { | ||
required_version = "> 0.12.0" | ||
required_providers { | ||
ionoscloud = { | ||
source = "ionos-cloud/ionoscloud" | ||
version = "6.2.0" | ||
} | ||
} | ||
} | ||
|
||
provider "ionoscloud" {} | ||
|
||
data "ionoscloud_image" "example" { | ||
type = "HDD" | ||
cloud_init = "V1" | ||
location = "us/las" | ||
} | ||
|
||
resource "ionoscloud_datacenter" "example" { | ||
name = "Datacenter Example" | ||
location = "us/las" | ||
description = "Datacenter Description" | ||
sec_auth_protection = false | ||
} | ||
|
||
resource "ionoscloud_lan" "example" { | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
public = true | ||
name = "Lan Example" | ||
} | ||
|
||
resource "ionoscloud_ipblock" "example" { | ||
location = ionoscloud_datacenter.example.location | ||
size = 2 | ||
name = "IP Block Example" | ||
} | ||
|
||
resource "ionoscloud_server" "example_A" { | ||
name = "Server A" | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
cores = 1 | ||
ram = 1024 | ||
availability_zone = "ZONE_1" | ||
cpu_family = "AMD_OPTERON" | ||
image_name = data.ionoscloud_image.example.id | ||
image_password = "K3tTj8G14a3EgKyNeeiY" | ||
volume { | ||
name = "system" | ||
size = 14 | ||
disk_type = "SSD" | ||
} | ||
nic { | ||
name = "NIC A" | ||
lan = ionoscloud_lan.example.id | ||
dhcp = true | ||
firewall_active = true | ||
ips = [ ionoscloud_ipblock.example.ips[0] ] | ||
} | ||
} | ||
|
||
|
||
resource "ionoscloud_server" "example_B" { | ||
name = "Server B" | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
cores = 1 | ||
ram = 1024 | ||
availability_zone = "ZONE_1" | ||
cpu_family = "AMD_OPTERON" | ||
image_name = data.ionoscloud_image.example.id | ||
image_password = "K3tTj8G14a3EgKyNeeiY" | ||
volume { | ||
name = "system" | ||
size = 14 | ||
disk_type = "SSD" | ||
} | ||
nic { | ||
name = "NIC B" | ||
lan = ionoscloud_lan.example.id | ||
dhcp = true | ||
firewall_active = true | ||
ips = [ ionoscloud_ipblock.example.ips[1] ] | ||
} | ||
} | ||
|
||
|
||
resource "ionoscloud_ipfailover" "example" { | ||
depends_on = [ ionoscloud_lan.example ] | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
lan_id = ionoscloud_lan.example.id | ||
ip = ionoscloud_ipblock.example.ips[0] | ||
nicuuid = ionoscloud_server.example_A.primary_nic | ||
} |
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,92 @@ | ||
terraform { | ||
required_version = "> 0.12.0" | ||
required_providers { | ||
ionoscloud = { | ||
source = "ionos-cloud/ionoscloud" | ||
version = "6.2.0" | ||
} | ||
} | ||
} | ||
|
||
provider "ionoscloud" {} | ||
|
||
data "ionoscloud_image" "example" { | ||
type = "HDD" | ||
cloud_init = "V1" | ||
location = "us/las" | ||
} | ||
|
||
resource "ionoscloud_datacenter" "example" { | ||
name = "Datacenter Example" | ||
location = "us/las" | ||
description = "Datacenter Description" | ||
sec_auth_protection = false | ||
} | ||
|
||
resource "ionoscloud_lan" "example" { | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
public = true | ||
name = "Lan Example" | ||
} | ||
|
||
resource "ionoscloud_ipblock" "example" { | ||
location = ionoscloud_datacenter.example.location | ||
size = 2 | ||
name = "IP Block Example" | ||
} | ||
|
||
resource "ionoscloud_server" "example_A" { | ||
name = "Server A" | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
cores = 1 | ||
ram = 1024 | ||
availability_zone = "ZONE_1" | ||
cpu_family = "AMD_OPTERON" | ||
image_name = data.ionoscloud_image.example.id | ||
image_password = "K3tTj8G14a3EgKyNeeiY" | ||
volume { | ||
name = "system" | ||
size = 14 | ||
disk_type = "SSD" | ||
} | ||
nic { | ||
name = "NIC A" | ||
lan = ionoscloud_lan.example.id | ||
dhcp = true | ||
firewall_active = true | ||
ips = [ ionoscloud_ipblock.example.ips[0] ] | ||
} | ||
} | ||
|
||
|
||
resource "ionoscloud_server" "example_B" { | ||
name = "Server B" | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
cores = 1 | ||
ram = 1024 | ||
availability_zone = "ZONE_1" | ||
cpu_family = "AMD_OPTERON" | ||
image_name = data.ionoscloud_image.example.id | ||
image_password = "K3tTj8G14a3EgKyNeeiY" | ||
volume { | ||
name = "system" | ||
size = 14 | ||
disk_type = "SSD" | ||
} | ||
nic { | ||
name = "NIC B" | ||
lan = ionoscloud_lan.example.id | ||
dhcp = true | ||
firewall_active = true | ||
ips = [ ionoscloud_ipblock.example.ips[0] ] | ||
} | ||
} | ||
|
||
|
||
resource "ionoscloud_ipfailover" "example" { | ||
depends_on = [ ionoscloud_lan.example ] | ||
datacenter_id = ionoscloud_datacenter.example.id | ||
lan_id = ionoscloud_lan.example.id | ||
ip = ionoscloud_ipblock.example.ips[0] | ||
nicuuid = ionoscloud_server.example_A.primary_nic | ||
} |