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

multiple nics creation problem #217

Open
cervajs opened this issue Jul 21, 2020 · 4 comments
Open

multiple nics creation problem #217

cervajs opened this issue Jul 21, 2020 · 4 comments

Comments

@cervajs
Copy link

cervajs commented Jul 21, 2020

i have problem with creation VM with multiple nics

part of terraform config

resource "ovirt_vm" "vm" {
....
  initialization {
    authorized_ssh_key = "${var.vm_authorized_ssh_key}"
    host_name          = "${var.vm_hostname}"
    timezone           = "${var.vm_timezone}"
    user_name          = "${var.vm_user_name}"
    custom_script      = "${var.vm_custom_script}"
    dns_search         = "${var.vm_dns_search}"
    dns_servers        = "${var.vm_dns_servers}"

    nic_configuration {
      label              = "eth0"
      boot_proto         = "${var.vm_nic_boot_proto}"
      address            = "${var.vm_nic_ip_address}"
      gateway            = "${var.vm_nic_gateway}"
      netmask            = "${var.vm_nic_netmask}"
      on_boot            = "${var.vm_nic_on_boot}"
    }

    nic_configuration {
      label              = "eth1"
      boot_proto         = "${var.vm_nic2_boot_proto}"
      address            = "${var.vm_nic2_ip_address}"
      gateway            = "${var.vm_nic2_gateway}"
      netmask            = "${var.vm_nic2_netmask}"
      on_boot            = "${var.vm_nic2_on_boot}"
    }
  }
}

resource "ovirt_vnic" "eth0" {
  name            = "eth0"
  vm_id           = "${ovirt_vm.vm.id}"
  vnic_profile_id = "${data.ovirt_vnic_profiles.nic1.vnic_profiles.0.id}"
}

resource "ovirt_vnic" "eth1" {
  name            = "eth1"
  vm_id           = "${ovirt_vm.vm.id}"
  vnic_profile_id = "${data.ovirt_vnic_profiles.nic2.vnic_profiles.0.id}"
}

how terraform knows which nic_configuration {} from ovirt_vm belongs to
which resource "ovirt_vnic"?

my problem is that VM has paired nic_configuration(eth0) with resource
"ovirt_vnic" "eth1" and vice versa

@emesika
Copy link
Member

emesika commented Mar 3, 2021

Sorry for the delay, we are doing a cleanup on all issues in order to be more responsive, is this issue still relevant or we can delete it ?

@cervajs
Copy link
Author

cervajs commented Jul 16, 2021

its still relevant

@cervajs
Copy link
Author

cervajs commented Sep 6, 2021

additional info
its random with the same configuration
like
first run(terraform apply): eth0 (label eth1), eth1 (label eth0). destroy
second run: eth0 (label eth1), eth1 (label eth0). destroy
third run: eth0 (label eth0), eth1 (label eth1). CORRECT

@ghost
Copy link

ghost commented Sep 6, 2021

Hey @cervajs sorry for the delay, we have a backlog of issues to work through and we need to test each PR manually. We are working on introducing an automated solution, but it takes longer than expected as we need to retool the CI and introduce a mocking setup too. @emesika could you run your test suite on this please?

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

2 participants