diff --git a/CHANGELOG.md b/CHANGELOG.md index 6918b3c8e..df2a1480e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ ENHANCEMENTS: FEATURES: -* resources/opennebula_virtual_machine: Add 'on_disk_change' property to opennebula_virtual_machine +* resources/opennebula_virtual_machine: Add `on_disk_change`, `computed_ip6_global` and `computed_ip6_link` properties * **New Resource**: opennebula_group_admins DEPRECATION: diff --git a/opennebula/resource_opennebula_virtual_machine_test.go b/opennebula/resource_opennebula_virtual_machine_test.go index e439cac2e..bb053dcd7 100644 --- a/opennebula/resource_opennebula_virtual_machine_test.go +++ b/opennebula/resource_opennebula_virtual_machine_test.go @@ -51,6 +51,7 @@ func TestAccVirtualMachine(t *testing.T) { resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "gid"), resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "uname"), resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "gname"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "gid"), testAccCheckVirtualMachinePermissions(&shared.Permissions{ OwnerU: 1, OwnerM: 1, @@ -391,6 +392,8 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) { resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "name", "test-virtual_machine"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "1"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"), ), }, { @@ -400,6 +403,10 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) { resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "2"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.132"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"), ), }, { @@ -409,6 +416,10 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) { resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "2"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.111"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"), ), }, { @@ -418,6 +429,10 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) { resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "2"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.112"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"), ), }, { @@ -430,6 +445,14 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) { resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.132"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.2.computed_ip", "172.16.100.113"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.3.computed_ip", "172.16.100.133"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_link"), ), }, { @@ -442,6 +465,14 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) { resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.134"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.2.computed_ip", "172.16.100.113"), resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.3.computed_ip", "172.16.100.133"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_global"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_link"), + resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_link"), ), }, { diff --git a/website/docs/r/virtual_machine.html.markdown b/website/docs/r/virtual_machine.html.markdown index df29c68b7..e2cc6c626 100644 --- a/website/docs/r/virtual_machine.html.markdown +++ b/website/docs/r/virtual_machine.html.markdown @@ -176,6 +176,8 @@ The following attribute are exported: * `nic_id` - nic attachment identifier * `network` - network name * `computed_ip` - IP of the virtual machine on this network. +* `computed_ip6_global` - IPv6 of the virtual machine on this network. +* `computed_ip6_link` - Link Local IPv6 of the virtual machine on this network. * `computed_mac` - MAC of the virtual machine on this network. * `computed_model` - Nic model driver. * `computed_virtio_queues` - Virtio multi-queue size. @@ -195,6 +197,8 @@ The following attribute are exported: * `nic_id` - nic attachment identifier * `network` - network name * `computed_ip` - IP of the virtual machine on this network. +* `computed_ip6_global` - IPv6 of the virtual machine on this network. +* `computed_ip6_link` - Link Local IPv6 of the virtual machine on this network. * `computed_mac` - MAC of the virtual machine on this network. * `computed_model` - Nic model driver. * `computed_virtio_queues` - Virtio multi-queue size.