Terraform for Openstack

Hello everybody!

I’m trying to use Terraform in order to create some compute instances on Openstack.

The problem comes when i try to Terraform apply.

In fact, the message right here appear :

openstack_compute_instance_v2.main: Error creating OpenStack server: Expected HTTP response code when accessing [POST https://compute.uk1.cloud.ovh.net/v2.1/project_id/servers], but got 406 instead
{“computeFault”: {“message”: “Version 2.52 is not supported by the API. Minimum is 2.1 and maximum is 2.38.”, “code”: 406}}

How can i fix this problem ?

Here is my code :

resource “openstack_compute_instance_v2” “main” {
name = “main-tttt”
image_name = “Debian 10”
flavor_name = “{var.main_host_type[var.sizing]}" region = "{var.region_zone}”
tags = [“some tags”,“somettag”]
network {
name = “my_network”
resource “openstack_blockstorage_volume_v2” “main” {
name = “main-tttt”
size = “200”
region = “${var.region_zone}”

The problem doesn’t appear when i delete “tags = [“some tags”,“somettag”]”.

Thank you for your time!

You’re using OVH? There is a dedicated provider for OVH what I can see, maybe because they’re doing their own versions of APIs

Otherwise maybe you need to use an older version of the OpenStack provider, the changelog should contain information about when API versions were changed.

Hello, thanks for your answer.

Indeed, I’m using OVH but it looks like OVH is hosting openstack for the provisionning as we can see on this page : https://docs.ovh.com/fr/public-cloud/utiliser-terraform/

Moreover, i tried to use an older version of Openstack however there is a problem :
“Invalid or unknown tags”

Ce tutorial a été fait avec la version suivante : Terraform v0.9.11

Ca fait longtemps, ca!

I would advice you to talk to OVH support regarding which versions of Terraform and the OpenStack provider you should use.

I found the solution !

By default when i have installed pythonclient-openstack, i had openstack Newton 3.2.1 ( deprecated) on https://releases.openstack.org/

I took rocky version and now i can tags my VM .

Thank you for your help !