-
Notifications
You must be signed in to change notification settings - Fork 359
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
[db/v1/instance]: add availability_zone field #1643
[db/v1/instance]: add availability_zone field #1643
Conversation
- commit: 51831d9ee643451480c4f36522d5c11b2944ad11
@EugenMayer Hi, Could you help me with reviewing this PR? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change requested on the test.
We currently do not have Trove/DBaaS CI tests. were you able to run the test on your local env?
( the 2 CI tests currently failing are unrelated to your change)
Hi @nikParasyr ,
I will do that on Monday. |
@nikParasyr Hi, So I tested it with real openstack cluster, and resource was created. StepsI prebuilded $ make build
==> Checking that code complies with gofmt requirements...
go install
$ cp /go/bin/terraform-provider-openstack terraform.d/plugins/registry.terraform.io/terraform-provider-openstack/openstack/1.53.0-az/linux_amd64/terraform-provider-openstack_v1.53.0-az
$ tree terraform.d/
terraform.d/
└── plugins
└── registry.terraform.io
└── terraform-provider-openstack
└── openstack
└── 1.53.0-az
└── linux_amd64
└── terraform-provider-openstack_v1.53.0-az
6 directories, 1 file
$ ll
total 120
drwxr-xr-x 4 eugenezuev eugenezuev 4096 Jan 22 11:36 ./
drwxr-xr-x 8 eugenezuev eugenezuev 12288 Jan 18 16:41 ../
drwxr-xr-x 3 eugenezuev eugenezuev 4096 Jan 18 14:01 .terraform/
-rw-r--r-- 1 eugenezuev eugenezuev 312 Jan 22 11:21 .terraform.lock.hcl
-rw-r--r-- 1 eugenezuev eugenezuev 1994 Jan 18 16:35 CA-...-...-sandbox2-dev-openrc.sh
-rw-r--r-- 1 eugenezuev eugenezuev 892 Jan 18 13:57 clouds.yaml
-rw-r--r-- 1 eugenezuev eugenezuev 2935 Jan 18 16:50 configurations.tf
-rw-r--r-- 1 eugenezuev eugenezuev 1 Jan 19 20:07 databases.tf
-rw-r--r-- 1 eugenezuev eugenezuev 7280 Jan 22 11:34 main.tf
-rw-r--r-- 1 eugenezuev eugenezuev 1232 Jan 19 15:15 networks.tf
-rw-r--r-- 1 eugenezuev eugenezuev 8275 Jan 19 15:44 openstack-wl.sh
drwxr-xr-x 3 eugenezuev eugenezuev 4096 Jan 22 11:21 terraform.d/
-rw-r--r-- 1 eugenezuev eugenezuev 18197 Jan 22 11:36 terraform.tfstate
-rw-r--r-- 1 eugenezuev eugenezuev 16649 Jan 22 11:36 terraform.tfstate.backup
-rw-r--r-- 1 eugenezuev eugenezuev 211 Jan 22 11:15 versions.tf Then updated provider: # Define required providers
terraform {
required_version = ">= 0.14.0"
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "1.53.0-az"
}
}
} Then defined resource with az field: resource "openstack_db_instance_v1" "sandboxdev02_dbaas" {
region = "EU-Krakow-new"
name = "sandboxdev02-dbaas-0"
flavor_id = "43ae1fa4-....-....-....-67f276b8a56b"
configuration_id = openstack_db_configuration_v1.psql_15_3_C2R4.id
size = 8
network {
uuid = openstack_networking_network_v2.sandboxdev02_dbaas.id
}
datastore {
type = "postgresql"
version = "15.3"
}
availability_zone = "az1"
} And run apply command: $ terraform version
Terraform v1.6.2
on linux_amd64
+ provider registry.terraform.io/terraform-provider-openstack/openstack v1.53.0-az
Your version of Terraform is out of date! The latest version
is 1.7.0. You can update by downloading from https://www.terraform.io/downloads.html
$ terraform apply
openstack_db_configuration_v1.psql_15_3_C2R4: Refreshing state... [id=fb3fc45d-....-....-....-432b63500337]
data.openstack_compute_flavor_v2.c1r2: Reading...
openstack_networking_network_v2.sandboxdev02_dbaas: Refreshing state... [id=84a42ade-....-....-....-efc9a75d96de]
data.openstack_networking_network_v2.internal_ip_01: Reading...
data.openstack_compute_flavor_v2.c2r4: Reading...
openstack_db_configuration_v1.psql_15_3_C1R2: Refreshing state... [id=1befaaaf-....-....-....-b177ae15fbd7]
data.openstack_networking_network_v2.internal_ip_02: Reading...
data.openstack_compute_flavor_v2.c1r2: Read complete after 0s [id=296d45cf-....-....-....-ab3a5bc1a744]
data.openstack_compute_flavor_v2.c2r4: Read complete after 0s [id=fa74fdc2-....-....-....-3a4467ea7812]
openstack_networking_subnet_v2.sandboxdev02_dbaas: Refreshing state... [id=9f48b0fd-....-....-....-1890775544a4]
data.openstack_networking_network_v2.internal_ip_02: Read complete after 2s [id=2b56e154-....-....-....-1ef768f5adbb]
openstack_networking_router_v2.sandboxdev02_dbaas: Refreshing state... [id=c8882a3e-....-....-....-de249225a08f]
openstack_networking_router_interface_v2.router_interface_1: Refreshing state... [id=7ffa93da-....-....-....-c049bc047e6d]
data.openstack_networking_network_v2.internal_ip_01: Still reading... [10s elapsed]
data.openstack_networking_network_v2.internal_ip_01: Still reading... [20s elapsed]
data.openstack_networking_network_v2.internal_ip_01: Read complete after 22s [id=4530a10e-....-....-....-4576dee5ca98]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# openstack_db_instance_v1.sandboxdev02_dbaas will be created
+ resource "openstack_db_instance_v1" "sandboxdev02_dbaas" {
+ addresses = (known after apply)
+ availability_zone = "az1"
+ configuration_id = "fb3fc45d-....-....-....-432b63500337"
+ flavor_id = "43ae1fa4-....-....-....-67f276b8a56b"
+ id = (known after apply)
+ name = "sandboxdev02-dbaas-0"
+ region = "EU-Krakow-new"
+ size = 8
+ datastore {
+ type = "postgresql"
+ version = "15.3"
}
+ network {
+ uuid = "84a42ade-....-....-....-efc9a75d96de"
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
openstack_db_instance_v1.sandboxdev02_dbaas: Creating...
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [10s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [20s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [30s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [40s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [50s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [1m0s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [1m10s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [1m20s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Still creating... [1m30s elapsed]
openstack_db_instance_v1.sandboxdev02_dbaas: Creation complete after 1m35s [id=33112f8c-....-....-....-54129d97cff2]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for the quick responses and testing this. I hope to get a release in the next 1-2 weeks with this included
fec0e2e
into
terraform-provider-openstack:main
I have a quick question about testing pipelines for db/v1. |
I can't get trove to work properly in devstack => #1408. Initially it wasnt even installed properly, then i fixed that but i had any db instance creation would remain in error status. Then i tried again after some time and trove wasnt getting installed properly on devstack again. |
@zhekazuev just kicked the ci once again and now it fails ond evstack. seems like the trove image is too big => https://github.com/terraform-provider-openstack/terraform-provider-openstack/actions/runs/7610171381/job/20722954240?pr=1408 |
…ider-openstack#1643)" This reverts commit fec0e2e.
This reverts commit fec0e2e.
…ider-openstack#1643)" This reverts commit fec0e2e.
Changes
availability_zone
toopenstack/resource_openstack_db_instance_v1.go
availability_zone
toopenstack/resource_openstack_db_instance_v1_test.go
github.com/gophercloud/gophercloud
fromv1.8.0
tobackport-b1
versionv1.8.1-0.20240119210933-51831d9ee643
availability_zone
fieldIssue: #1644
Dependency update with
availability_zone
field: gophercloud/gophercloud#2875