Skip to content

Commit 818d5ed

Browse files
Merge pull request #4309 from ovh/gallee/vlan_id_terraform-YC
Public Cloud Network Services - Adding Terraform in private Network creation
2 parents 462a9e7 + 73f8712 commit 818d5ed

File tree

15 files changed

+771
-137
lines changed

15 files changed

+771
-137
lines changed

pages/platform/network-services/getting-started-07-creating-vrack/guide.de-de.md

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ excerpt: 'Erfahren Sie hier, wie Sie Ihr vRack mit Public Cloud Instanzen einric
44
slug: public-cloud-vrack
55
section: Erste Schritte
66
order: 07
7-
updated: 2023-01-10
7+
updated: 2023-03-03
88
---
99

1010
> [!primary]
1111
> Diese Übersetzung wurde durch unseren Partner SYSTRAN automatisch erstellt. In manchen Fällen können ungenaue Formulierungen verwendet worden sein, z.B. bei der Beschriftung von Schaltflächen oder technischen Details. Bitte ziehen Sie beim geringsten Zweifel die englische oder französische Fassung der Anleitung zu Rate. Möchten Sie mithelfen, diese Übersetzung zu verbessern? Dann nutzen Sie dazu bitte den Button «Mitmachen» auf dieser Seite.
1212
>
1313
14-
**Letzte Aktualisierung am 11.01.2023**
14+
**Letzte Aktualisierung am 03.03.2023**
1515

1616
## Ziel
1717

