Skip to content

Commit

Permalink
Feat/1.9.4 (#645)
Browse files Browse the repository at this point in the history
Co-authored-by: Frederic M <[email protected]>
Co-authored-by: ArtemProt <[email protected]>
Co-authored-by: Abhishekism9450 <[email protected]>
  • Loading branch information
4 people authored Oct 27, 2023
1 parent 0441a6e commit 1dfdba3
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 17 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## 1.9.4 (October 27, 2023)
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/feat/1.9.3...feat/1.9.4)

- Feat branch. [\#645](https://github.com/nutanix/terraform-provider-nutanix/pull/645)

**Merged pull request:**
- Change VM name should not require VM PowerOFF. [\#626](https://github.com/nutanix/terraform-provider-nutanix/pull/626)
- Fix: compare bootconfig against previous value. [\#641](https://github.com/nutanix/terraform-provider-nutanix/pull/641)

**Implemented enhancements:**
- Added example to use metadata in nutanix subnets. [\#643](https://github.com/nutanix/terraform-provider-nutanix/pull/643)
- External subnet name/uuid are Optional args not Required. [\#644](https://github.com/nutanix/terraform-provider-nutanix/pull/644)

**Fixed bugs:**
- VM rebooted at every change because of hotPlugChange set to false. [\#640](https://github.com/nutanix/terraform-provider-nutanix/issues/640)
- Changing the VM name forces a reboot. [\#625](https://github.com/nutanix/terraform-provider-nutanix/issues/625)

**Closed issues:**
- Modify Terraform documentation for nutanix_vpc resource. [\#636](https://github.com/nutanix/terraform-provider-nutanix/issues/636)
- Include metadata example for data.nutanix_subnets. [\#590](https://github.com/nutanix/terraform-provider-nutanix/issues/590)


## 1.9.3 (September 7, 2023)
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/feat/1.9.2...feat/1.9.3)

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Terraform provider plugin to integrate with Nutanix Enterprise Cloud

NOTE: The latest version of the Nutanix provider is [v1.9.3](https://github.com/nutanix/terraform-provider-nutanix/releases/tag/v1.9.3)
NOTE: The latest version of the Nutanix provider is [v1.9.4](https://github.com/nutanix/terraform-provider-nutanix/releases/tag/v1.9.4)

Modules based on Terraform Nutanix Provider can be found here : [Modules](https://github.com/nutanix/terraform-provider-nutanix/tree/master/modules)
## Build, Quality Status
Expand Down Expand Up @@ -52,6 +52,8 @@ The Terraform Nutanix provider is designed to work with Nutanix Prism Central an
> For the 1.9.0 release of the provider it will have N-1 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc2022.9 and pc2023.1.0.1.
> For the 1.9.4 release of the provider it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc2023.3, pc2023.1.0.2 and pc2023.1.0.1.
### note
With v1.6.1 release of flow networking feature in provider, IAMv2 setups would be mandate.
Also, there is known issue for access_control_policies resource where update would be failing. We are continuously tracking the issue internally.
Expand Down
2 changes: 2 additions & 0 deletions nutanix/resource_nutanix_access_control_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
const resourceAccessPolicy = "nutanix_access_control_policy.test"

func TestAccNutanixAccessControlPolicy_basic(t *testing.T) {
t.Skip() // https://jira.nutanix.com/browse/ENG-483192
name := acctest.RandomWithPrefix("accest-access-policy")
roleName := acctest.RandomWithPrefix("test-acc-role")
description := "Description of my access control policy"
Expand Down Expand Up @@ -88,6 +89,7 @@ func TestAccNutanixAccessControlPolicy_WithUser(t *testing.T) {
}

func TestAccNutanixAccessControlPolicy_WithCategory(t *testing.T) {
t.Skip() //https://jira.nutanix.com/browse/ENG-483192
name := acctest.RandomWithPrefix("accest-access-policy")
roleName := acctest.RandomWithPrefix("test-acc-role-")
description := "Description of my access control policy"
Expand Down
24 changes: 14 additions & 10 deletions nutanix/resource_nutanix_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ func resourceNutanixVirtualMachineUpdate(ctx context.Context, d *schema.Resource
if d.HasChange("name") {
_, n := d.GetChange("name")
spec.Name = utils.StringPtr(n.(string))
hotPlugChange = false
}

spec.Description = response.Status.Description
Expand Down Expand Up @@ -1177,8 +1176,12 @@ func resourceNutanixVirtualMachineUpdate(ctx context.Context, d *schema.Resource
}

res.PowerStateMechanism = pw
if bc, change := bootConfigHasChange(res.BootConfig, d); !reflect.DeepEqual(*bc, v3.VMBootConfig{}) {
res.BootConfig = bc
currentBootConfig := &v3.VMBootConfig{}
if res.BootConfig != nil {
*currentBootConfig = *res.BootConfig
}
if newBootConfig, change := bootConfigHasChange(currentBootConfig, d); !reflect.DeepEqual(*newBootConfig, *currentBootConfig) {
res.BootConfig = newBootConfig
hotPlugChange = change
}

Expand Down Expand Up @@ -1251,19 +1254,20 @@ func getVMSpecVersion(conn *v3.Client, vmID string) (*int64, error) {
func bootConfigHasChange(boot *v3.VMBootConfig, d *schema.ResourceData) (*v3.VMBootConfig, bool) {
hotPlugChange := false

if boot == nil {
boot = &v3.VMBootConfig{}
bootConfig := &v3.VMBootConfig{}
if boot != nil {
*bootConfig = *boot
}

if d.HasChange("boot_device_order_list") {
_, n := d.GetChange("boot_device_order_list")
boot.BootDeviceOrderList = expandStringList(n.([]interface{}))
bootConfig.BootDeviceOrderList = expandStringList(n.([]interface{}))
hotPlugChange = false
}

if d.HasChange("boot_type") {
_, n := d.GetChange("boot_type")
boot.BootType = utils.StringPtr(n.(string))
bootConfig.BootType = utils.StringPtr(n.(string))
hotPlugChange = false
}

Expand All @@ -1284,13 +1288,13 @@ func bootConfigHasChange(boot *v3.VMBootConfig, d *schema.ResourceData) (*v3.VMB
bd.MacAddress = utils.StringPtr(n.(string))
hotPlugChange = false
}
boot.BootDevice = bd
bootConfig.BootDevice = bd

if dska.AdapterType == nil && dska.DeviceIndex == nil && bd.MacAddress == nil {
boot.BootDevice = nil
bootConfig.BootDevice = nil
}

return boot, hotPlugChange
return bootConfig, hotPlugChange
}

func changePowerState(ctx context.Context, conn *v3.Client, id string, powerState string) error {
Expand Down
4 changes: 2 additions & 2 deletions nutanix/resource_nutanix_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ func TestAccNutanixVirtualMachine_SecureBoot(t *testing.T) {
desc := "this is vm desc"
updatedName := fmt.Sprintf("test-vm-%d-updated", r)
updatedDesc := "this is updated desc"
memory := "200"
updatedMem := "300"
memory := "1024"
updatedMem := "2048"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Expand Down
6 changes: 6 additions & 0 deletions website/docs/d/subnets.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Describes a list of subnets

```hcl
data "nutanix_subnets" "subnets" {}
data "nutanix_subnets" "test" {
metadata {
filter = "name==vlan0_test_2"
}
}
```

## Attribute Reference
Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/vpc.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ resource "nutanix_vpc" "vpc" {
The following arguments are supported:

* `name` - (Required) The name for the VPC.
* `external_subnet_reference_uuid` - (Required) List of external subnets uuid attached to this VPC. Should not be used with external_subnet_reference_name.
* `external_subnet_reference_name` - (Required) List of external subnets name attached to this VPC. Should not be used with external_subnet_reference_uuid.
* `externally_routable_prefix_list` - (Optional) List Externally Routable IP Addresses. Required when external subnet with NoNAT is used.
* `common_domain_name_server_ip_list` - (Optional) List of domain name server IPs.
* `external_subnet_reference_uuid` - (Optional) List of external subnets uuid attached to this VPC. Should not be used with external_subnet_reference_name.
* `external_subnet_reference_name` - (Optional) List of external subnets name attached to this VPC. Should not be used with external_subnet_reference_uuid.
* `externally_routable_prefix_list` - (Optional) List Externally Routable IP Addresses. Required when external subnet with NoNAT is used.
* `common_domain_name_server_ip_list` - (Optional) List of domain name server IPs.

## externally_routable_prefix_list
Externally Routable IP Addresses
Expand Down

0 comments on commit 1dfdba3

Please sign in to comment.