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

vcd_vapp_vm with dualstack ip adress pool ipv4 and ipv6 #1100

Closed
riconem opened this issue Jul 31, 2023 · 10 comments · Fixed by #1292
Closed

vcd_vapp_vm with dualstack ip adress pool ipv4 and ipv6 #1100

riconem opened this issue Jul 31, 2023 · 10 comments · Fixed by #1292
Assignees

Comments

@riconem
Copy link

riconem commented Jul 31, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Creation of a vcd_vapp_vm with dualstack ip adress pools in the network section. Currently there are no options for that. You can create a vm with an ip adress pool but you can't choose if it's ipv4 or ipv6 like in the GUI. It's some kind of random behaviour.

resource "vcd_vapp_vm" "web2" {
  vapp_name        = vcd_vapp.web.name
  name             = "web2"
  vapp_template_id = data.vcd_catalog_vapp_template.linux.id
  memory           = 2048
  cpus             = 1

  network {
    type               = "org"
    name               = "net"
    ip_allocation_mode = "POOL"
    adapter_type       = "VMXNET3"
  }
}

When the code is applied and you have a dualstack network with ipv4 and ipv6. It happens that there are a ipv6 ip adress on an ip4 adress pool. It also doesn't add the other ipv4 adress to the pool.

image

Inside the GUI you can choose a pool for ipv4 and ipv6. So it should look like the following.

image

New or Affected Resource(s)

  • vcd_vapp_vm
  • vcd_vm
  • vcd_vapp
@riconem
Copy link
Author

riconem commented Aug 4, 2023

I also tried to implement it, but I am struggeling with it and documented in this issue. Does someone know how to fix the xml error? I am assume that I am using the wrong schemas.

terraform-provider-vcd
go-vcloud-director

@OnnO14
Copy link

OnnO14 commented Mar 14, 2024

Is this issue still being tracked and is it planned already?

@nxcc
Copy link

nxcc commented Jun 21, 2024

hi @riconem, just found out how to fix the xml. Looks like order of elements in NetworkConnection is important. You have to move SecondaryIpAddress just below IPAddress, and SecondaryIpAddressAllocationMode below IPAddressAllocationMode in the struct. This also changes the order in the XML. Just tied it out and it works for me.

@riconem
Copy link
Author

riconem commented Jun 24, 2024

Thank you @nxcc. I will try.

@danielmasur
Copy link

Thank you @nxcc. I will try.

@riconem Have you had a chance to test this? My couple first tests looked promising.

@Didainius
Copy link
Collaborator

Hello,
Just to let you know - we see this is a demanded feature and we're working on it. I am progressing on testing it and looking for possible side effects now as VM operations are quite tricky and based on XML which often gives surprises.

@Didainius
Copy link
Collaborator

Hello,
I have gone through testing and would like to ask if any of the interested parties could test. Field names are such (they match the approach that we have in Org VDC networks (e.g. https://registry.terraform.io/providers/vmware/vcd/latest/docs/resources/network_routed_v2#secondary_gateway)

image

@riconem
Copy link
Author

riconem commented Jul 11, 2024

Thank you. I will test it. Could you also provide your go-vcloud-director version? I couldn't find it.

@Didainius
Copy link
Collaborator

Thank you. I will test it. Could you also provide your go-vcloud-director version? I couldn't find it.

Thanks. It is here - vmware/go-vcloud-director#694 (this PR for Terraform also uses it)

@riconem
Copy link
Author

riconem commented Jul 11, 2024

It worked on my module 🚀 Thank you

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment