Reference

API and Terraform

Unio Cloud runs OpenStack, so the API is the OpenStack API: the same CLI, SDKs and Terraform provider that work against every other OpenStack cloud work here, with no proprietary client to learn. Storage speaks S3. That is the whole point: your infrastructure code stays portable.

1. Credentials

Download unio-openrc.sh from Billing & credentials. It contains your project, username and password for the cloud API. Keep it secret, it is equivalent to your console login for infrastructure.

openrc
# download openrc from the console (Billing & credentials)
source unio-openrc.sh

# it exports:
# OS_AUTH_URL, OS_PROJECT_NAME, OS_USERNAME, OS_PASSWORD,
# OS_REGION_NAME=fs1, OS_IDENTITY_API_VERSION=3

2. The openstack CLI

openstack CLI
pip install python-openstackclient

source unio-openrc.sh
openstack flavor list
openstack image list
openstack keypair create --public-key ~/.ssh/id_ed25519.pub laptop

openstack server create my-vm \
  --flavor u33 --image debian-13 --key-name laptop \
  --network default-net --wait

openstack server list
openstack console url show my-vm      # browser console
openstack server delete my-vm

3. Terraform

The community OpenStack provider covers servers, volumes, networks, floating IPs and security groups.

main.tf
terraform {
  required_providers {
    openstack = {
      source  = "terraform-provider-openstack/openstack"
      version = "~> 3.0"
    }
  }
}

provider "openstack" {
  auth_url    = "https://api.fs1.uniocloud.eu:5000/v3"   # OS_AUTH_URL from openrc
  region      = "fs1"
  tenant_name = var.project_name
  user_name   = var.username
  password    = var.password
}

resource "openstack_compute_instance_v2" "web" {
  name            = "web-1"
  flavor_name     = "u33"
  image_name      = "debian-13"
  key_pair        = "laptop"
  security_groups = ["default"]

  network { name = "default-net" }
}

resource "openstack_blockstorage_volume_v3" "data" {
  name = "web-data"
  size = 50
}

resource "openstack_compute_volume_attach_v2" "attach" {
  instance_id = openstack_compute_instance_v2.web.id
  volume_id   = openstack_blockstorage_volume_v3.data.id
}

4. Python SDK

openstacksdk
pip install openstacksdk

import openstack
conn = openstack.connect(cloud="unio")   # reads clouds.yaml, or use the env from openrc

server = conn.create_server(
    name="worker-1",
    image="debian-13",
    flavor="u23",
    key_name="laptop",
    network="default-net",
    wait=True,
)
print(server.name, server.addresses)

5. Object storage

Buckets use the S3 API with separate credentials. See the object storage quickstart for aws CLI, boto3, rclone and Terraform examples.

Good to know