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

Partial failure of OVN network creation not reflected in Terraform state #517

Open
jsimpso opened this issue Aug 22, 2024 · 0 comments
Open

Comments

@jsimpso
Copy link
Contributor

jsimpso commented Aug 22, 2024

Hi,

I'm testing with a version of the provider built from current source, and believe I've hit a bug when creating an OVN network.

Apologies I haven't got a minimal reproducer at this point, recording initial information here where it can be iterated on.

The resource declaration:

resource "lxd_network" "service_network" {
  remote  = var.lxd_remote
  name    = var.name
  type    = "ovn"
  project = lxd_project.service_project.name
  config = {
    network = var.ovn_uplink_network
  }
}

The output I got on initial run:

│ Error: Failed to create network "test-microk8s-microcloud-tel"
│ 
│   with module.prod-microk8s-microcloud-tel.module.machine_model.module.lxd_service.lxd_network.service_network,
│   on .terraform/modules/prod-microk8s-microcloud-tel/microcloud/lxd_service/main.tf line 20, in resource "lxd_network" "service_network":20: resource "lxd_network" "service_network" {
│ 
│ failed to notify peer 10.102.200.16:8443: Failed getting port group UUID for network "test-microk8s-microcloud-tel" setup: Failed to run: ovn-nbctl --timeout=10 --db
│ ssl:10.102.200.11:6641,ssl:10.102.200.14:6641,ssl:10.102.200.13:6641 -c /proc/self/fd/3 -p /proc/self/fd/4 -C /proc/self/fd/5 --wait=sb --format=csv --no-headings --data=bare --colum=_uuid,name,acl find
│ port_group name=lxd_net40: exit status 1 (ovn-nbctl: ssl:10.102.200.11:6641,ssl:10.102.200.14:6641,ssl:10.102.200.13:6641: database connection failed ())
╵

The output I got from a second run:

│ Error: Failed to create network "test-microk8s-microcloud-tel"
│ 
│   with module.prod-microk8s-microcloud-tel.module.machine_model.module.lxd_service.lxd_network.service_network,
│   on .terraform/modules/prod-microk8s-microcloud-tel/microcloud/lxd_service/main.tf line 20, in resource "lxd_network" "service_network":20: resource "lxd_network" "service_network" {
│ 
│ Failed creating pending network for member "tel-mc1": Network is not in pending state

In this case the network was created (though in an ERRORED state):

+------------------------------+------+---------+---------------+---------------------------+-------------+---------+---------+
|             NAME             | TYPE | MANAGED |     IPV4      |           IPV6            | DESCRIPTION | USED BY |  STATE  |
+------------------------------+------+---------+---------------+---------------------------+-------------+---------+---------+
| test-microk8s-microcloud-tel | ovn  | YES     | 10.34.38.1/24 | fd42:3699:7472:9563::1/64 |             | 0       | ERRORED |
+------------------------------+------+---------+---------------+---------------------------+-------------+---------+---------+

Could this error on resource creation instead result in a tainted object being committed to state so that Terraform attempts re-creation on the next run?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant