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

any hints?


https://github.com/oVirt/terraform-provider-ovirt/blob/master/ovirt/resource_ovirt_vm.go#L967
my experience with Go is not enough to understand how is "pairing" done

Marek
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/QGO5KAF5XZOY3KVNCJWIQ7XMCUJWHJ7Z/

Reply via email to