Skip to content

Configuration

In the French academic Infrastructure-as-a-Service ecosystem, Openstack has been chosen as the platform for providing Cloud services.
Large-scale instances are federated through FG-cloud.

Prerequisites

Network

At a minimum, the following OpenStack TCP/IP ports must be reachable (open outbound on the client side):

  • The Horizon web UI service (80, 443),
  • The Keystone identity service (5000),
  • The Glance image service (9292),
  • The Nova compute service (8774),
  • The Neutron networking service (9696),
  • The Octavia load-balancer service (9876).

Software

The terraform and python-openstackclient commands must be available.

These commands are available for example via pkgx.

Configuration

dependencies:
  opendev.org/openstack/python-openstackclient: ^6.3
  terraform.io: ^1.6

Activation

On a machine where the dev command provided by pkgx has never been invoked, it will cache the binary dependencies of our project.
 ✓  ~/.pkgx/terraform.io/v1.6.4
 ✓  ~/.pkgx/opendev.org/openstack/python-openstackclient/v6.3.0
env +opendev.org/openstack/python-openstackclient^6.3 +terraform.io^1.6

python-openstackclient

We now point our project directory environment at the OpenStack project resinfo-discotech@stratuslab.production.virtualdata.

env:
  OS_CLOUD: resinfo-discotech@stratuslab.production.virtualdata
dependencies:
  opendev.org/openstack/python-openstackclient: ^6.3
  terraform.io: ^1.6

Test

Reload our environment.

env -opendev.org/openstack/python-openstackclient^6.3 -terraform.io^1.6
env +opendev.org/openstack/python-openstackclient^6.3 +terraform.io^1.6

Query OpenStack to verify the authentication configuration is correct.

+----------------------+-------+
| Resource             | Limit |
+----------------------+-------+
| cores                |    40 |
| instances            |    20 |
| ram                  | 51200 |
| fixed-ips            |    -1 |
| injected-file-size   | 10240 |
| injected-path-size   |   255 |
| injected-files       |     5 |
| key-pairs            |   100 |
| properties           |   128 |
| server-groups        |    10 |
| server-group-members |    10 |
| floating-ips         |    -1 |
| secgroup-rules       |    -1 |
| secgroups            |    -1 |
+----------------------+-------+

terraform

OpenStack Provider

The terraform command will use the OS_CLOUD environment variable that we configured in the pkgx.yaml file of our working directory.
terraform {
  required_version = ">= 1.6.0"
  required_providers {
    openstack = {
      source = "terraform-provider-openstack/openstack"
      version = "~> 1.51.1"
    }
  }
}

provider openstack {}

Initialisation

Initialise the terraform state via the init sub-command.

~/projet-cloud/ $ terraform init

Validation

Check what terraform is going to do.

~/projet-cloud/ $ terraform plan