Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tier-1 cloud] Set terraform as default orchestrator #531

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions config/others/cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ nav:
- introduction.md
- access.md
- dashboard.md
- terraform.md
- manage_images.md
- flavors.md
- configure_instances.md
- launch_instance.md
- manage_volumes.md
- heat_templates.md
- terraform.md
- launch_instance.md
- shares.md
- gpus.md
- appendix.md
Expand Down
116 changes: 14 additions & 102 deletions mkdocs/docs/cloud/configure_instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ VSC IP addresses (172.24.48.0/20 IPs for \_vsc network). Unlike fixed IP
addresses, floating IP addresses can have their associations modified at
any time, regardless of the state of the instances involved.

Do not release the floating IPs assigned to your project. The floating
IPs are fixed to the project and it is not possible, as regular user, to
re-allocate floating IPs. Please contact to VSC Tier1 Cloud support if
you have released your project's floating IPs by mistake.
!!! Warning

Do not release the floating IPs assigned to your project. The floating
IPs are fixed to the project and it is not possible, as regular user, to
re-allocate floating IPs. Please contact to VSC Tier1 Cloud support if
you have released your project's floating IPs by mistake.

This section explains how to make your instance accessible via a public
IP address by two different methods. The preferred method for \_vm
Expand All @@ -90,106 +92,16 @@ need to create a port forwarding rule from a selected port of the
floating IP, to the port in the \_vm network where your instance's SSH
server is listening (typically port 22).

You can quickly set up such forwarding rules using
`neutron_port_forward`, a command line tool available on the UGent login
node, **login.hpc.ugent.be**. In order to use it, you must create an
application credential for the role "User", and save it as an openrc
file (see section [application credentials](access.md#application-credentials)
on page ). Transfer the openrc file to your
VSC storage space, so _neutron_port_forward_ can read it. To set up new
port forwarding rules, run the script providing the path to the openrc
file as an argument to the _-o_ option, and a file describing your port
forwarding configuration as argument to the _-m_ option:



```shell
neutron_port_forward -o <openrc file> -m <ini-file>
```

The following is an example configuration file:

```
[DEFAULT]
floatingip=193.190.85.40
network=_vm

[classa]
pattern=classa-(+̣)
22=52000:100:22
5900=55900

[classb]
pattern=classb-(+̣)
80=52080
```

Here we define defaults for the floating ip and target network, and two
classes. Instances are assigned to a class if their name matches the
regular expression given in `pattern`. The value of `pattern` must be a
valid Python regular expression, and the first capturing group (if any)
must match an integer.

Port forwarding rules are given in the form
`target=source(:multiplier:offset)`. This will set up a forwarding rule
from the floating IP port:

> (source + multiplier ∗ i + offset) → target ,

where **_i_** is the integer matched by the first capturing group, and
"target" is a port of the fixed IP for the instance in the chosen
network, in this case the _vm network. "multiplier" and "offset" are
optional and default to 1 and 0 respectively. In our example, this
results in the following set of port forwarding rules for the public IP
address 193.190.85.40:


```
52122 ->   classa-1:22
52222 ->   classa-2:22
...
55901 ->   classa-1:5900
55902 ->   classa-2:5900
...
52081 ->   classb-1:80
52082 ->   classb-2:80
...
```


This is another basic port forwarding configuration example without
patterns, in this case just to connect via SSH using external port 52000
to a running VM called testvm:

```
[DEFAULT]
floatingip=193.190.85.40
network=_vm

[testvm]
22=52000
```

You can also see an overview of existing port forwarding rules for the
ip addresses in your configuration file using
_neutron_port_forward --show_. Each rule has an internal id, which you
can see if you combine the options _--show_ and _--id_ as follows:

```shell
neutron_port_forward -o <openrc file> -m <ini-file> --show --id
```

To remove port forwarding rules, use the option
`--remove=<list of id's>` with a comma-separated list of the id's of the
rules you want to remove.
You can quickly set up such forwarding rules using [Terraform](terraform.md).
We provide several examples to generate automatically several port forwarding rules
to access to your VMs via SSH and port 22. You can also include more rules for more
external ports.

Please note that when you remove and reinstantiate a VM, OpenStack also
removes the port forwarding rules assigned to this VM automatically. If
you intantiate again the same VM you should run `neutron_port_forward`
and restore the port forwarding rules.
It is also possible to set port forwarding rules using OpenStack client
(only recommended for testing purposes). Please refer to OpenStack client
documentation for more
[information](https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/floating-ip-port-forwarding.html)

`neutron_port_forward` provides a few more options and advanced
features, run the command with the `--help` option for more information.

### Associate a floating ip

Expand Down
10 changes: 9 additions & 1 deletion mkdocs/docs/cloud/launch_instance.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Launch and manage instances
# Launch and manage instances (manually)


!!! Note

Although for testing purposes, you can always instantiate VMs
manually using this method, we recommend deploying and manging
your VMs (even for small Cloud infrastructures)
with [Terraform](terraform.md).

Instances are virtual machines that run inside the cloud. You can launch
an _instance_ from the following sources:
Expand Down
13 changes: 2 additions & 11 deletions mkdocs/docs/cloud/terraform.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
# Orchestration Using Terraform

HashiCorp Terraform <https://www.terraform.io/> is an
infrastructure as code tool (IaC), similar to OpenStack
Heat orchestrator
(See chapter [using heat](heat_templates.md#orchestration-using-heat)
). Users can deploy a data center
infrastructure as code tool (IaC). Users can deploy a data center
infrastructure using a declarative configuration language known as
HashiCorp Configuration Language (HCL), or using JSON.
Terraform has
some advantages over OpenStack Heat service. It is has a simple syntax, it
can provision virtual infrastructures across multiple cloud providers
(not only OpenStack) and it provides important features not supported by
Heat at this
moment, like network port forwarding rules (see
(not only OpenStack) and it provides important features like network port forwarding rules (see
[floating-ip](configure_instances.md#floating-ip-port-forwarding)).
This means that with Terraform, scripts
like `neutron_port_forward` (see
[port forwarding script](configure_instances.md#floating-ip-port-forwarding)
) are no longer needed.
Terraform is
currently one of the most popular infrastructure automation tools
available. VSC Cloud also provides some template examples that could be
Expand Down