@@ -28,7 +28,7 @@ Das OVHcloud [vRack](https://www.ovh.de/loesungen/vrack/) ist ein privates Netzw
2828

2929
## Vorstellung der Interfaces
3030

31-
Ob Sie Ihr vRack neu erstellen oder eine Instanz zum Netzwerk hinzufügen möchten, Sie können dazu das OVHcloud Kundencenter, die OVHcloud APIv6, die OpenStack API oder das Horizon-Interface verwenden.
31+
Ob Sie Ihr vRack neu erstellen oder eine Instanz zum Netzwerk hinzufügen möchten, Sie können dazu das OVHcloud Kundencenter verwenden, die OVHcloud APIv6, die OpenStack API, das Horizon-Interface oder Terraform.
3232

3333
Je nach Ihrem technischen Profil und Ihren Bedürfnissen müssen Sie entscheiden, welches Interface oder welche Methode Sie verwenden. Für jede Aktion werden nachfolgend die möglichen Vorgehensweisen erklärt.
3434

@@ -51,7 +51,7 @@ Dieses umfassende technische Interface erlaubt es Ihnen, fast alle Aktionen in O
5151
Lesen Sie die [Anleitung zu Horizon](https://docs.ovh.com/de/public-cloud/horizon/), um sich mit dem Interface vertraut zu machen.
5252

5353
> [!primary]
54-
> Horizon mit Zonenfunktion: Denken Sie daran, Ihre Arbeitszone oben links in Ihrem Interface zu wählen (GRA5, SBG3, BHS1...).
54+
> Horizon mit Zonenfunktion: Denken Sie daran, Ihre Arbeitszone oben links in Ihrem Interface zu wählen (GRA5, SBG3, BHS1, etc.).
5555
>
5656
5757
### OVHcloud APIv6
@@ -95,9 +95,15 @@ Sie können dann bei Bedarf die dedizierten OpenStack APIs verwenden:
9595
> In einigen Fällen wird es einfacher sein, die OpenStack API zu verwenden, in anderen Fällen die APIs von Nova oder Neutron.
9696
>
9797
> Je nach Version Ihres Clients und Betriebssystems können auch bestimmte Funktionen der OpenStack API fehlen. In dieser Anleitung werden je die einfachsten und intuitivsten Vorgehensweisen erklärt.<br>
98-
> Sie können auch [die offizielle Dokumentation von OpenStack einsehen](https://docs.openstack.org/xena/){.external}, wenn Sie diese tiefergehend verwenden möchten.
98+
> Sie können auch [die offizielle Dokumentation von OpenStack einsehen](https://docs.openstack.org/xena/){.external}, wenn Sie die API tiefergehend verwenden möchten.
9999
>
100100
101+
### Terraform
102+
103+
Terraform kann auch für die Verwaltung von OVHcloud Infrastrukturen verwendet werden.
104+
105+
Dazu müssen Sie den richtigen Terraform-Anbieter und die richtige Terraform-Ressource auswählen. Weitere Informationen finden Sie in unserer Anleitung zur [Nutzung von Terraform mit OVHcloud (EN)](https://docs.ovh.com/de/api/terraform-at-ovhcloud/).
106+
101107
## In der praktischen Anwendung
102108

103109
### Schritt 1: vRack aktivieren und verwalten <a name="activation"></a>
@@ -126,7 +132,7 @@ Um die Konfiguration des vRack über das OVHcloud Kundencenter fortzusetzen, les
126132

127133
Um ein vRack mit der OVHcloud APIv6 zu aktivieren und zu verwalten, lesen Sie [diesen Abschnitt](https://docs.ovh.com/gb/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-1-activating-and-managing-a-vrack) (EN) der entsprechenden Anleitung.
128134

129-
### Schritt 2: Erstellen eines VLAN im vRack
135+
### Schritt 2: Erstellen eines privaten Netzwerks im vRack
130136

131137
Es ist notwendig, ein virtuelles lokales Netzwerk (VLAN) zu erstellen, damit die mit dem vRack verbundenen Instanzen untereinander kommunizieren können.
132138

@@ -152,7 +158,7 @@ Dies ist nützlich, um Ihr vRack in mehrere virtuelle Netzwerke aufzuteilen.
152158
>Da OpenStack nicht auf derselben Ebene der Infrastruktur liegt, können Sie die VLANs nicht über das Horizon-Interface oder die OpenStack APIs personalisieren.
153159
>
154160
155-
#### Erstellen eines VLAN im OVHcloud Kundencenter <a name="kundencenter"></a>
161+
#### Erstellen eines privaten Netzwerks im OVHcloud Kundencenter <a name="kundencenter"></a>
156162

157163
Sobald das vRack erstellt ist, gehen Sie zum Abschnitt `Private Network`{.action}.
158164

@@ -198,9 +204,46 @@ Wenn Sie Ihre Wahl getroffen haben, klicken Sie auf `Erstellen`{.action}, um den
198204
> Die Erstellung des privaten Netzwerks kann einige Minuten in Anspruch nehmen.
199205
>
200206
201-
#### Erstellen eines VLAN mit der OVHcloud APIv6 <a name="vlansetup"></a>
207+
#### Erstellen eines privaten Netzwerks mit der OVHcloud APIv6 <a name="vlansetup"></a>
208+
209+
Um ein privates Netzwerk mit der OVHCloud APIv6 zu erstellen, folgen Sie [diesem Abschnitt](https://docs.ovh.com/de/publiccloud/network-services/public-cloud-vrack-apiv6/#step-3-creating-a-vlan-in-the-vrack_1) der entsprechenden Anleitung (EN).
210+
211+
212+
#### Ein privates Netzwerk über OpenStack CLI erstellen
213+
214+
Um das gleiche private Netzwerk zu erstellen, müssen Sie 2 OpenStack-Objekte erstellen: *network* und *subnet*.
215+
216+
Im folgenden Beispiel geben wir die `VLAN_ID`, zu der das Netzwerk gehören soll, über `--provider-network-type` und `--provider-segment` an.
217+
218+
Sie können diese Einstellungen auch entfernen. In diesem Fall wird eine verfügbare `VLAN_ID` verwendet.
202219

203-
Um ein VLAN mit der OVHCloud APIv6 zu erstellen, folgen Sie [diesem Abschnitt](https://docs.ovh.com/gb/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-3-creating-a-vlan-in-the-vrack_1) (EN) der entsprechenden Anleitung.
220+
```bash
221+
openstack network create --provider-network-type vrack --provider-segment 42 OS_CLI_private_network
222+
openstack subnet create --dhcp --network OS_CLI_private_network OS_CLI_subnet --subnet-range 10.0.0.0/16
223+
```
224+
225+
#### Ein privates Netzwerk über Terraform erstellen
226+
227+
In Terraform muss der Provider *openstack* verwendet werden. Ein vollständiges Beispiel für ein Terraform-Skript können Sie in [diesem Repository](https://github.com/yomovh/tf-at-ovhcloud/tree/main/private_network) herunterladen.
228+
229+
Der bezüglich OVHcloud relevante Part für die vRack-Integration ist der Parameter `value_specs`.
230+
231+
```hcl
232+
resource "openstack_networking_network_v2" "tf_network" {
233+
name = "tf_network"
234+
admin_state_up = "true"
235+
value_specs = {
236+
"provider:network_type" = "vrack"
237+
"provider:segmentation_id" = var.vlan_id
238+
}
239+
}
240+
resource "openstack_networking_subnet_v2" "tf_subnet"{
241+
name = "tf_subnet"
242+
network_id = openstack_networking_network_v2.tf_network.id
243+
cidr = "10.0.0.0/16"
244+
enable_dhcp = true
245+
}
246+
```
204247

205248
### Schritt 3: Instanz in das vRack integrieren
206249

pages/platform/network-services/getting-started-07-creating-vrack/guide.en-asia.md

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ excerpt: 'Find out how to set up vRack for your Public Cloud instances'
44
slug: public-cloud-vrack
55
section: Getting started
66
order: 07
7-
updated: 2023-01-10
7+
updated: 2023-03-03
88
---
99

10-
**Last updated 10th January 2023**
10+
**Last updated 3rd March 2023**
1111

1212
## Objective
1313

@@ -24,7 +24,7 @@ The OVHcloud [vRack](https://www.ovh.com/asia/solutions/vrack/) is a private net
2424

2525
## Interfaces
2626

27-
Creating a vRack or adding an instance into the network can be done using the OVHcloud Control Panel, the OVHcloud APIv6, the OpenStack API, or the Horizon interface.
27+
Creating a vRack or adding an instance into the network can be done using the OVHcloud Control Panel, the OVHcloud APIv6, the OpenStack API, the Horizon interface or Terraform.
2828

2929
Depending on your technical profile and needs, it is mostly up to you which interface or method to use. For each option, the guide instructions below describe the necessary steps.
3030

@@ -88,10 +88,16 @@ You will then be able to use the APIs dedicated to OpenStack as needed:
8888
> In some cases, it will be easier to use the OpenStack APIs and in others, Nova, Neutron, etc.
8989
>
9090
> Moreover, some features may be missing from the OpenStack API depending on the version of your client and operating system.
91-
For the purpose of making this guide more accessible, it presents the simplest and most intuitive options.
92-
You may consult the [official OpenStack documentation](https://docs.openstack.org/){.external} if you wish to go further in learning about its use.
91+
> For the purpose of making this guide more accessible, it presents the simplest and most intuitive options.
92+
> You may consult the [official OpenStack documentation](https://docs.openstack.org/){.external} if you wish to go further in learning about its use.
9393
>
9494
95+
### Terraform
96+
97+
Terraform can also be used to manage OVHcloud infrastructures.
98+
99+
For that you need to cherry-pick the correct terraform provider & resource. Find more information in our guide on [using Terraform with OVHcloud](https://docs.ovh.com/asia/en/api/terraform-at-ovhcloud/).
100+
95101
## Instructions
96102

97103
### Step 1: Activating and managing a vRack <a name="activation"></a>
@@ -118,9 +124,9 @@ To continue the configuration of your vRack in the OVHcloud Control Panel, skip
118124

119125
To activate and manage a vRack using the OVHcloud APIv6, please refer to [this section](https://docs.ovh.com/asia/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-1-activating-and-managing-a-vrack) of the corresponding guide.
120126

121-
### Step 2: Creating a VLAN in the vRack
127+
### Step 2: Creating a private network in the vRack
122128

123-
It is necessary to create a VLAN so that the connected instances can communicate with each other.
129+
It is necessary to create a private network so that the connected instances can communicate with each other.
124130

125131
With the Public Cloud service, you can create up to 4,000 VLANs within one vRack. This means that you can use each private IP address up to 4,000 times.
126132
Thus, for example, 192.168.0.10 of VLAN 2 is different from IP 192.168.0.10 of VLAN 42.
@@ -143,7 +149,7 @@ Using the OVHcloud APIv6, you can customise all settings: IP range (10.0.0.0/16
143149
> Because OpenStack is not located at the same level, you will not be able to customise VLANs through the Horizon interface or OpenStack APIs.
144150
>
145151
146-
#### Creating a VLAN in the OVHcloud Control Panel
152+
#### Creating a private network in the OVHcloud Control Panel
147153

148154
Once a vRack exists, click on `Private Network`{.action} in the left-hand menu under **Network**.
149155

@@ -191,9 +197,45 @@ Once done, click on `Create`{.action} to start the process.
191197
> Creating the private network may take several minutes.
192198
>
193199
194-
#### Creating a VLAN with the OVHcloud APIv6 <a name="vlansetup"></a>
200+
#### Creating a private network with the OVHcloud APIv6 <a name="vlansetup"></a>
201+
202+
To create a private network using the OVHcloud APIv6, please refer to [this section](https://docs.ovh.com/asia/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-3-creating-a-vlan-in-the-vrack_1) of the corresponding guide.
203+
204+
#### Creating a private network with the OpenStack CLI
205+
206+
In order to create the same private network, we need to create 2 OpenStack objects : network and subnet.
195207

196-
To create a VLAN using the OVHcloud APIv6, please refer to [this section](https://docs.ovh.com/asia/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-3-creating-a-vlan-in-the-vrack_1) of the corresponding guide.
208+
In the following example we specify the `VLAN_ID` to which we want the network to be part of through `--provider-network-type` and `--provider-segment`.
209+
210+
You can remove those parameters. In that case, an available `VLAN_ID` will be used.
211+
212+
```bash
213+
openstack network create --provider-network-type vrack --provider-segment 42 OS_CLI_private_network
214+
openstack subnet create --dhcp --network OS_CLI_private_network OS_CLI_subnet --subnet-range 10.0.0.0/16
215+
```
216+
217+
#### Creating a private network with Terraform
218+
219+
In Terraform, you will need to use the openstack provider. You can download an example of a complete terraform script in [this repository](https://github.com/yomovh/tf-at-ovhcloud/tree/main/private_network).
220+
221+
The OVHcloud specific part for vRack integration is the `value_specs` parameter.
222+
223+
```hcl
224+
resource "openstack_networking_network_v2" "tf_network" {
225+
name = "tf_network"
226+
admin_state_up = "true"
227+
value_specs = {
228+
"provider:network_type" = "vrack"
229+
"provider:segmentation_id" = var.vlan_id
230+
}
231+
}
232+
resource "openstack_networking_subnet_v2" "tf_subnet"{
233+
name = "tf_subnet"
234+
network_id = openstack_networking_network_v2.tf_network.id
235+
cidr = "10.0.0.0/16"
236+
enable_dhcp = true
237+
}
238+
```
197239

198240
### Step 3: Integrating an instance into vRack <a name="instance-integration"></a>
199241

pages/platform/network-services/getting-started-07-creating-vrack/guide.en-au.md

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ excerpt: 'Find out how to set up vRack for your Public Cloud instances'
44
slug: public-cloud-vrack
55
section: Getting started
66
order: 07
7-
updated: 2023-01-10
7+
updated: 2023-03-03
88
---
99

10-
**Last updated 10th January 2023**
10+
**Last updated 3rd March 2023**
1111

1212
## Objective
1313

@@ -24,7 +24,7 @@ The OVHcloud [vRack](https://www.ovh.com.au/solutions/vrack/) is a private netwo
2424

2525
## Interfaces
2626

27-
Creating a vRack or adding an instance into the network can be done using the OVHcloud Control Panel, the OVHcloud APIv6, the OpenStack API, or the Horizon interface.
27+
Creating a vRack or adding an instance into the network can be done using the OVHcloud Control Panel, the OVHcloud APIv6, the OpenStack API, the Horizon interface or Terraform.
2828

2929
Depending on your technical profile and needs, it is mostly up to you which interface or method to use. For each option, the guide instructions below describe the necessary steps.
3030

@@ -88,10 +88,16 @@ You will then be able to use the APIs dedicated to OpenStack as needed:
8888
> In some cases, it will be easier to use the OpenStack APIs and in others, Nova, Neutron, etc.
8989
>
9090
> Moreover, some features may be missing from the OpenStack API depending on the version of your client and operating system.
91-
For the purpose of making this guide more accessible, it presents the simplest and most intuitive options.
92-
You may consult the [official OpenStack documentation](https://docs.openstack.org/){.external} if you wish to go further in learning about its use.
91+
> For the purpose of making this guide more accessible, it presents the simplest and most intuitive options.
92+
> You may consult the [official OpenStack documentation](https://docs.openstack.org/){.external} if you wish to go further in learning about its use.
9393
>
9494
95+
### Terraform
96+
97+
Terraform can also be used to manage OVHcloud infrastructures.
98+
99+
For that you need to cherry-pick the correct terraform provider & resource. Find more information in our guide on [using Terraform with OVHcloud](https://docs.ovh.com/au/en/api/terraform-at-ovhcloud/).
100+
95101
## Instructions
96102

97103
### Step 1: Activating and managing a vRack <a name="activation"></a>
@@ -118,9 +124,9 @@ To continue the configuration of your vRack in the OVHcloud Control Panel, skip
118124

119125
To activate and manage a vRack using the OVHcloud APIv6, please refer to [this section](https://docs.ovh.com/au/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-1-activating-and-managing-a-vrack) of the corresponding guide.
120126

121-
### Step 2: Creating a VLAN in the vRack
127+
### Step 2: Creating a private network in the vRack
122128

123-
It is necessary to create a VLAN so that the connected instances can communicate with each other.
129+
It is necessary to create a private network so that the connected instances can communicate with each other.
124130

125131
With the Public Cloud service, you can create up to 4,000 VLANs within one vRack. This means that you can use each private IP address up to 4,000 times.
126132
Thus, for example, 192.168.0.10 of VLAN 2 is different from IP 192.168.0.10 of VLAN 42.
@@ -143,7 +149,7 @@ Using the OVHcloud APIv6, you can customise all settings: IP range (10.0.0.0/16
143149
> Because OpenStack is not located at the same level, you will not be able to customise VLANs through the Horizon interface or OpenStack APIs.
144150
>
145151
146-
#### Creating a VLAN in the OVHcloud Control Panel
152+
#### Creating a private network in the OVHcloud Control Panel
147153

148154
Once a vRack exists, click on `Private Network`{.action} in the left-hand menu under **Network**.
149155

@@ -191,9 +197,45 @@ Once done, click on `Create`{.action} to start the process.
191197
> Creating the private network may take several minutes.
192198
>
193199
194-
#### Creating a VLAN with the OVHcloud APIv6 <a name="vlansetup"></a>
200+
#### Creating a private network with the OVHcloud APIv6 <a name="vlansetup"></a>
201+
202+
To create a private network using the OVHcloud APIv6, please refer to [this section](https://docs.ovh.com/au/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-3-creating-a-vlan-in-the-vrack_1) of the corresponding guide.
203+
204+
#### Creating a private network with the OpenStack CLI
205+
206+
In order to create the same private network, we need to create 2 OpenStack objects : network and subnet.
195207

196-
To create a VLAN using the OVHcloud APIv6, please refer to [this section](https://docs.ovh.com/au/en/publiccloud/network-services/public-cloud-vrack-apiv6/#step-3-creating-a-vlan-in-the-vrack_1) of the corresponding guide.
208+
In the following example we specify the `VLAN_ID` to which we want the network to be part of through `--provider-network-type` and `--provider-segment`.
209+
210+
You can remove those parameters. In that case, an available `VLAN_ID` will be used.
211+
212+
```bash
213+
openstack network create --provider-network-type vrack --provider-segment 42 OS_CLI_private_network
214+
openstack subnet create --dhcp --network OS_CLI_private_network OS_CLI_subnet --subnet-range 10.0.0.0/16
215+
```
216+
217+
#### Creating a private network with Terraform
218+
219+
In Terraform, you will need to use the openstack provider. You can download an example of a complete terraform script in [this repository](https://github.com/yomovh/tf-at-ovhcloud/tree/main/private_network).
220+
221+
The OVHcloud specific part for vRack integration is the `value_specs` parameter.
222+
223+
```hcl
224+
resource "openstack_networking_network_v2" "tf_network" {
225+
name = "tf_network"
226+
admin_state_up = "true"
227+
value_specs = {
228+
"provider:network_type" = "vrack"
229+
"provider:segmentation_id" = var.vlan_id
230+
}
231+
}
232+
resource "openstack_networking_subnet_v2" "tf_subnet"{
233+
name = "tf_subnet"
234+
network_id = openstack_networking_network_v2.tf_network.id
235+
cidr = "10.0.0.0/16"
236+
enable_dhcp = true
237+
}
238+
```
197239

198240
### Step 3: Integrating an instance into vRack <a name="instance-integration"></a>
199241

0 commit comments

Comments
 (0)