Skip to content

Commit

Permalink
Add IPv6 support (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
frousselet committed May 23, 2022
1 parent 105bc94 commit 80a3e5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions opennebula/resource_opennebula_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,8 @@ func flattenNICComputed(nic shared.NIC) map[string]interface{} {
ip, _ := nic.Get(shared.IP)
mac, _ := nic.Get(shared.MAC)
physicalDevice, _ := nic.GetStr("PHYDEV")
ip6_global, _ := nic.GetStr("IP6_GLOBAL")
ip6_link, _ := nic.GetStr("IP6_LINK")
ip6Global, _ := nic.GetStr("IP6_GLOBAL")
ip6Link, _ := nic.GetStr("IP6_LINK")
network, _ := nic.Get(shared.Network)

model, _ := nic.Get(shared.Model)
Expand All @@ -674,8 +674,8 @@ func flattenNICComputed(nic shared.NIC) map[string]interface{} {
"nic_id": nicID,
"network": network,
"computed_ip": ip,
"computed_ip6_global": ip6_global,
"computed_ip6_link": ip6_link,
"computed_ip6_global": ip6Global,
"computed_ip6_link": ip6Link,
"computed_mac": mac,
"computed_physical_device": physicalDevice,
"computed_model": model,
Expand Down Expand Up @@ -1388,6 +1388,8 @@ func updateNIC(d *schema.ResourceData, meta interface{}) error {
},
"network_id",
"ip",
"ip6_global",
"ip6_link",
"mac",
"security_groups",
"model",
Expand Down
2 changes: 2 additions & 0 deletions opennebula/resource_opennebula_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,8 @@ resource "opennebula_virtual_machine" "test" {
nic {
network_id = opennebula_virtual_network.network1.id
ip = "172.16.100.131"
ip6_global = "2001:db8:0:1::1"
ip6_link = "fe80::1"
}
timeout = 5
Expand Down

0 comments on commit 80a3e5e

Please sign in to comment.