Skip to content

Commit 1dfdba3

Browse files
abhimutantfad3tArtemProtAbhishekism9450
authored
Feat/1.9.4 (#645)
Co-authored-by: Frederic M <[email protected]> Co-authored-by: ArtemProt <[email protected]> Co-authored-by: Abhishekism9450 <[email protected]>
1 parent 0441a6e commit 1dfdba3

7 files changed

+53
-17
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
## 1.9.4 (October 27, 2023)
2+
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/feat/1.9.3...feat/1.9.4)
3+
4+
- Feat branch. [\#645](https://github.com/nutanix/terraform-provider-nutanix/pull/645)
5+
6+
**Merged pull request:**
7+
- Change VM name should not require VM PowerOFF. [\#626](https://github.com/nutanix/terraform-provider-nutanix/pull/626)
8+
- Fix: compare bootconfig against previous value. [\#641](https://github.com/nutanix/terraform-provider-nutanix/pull/641)
9+
10+
**Implemented enhancements:**
11+
- Added example to use metadata in nutanix subnets. [\#643](https://github.com/nutanix/terraform-provider-nutanix/pull/643)
12+
- External subnet name/uuid are Optional args not Required. [\#644](https://github.com/nutanix/terraform-provider-nutanix/pull/644)
13+
14+
**Fixed bugs:**
15+
- VM rebooted at every change because of hotPlugChange set to false. [\#640](https://github.com/nutanix/terraform-provider-nutanix/issues/640)
16+
- Changing the VM name forces a reboot. [\#625](https://github.com/nutanix/terraform-provider-nutanix/issues/625)
17+
18+
**Closed issues:**
19+
- Modify Terraform documentation for nutanix_vpc resource. [\#636](https://github.com/nutanix/terraform-provider-nutanix/issues/636)
20+
- Include metadata example for data.nutanix_subnets. [\#590](https://github.com/nutanix/terraform-provider-nutanix/issues/590)
21+
22+
123
## 1.9.3 (September 7, 2023)
224
[Full Changelog](https://github.com/nutanix/terraform-provider-nutanix/compare/feat/1.9.2...feat/1.9.3)
325

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Terraform provider plugin to integrate with Nutanix Enterprise Cloud
44

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

77
Modules based on Terraform Nutanix Provider can be found here : [Modules](https://github.com/nutanix/terraform-provider-nutanix/tree/master/modules)
88
## Build, Quality Status
@@ -52,6 +52,8 @@ The Terraform Nutanix provider is designed to work with Nutanix Prism Central an
5252
5353
> 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.
5454
55+
> 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.
56+
5557
### note
5658
With v1.6.1 release of flow networking feature in provider, IAMv2 setups would be mandate.
5759
Also, there is known issue for access_control_policies resource where update would be failing. We are continuously tracking the issue internally.

nutanix/resource_nutanix_access_control_policy_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
const resourceAccessPolicy = "nutanix_access_control_policy.test"
1515

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

9091
func TestAccNutanixAccessControlPolicy_WithCategory(t *testing.T) {
92+
t.Skip() //https://jira.nutanix.com/browse/ENG-483192
9193
name := acctest.RandomWithPrefix("accest-access-policy")
9294
roleName := acctest.RandomWithPrefix("test-acc-role-")
9395
description := "Description of my access control policy"

nutanix/resource_nutanix_virtual_machine.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,6 @@ func resourceNutanixVirtualMachineUpdate(ctx context.Context, d *schema.Resource
965965
if d.HasChange("name") {
966966
_, n := d.GetChange("name")
967967
spec.Name = utils.StringPtr(n.(string))
968-
hotPlugChange = false
969968
}
970969

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

11791178
res.PowerStateMechanism = pw
1180-
if bc, change := bootConfigHasChange(res.BootConfig, d); !reflect.DeepEqual(*bc, v3.VMBootConfig{}) {
1181-
res.BootConfig = bc
1179+
currentBootConfig := &v3.VMBootConfig{}
1180+
if res.BootConfig != nil {
1181+
*currentBootConfig = *res.BootConfig
1182+
}
1183+
if newBootConfig, change := bootConfigHasChange(currentBootConfig, d); !reflect.DeepEqual(*newBootConfig, *currentBootConfig) {
1184+
res.BootConfig = newBootConfig
11821185
hotPlugChange = change
11831186
}
11841187

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

1254-
if boot == nil {
1255-
boot = &v3.VMBootConfig{}
1257+
bootConfig := &v3.VMBootConfig{}
1258+
if boot != nil {
1259+
*bootConfig = *boot
12561260
}
12571261

12581262
if d.HasChange("boot_device_order_list") {
12591263
_, n := d.GetChange("boot_device_order_list")
1260-
boot.BootDeviceOrderList = expandStringList(n.([]interface{}))
1264+
bootConfig.BootDeviceOrderList = expandStringList(n.([]interface{}))
12611265
hotPlugChange = false
12621266
}
12631267

12641268
if d.HasChange("boot_type") {
12651269
_, n := d.GetChange("boot_type")
1266-
boot.BootType = utils.StringPtr(n.(string))
1270+
bootConfig.BootType = utils.StringPtr(n.(string))
12671271
hotPlugChange = false
12681272
}
12691273

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

12891293
if dska.AdapterType == nil && dska.DeviceIndex == nil && bd.MacAddress == nil {
1290-
boot.BootDevice = nil
1294+
bootConfig.BootDevice = nil
12911295
}
12921296

1293-
return boot, hotPlugChange
1297+
return bootConfig, hotPlugChange
12941298
}
12951299

12961300
func changePowerState(ctx context.Context, conn *v3.Client, id string, powerState string) error {

nutanix/resource_nutanix_virtual_machine_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ func TestAccNutanixVirtualMachine_SecureBoot(t *testing.T) {
571571
desc := "this is vm desc"
572572
updatedName := fmt.Sprintf("test-vm-%d-updated", r)
573573
updatedDesc := "this is updated desc"
574-
memory := "200"
575-
updatedMem := "300"
574+
memory := "1024"
575+
updatedMem := "2048"
576576
resource.Test(t, resource.TestCase{
577577
PreCheck: func() { testAccPreCheck(t) },
578578
Providers: testAccProviders,

website/docs/d/subnets.html.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ Describes a list of subnets
1414

1515
```hcl
1616
data "nutanix_subnets" "subnets" {}
17+
18+
data "nutanix_subnets" "test" {
19+
metadata {
20+
filter = "name==vlan0_test_2"
21+
}
22+
}
1723
```
1824

1925
## Attribute Reference

website/docs/r/vpc.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ resource "nutanix_vpc" "vpc" {
6767
The following arguments are supported:
6868

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

7575
## externally_routable_prefix_list
7676
Externally Routable IP Addresses

0 commit comments

Comments
 (0)