dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.61k stars 460 forks source link

Import of libvirt_network doesn't all parameters #982

Open dark-vex opened 2 years ago

dark-vex commented 2 years ago

System Information

Linux distribution

CentOS 7

Terraform version

Terraform v1.3.3
on darwin_amd64

Provider and libvirt versions

provider registry.terraform.io/dmacvicar/libvirt v0.7.0

Checklist

Description of Issue/Question

Setup

 ➜ cat provider.tf
terraform {
  required_providers {
    libvirt = {
      source  = "dmacvicar/libvirt"
      version = "0.7.0"
    }
  }
}

provider "libvirt" {
    uri = "qemu+ssh://tf@server/system?sshauth=privkey"
}

 ➜ cat network.tf
resource "libvirt_network" "default" {
 name = "default"
 mode = "nat"
}

resource "libvirt_network" "lan" {
 name = "lan"
}

Steps to Reproduce Issue

I'm trying to import an existing libvirt network with the command:

terraform import libvirt_network.default <uuid>

On terraform.tfstate state file, I see the resource being imported but it doesn't contain all the parameters. For example with the default network the parameter addresses is set to 0.0.0.0/0 instead of the current subnet:

Another example with a bridge net

scabala commented 3 months ago

This might be either Terraform or provider issue