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

fix: disk provisioning settings are not correctly applied #2028

Merged

Conversation

vasilsatanasov
Copy link
Contributor

@vasilsatanasov vasilsatanasov commented Oct 2, 2023

Description

Fixes #1028

  1. According to the issue eagerly_scrubbed and thin_provision are not applied correctly when set and the providers is throwing an error. It is normal for the VM disk to receive values different from the ones in the configuration - it depends entirely on the vSphere datastore backend. In such cases, the provider should not throw an error. See VMware KB 2145183.
  • Removed the validation regarding both fields so ignore_state fixes the deployment.
  1. In another comment of the issue it is stated that when VM is cloned with different values for eagerly_scrubbed and thin_provision from the ones of the original disk the values are not applied (tested on VMFS datastore).
  • initialy the provider stated that if there is no datastore explicitly set for the disk, no relocation changes will be sent to the api for this disk. This is changed to making a diff between the disk properties specified in HCL and the same on the exisiting disk on the source VM.

Added e2e test to cover both cases.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?
Output from acceptance testing.

vasila@vasila2VDJN terraform-provider-vsphere % make testacc TESTARGS='-run=TestAccResourceVSphereVirtualMachine*'
vasila@vasila2VDJN terraform-provider-vsphere % 
vasila@vasila2VDJN terraform-provider-vsphere % 
vasila@vasila2VDJN terraform-provider-vsphere % env| grep TF_VAR
TF_VAR_VSPHERE_ALLOW_UNVERIFIED_SSL=true
TF_VAR_VSPHERE_CLUSTER=VmGenericProvisioningTestbed_Cluster_NmLVb
TF_VAR_VSPHERE_DATACENTER=VmGenericProvisioningTestbed_DataCenter_RUUUl
TF_VAR_VSPHERE_ESXI1=10.78.176.98
TF_VAR_VSPHERE_ESXI2=10.78.180.206
TF_VAR_VSPHERE_ESXI3=10.78.179.175
TF_VAR_VSPHERE_ESXI4=10.78.181.65
TF_VAR_VSPHERE_NAS_HOST=10.161.153.253
TF_VAR_VSPHERE_NFS_DS_NAME=VmGenericProvisioningTestbed_NfsDatastore_eZdVz
TF_VAR_VSPHERE_NFS_DS_NAME2=VmGenericProvisioningTestbed_NfsDatastore_nsVwU
TF_VAR_VSPHERE_PASSWORD=KTIDqqRgFx_a+44f
TF_VAR_VSPHERE_PG_NAME=VM Network
TF_VAR_VSPHERE_RESOURCE_POOL=Rp-1
TF_VAR_VSPHERE_SERVER=sc2-rdops-vm06-dhcp-194-204.eng.vmware.com
TF_VAR_VSPHERE_TEMPLATE=vm_template_linux
TF_VAR_VSPHERE_USE_LINKED_CLONE=false
TF_VAR_VSPHERE_USER=Administrator@vsphere.local
vasila@vasila2VDJN terraform-provider-vsphere % make testacc TESTARGS='-run=TestAccResourceVSphereVirtualMachine*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccResourceVSphereVirtualMachine* -timeout 360m
?       github.com/hashicorp/terraform-provider-vsphere [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/administrationroles    [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/clustercomputeresource  [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/computeresource [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/contentlibrary  [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/customattribute [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/datacenter      [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/datastore       [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/dvportgroup     [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/envbrowse       [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/folder  [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/hostsystem      [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/network [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/nsx     [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/ovfdeploy       [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/provider        [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/resourcepool    [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/spbm    [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/storagepod      [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/structure       [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/testhelper      [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/utils   [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/vappcontainer   [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/virtualmachine  [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/vsanclient      [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/vsansystem      [no test files]
?       github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/vmworkflow     [no test files]
=== RUN   TestAccResourceVSphereVirtualMachine_migrateStateV3_fromV2
    resource_vsphere_virtual_machine_migrate_test.go:25: set TF_VAR_VSPHERE_VM_V1_PATH to run vsphere_virtual_machine state migration tests
--- SKIP: TestAccResourceVSphereVirtualMachine_migrateStateV3_fromV2 (0.00s)
=== RUN   TestAccResourceVSphereVirtualMachine_migrateStateV3FromV1
    resource_vsphere_virtual_machine_migrate_test.go:25: set TF_VAR_VSPHERE_VM_V1_PATH to run vsphere_virtual_machine state migration tests
--- SKIP: TestAccResourceVSphereVirtualMachine_migrateStateV3FromV1 (0.00s)
=== RUN   TestAccResourceVSphereVirtualMachine_migrateStateV2
    resource_vsphere_virtual_machine_migrate_test.go:25: set TF_VAR_VSPHERE_VM_V1_PATH to run vsphere_virtual_machine state migration tests
--- SKIP: TestAccResourceVSphereVirtualMachine_migrateStateV2 (0.00s)
=== RUN   TestAccResourceVSphereVirtualMachineSnapshot_basic
    resource_vsphere_virtual_machine_snapshot_test.go:57: set TF_VAR_VSPHERE_IPV4_ADDRESS to run vsphere_virtual_machine_snapshot acceptance tests
--- SKIP: TestAccResourceVSphereVirtualMachineSnapshot_basic (41.69s)
=== RUN   TestAccResourceVSphereVirtualMachine_basic
--- PASS: TestAccResourceVSphereVirtualMachine_basic (109.60s)
=== RUN   TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionBare
--- PASS: TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionBare (98.72s)
=== RUN   TestAccResourceVSphereVirtualMachine_hardwareVersionUpgrade
--- PASS: TestAccResourceVSphereVirtualMachine_hardwareVersionUpgrade (155.15s)
=== RUN   TestAccResourceVSphereVirtualMachine_hardwareVersionInvalidVersion
--- PASS: TestAccResourceVSphereVirtualMachine_hardwareVersionInvalidVersion (40.25s)
=== RUN   TestAccResourceVSphereVirtualMachine_hardwareVersionDowngrade
--- PASS: TestAccResourceVSphereVirtualMachine_hardwareVersionDowngrade (107.86s)
=== RUN   TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionClone
--- PASS: TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionClone (109.97s)
=== RUN   TestAccResourceVSphereVirtualMachineContentLibrary_basic
    resource_vsphere_virtual_machine_test.go:202: Step 1/1 error: Error running apply: exit status 1
        
        Error: error powering on virtual machine: powerOn task for vm "/VmGenericProvisioningTestbed_DataCenter_RUUUl/vm/testacc-test" failed: Module DevicePowerOn power on failed. 
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 69, in resource "vsphere_virtual_machine" "vm":
          69: resource "vsphere_virtual_machine" "vm" {
        
    testing_new.go:85: Error running post-test destroy, there may be dangling resources: resource "vm" has no UUID
--- FAIL: TestAccResourceVSphereVirtualMachineContentLibrary_basic (128.78s)
=== RUN   TestAccResourceVSphereVirtualMachine_ignoreValidationOnComputedValue
--- PASS: TestAccResourceVSphereVirtualMachine_ignoreValidationOnComputedValue (64.96s)
=== RUN   TestAccResourceVSphereVirtualMachine_highLatencySensitivity
    resource_vsphere_virtual_machine_test.go:242: Step 1/1 error: Error running apply: exit status 1
        
        Error: error powering on virtual machine: powerOn task for vm "/VmGenericProvisioningTestbed_DataCenter_RUUUl/vm/testacc-test" failed: Insufficient capacity on each physical CPU.
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 57, in resource "vsphere_virtual_machine" "vm":
          57: resource "vsphere_virtual_machine" "vm" {
        
    testing_new.go:85: Error running post-test destroy, there may be dangling resources: resource "vm" has no UUID
--- FAIL: TestAccResourceVSphereVirtualMachine_highLatencySensitivity (72.77s)
=== RUN   TestAccResourceVSphereVirtualMachine_ESXiOnly
    helper_test.go:115: set TF_VAR_VSPHERE_TEST_ESXI to run ESXi-specific acceptance tests
--- SKIP: TestAccResourceVSphereVirtualMachine_ESXiOnly (40.44s)
=== RUN   TestAccResourceVSphereVirtualMachine_shutdownOK
--- PASS: TestAccResourceVSphereVirtualMachine_shutdownOK (129.44s)
=== RUN   TestAccResourceVSphereVirtualMachine_reCreateOnDeletion
--- PASS: TestAccResourceVSphereVirtualMachine_reCreateOnDeletion (151.37s)
=== RUN   TestAccResourceVSphereVirtualMachine_multiDevice
    resource_vsphere_virtual_machine_test.go:354: Step 1/1 error: Check failed: Check 2/2 error: expected network interface at index 1 to be true, got false
--- FAIL: TestAccResourceVSphereVirtualMachine_multiDevice (84.52s)
=== RUN   TestAccResourceVSphereVirtualMachine_addDevices
    resource_vsphere_virtual_machine_test.go:375: Step 2/2 error: Check failed: Check 2/2 error: expected network interface at index 1 to be true, got false
--- FAIL: TestAccResourceVSphereVirtualMachine_addDevices (138.91s)
=== RUN   TestAccResourceVSphereVirtualMachine_removeMiddleDevices
    resource_vsphere_virtual_machine_test.go:403: Step 1/2 error: Check failed: Check 3/3 error: expected network interface at index 1 to be true, got false
--- FAIL: TestAccResourceVSphereVirtualMachine_removeMiddleDevices (83.52s)
=== RUN   TestAccResourceVSphereVirtualMachine_removeMiddleDevicesChangeDiskUnit
    resource_vsphere_virtual_machine_test.go:442: Step 1/2 error: Check failed: Check 2/2 error: expected network interface at index 1 to be true, got false
--- FAIL: TestAccResourceVSphereVirtualMachine_removeMiddleDevicesChangeDiskUnit (84.24s)
=== RUN   TestAccResourceVSphereVirtualMachine_highDiskUnitNumbers
    resource_vsphere_virtual_machine_test.go:470: Step 1/1 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # vsphere_virtual_machine.vm will be updated in-place
          ~ resource "vsphere_virtual_machine" "vm" {
                id                                      = "4216271e-b46c-e14b-c0d8-7e7ad5202aa0"
                name                                    = "testacc-test"
                # (64 unchanged attributes hidden)
        
              ~ network_interface {
                  ~ bandwidth_share_level = "normal" -> "high"
                    # (9 unchanged attributes hidden)
                }
              ~ network_interface {
                  ~ bandwidth_share_level = "normal" -> "low"
                    # (9 unchanged attributes hidden)
                }
        
                # (7 unchanged blocks hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccResourceVSphereVirtualMachine_highDiskUnitNumbers (96.67s)
=== RUN   TestAccResourceVSphereVirtualMachine_highDiskUnitInsufficientBus
--- PASS: TestAccResourceVSphereVirtualMachine_highDiskUnitInsufficientBus (47.04s)
=== RUN   TestAccResourceVSphereVirtualMachine_highDiskUnitsToRegularSingleController
    resource_vsphere_virtual_machine_test.go:514: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # vsphere_virtual_machine.vm will be updated in-place
          ~ resource "vsphere_virtual_machine" "vm" {
                id                                      = "4216173f-d189-74db-2fb4-7332d7be8071"
                name                                    = "testacc-test"
                # (64 unchanged attributes hidden)
        
              ~ network_interface {
                  ~ bandwidth_share_level = "normal" -> "high"
                    # (9 unchanged attributes hidden)
                }
              ~ network_interface {
                  ~ bandwidth_share_level = "normal" -> "low"
                    # (9 unchanged attributes hidden)
                }
        
                # (7 unchanged blocks hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccResourceVSphereVirtualMachine_highDiskUnitsToRegularSingleController (100.16s)
=== RUN   TestAccResourceVSphereVirtualMachine_scsiBusSharing
--- PASS: TestAccResourceVSphereVirtualMachine_scsiBusSharing (140.03s)
=== RUN   TestAccResourceVSphereVirtualMachine_scsiBusSharingUpdate
--- PASS: TestAccResourceVSphereVirtualMachine_scsiBusSharingUpdate (196.87s)
=== RUN   TestAccResourceVSphereVirtualMachine_disksKeepOnRemove
--- PASS: TestAccResourceVSphereVirtualMachine_disksKeepOnRemove (155.06s)
=== RUN   TestAccResourceVSphereVirtualMachine_cdromClientMapping
--- PASS: TestAccResourceVSphereVirtualMachine_cdromClientMapping (100.06s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppIsoBasic
    resource_vsphere_virtual_machine_test.go:645: Step 1/1 error: Error running apply: exit status 1
        
        Error: error reconfiguring virtual machine: error in virtual machine configuration: this VM lacks a vApp configuration and cannot have vApp properties set on it
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 66, in resource "vsphere_virtual_machine" "vm":
          66: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_vAppIsoBasic (72.34s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppIsoNoVApp
--- PASS: TestAccResourceVSphereVirtualMachine_vAppIsoNoVApp (233.61s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppIsoNoCdrom
    resource_vsphere_virtual_machine_test.go:689: Step 1/2, expected an error with pattern, no match on: Error running apply: exit status 1
        
        Error: error reconfiguring virtual machine: error in virtual machine configuration: this VM lacks a vApp configuration and cannot have vApp properties set on it
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 66, in resource "vsphere_virtual_machine" "vm":
          66: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_vAppIsoNoCdrom (72.01s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppIsoConfigIsoIgnored
    resource_vsphere_virtual_machine_test.go:711: Step 1/2 error: Error running apply: exit status 1
        
        Error: error reconfiguring virtual machine: error in virtual machine configuration: this VM lacks a vApp configuration and cannot have vApp properties set on it
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 66, in resource "vsphere_virtual_machine" "vm":
          66: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_vAppIsoConfigIsoIgnored (75.07s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppIsoChangeCdromBacking
    resource_vsphere_virtual_machine_test.go:735: Step 1/2 error: Error running apply: exit status 1
        
        Error: error reconfiguring virtual machine: error in virtual machine configuration: this VM lacks a vApp configuration and cannot have vApp properties set on it
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 66, in resource "vsphere_virtual_machine" "vm":
          66: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_vAppIsoChangeCdromBacking (73.92s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppIsoPoweredOffCdromRead
    resource_vsphere_virtual_machine_test.go:764: Step 1/2 error: Error running apply: exit status 1
        
        Error: error reconfiguring virtual machine: error in virtual machine configuration: this VM lacks a vApp configuration and cannot have vApp properties set on it
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 66, in resource "vsphere_virtual_machine" "vm":
          66: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_vAppIsoPoweredOffCdromRead (72.95s)
=== RUN   TestAccResourceVSphereVirtualMachine_vvtdAndVbs
--- PASS: TestAccResourceVSphereVirtualMachine_vvtdAndVbs (58.79s)
=== RUN   TestAccResourceVSphereVirtualMachine_cdromNoParameters
--- PASS: TestAccResourceVSphereVirtualMachine_cdromNoParameters (116.42s)
=== RUN   TestAccResourceVSphereVirtualMachine_cdromIsoBacking
    resource_vsphere_virtual_machine_test.go:836: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: error fetching datastore: datastore 'nfs' not found
        
          with data.vsphere_datastore.iso_datastore,
          on terraform_plugin_test.tf line 65, in data "vsphere_datastore" "iso_datastore":
          65: data "vsphere_datastore" "iso_datastore" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cdromIsoBacking (46.47s)
=== RUN   TestAccResourceVSphereVirtualMachine_cdromConflictingParameters
    resource_vsphere_virtual_machine_test.go:855: Step 1/1, expected an error with pattern, no match on: Error running pre-apply refresh: exit status 1
        
        Error: error fetching datastore: datastore 'nfs' not found
        
          with data.vsphere_datastore.iso_datastore,
          on terraform_plugin_test.tf line 65, in data "vsphere_datastore" "iso_datastore":
          65: data "vsphere_datastore" "iso_datastore" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cdromConflictingParameters (45.61s)
=== RUN   TestAccResourceVSphereVirtualMachine_maximumNumberOfNICs
--- PASS: TestAccResourceVSphereVirtualMachine_maximumNumberOfNICs (108.86s)
=== RUN   TestAccResourceVSphereVirtualMachine_upgradeCPUAndRam
    resource_vsphere_virtual_machine_test.go:894: Step 2/2 error: Error running apply: exit status 1
        
        Error: error powering on virtual machine: powerOn task for vm "/VmGenericProvisioningTestbed_DataCenter_RUUUl/vm/testacc-test" failed: No host is compatible with the virtual machine.
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 57, in resource "vsphere_virtual_machine" "vm":
          57: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_upgradeCPUAndRam (128.71s)
=== RUN   TestAccResourceVSphereVirtualMachine_modifyAnnotation
--- PASS: TestAccResourceVSphereVirtualMachine_modifyAnnotation (154.35s)
=== RUN   TestAccResourceVSphereVirtualMachine_growDisk
--- PASS: TestAccResourceVSphereVirtualMachine_growDisk (153.76s)
=== RUN   TestAccResourceVSphereVirtualMachine_swapSCSIBus
--- PASS: TestAccResourceVSphereVirtualMachine_swapSCSIBus (159.47s)
=== RUN   TestAccResourceVSphereVirtualMachine_extraConfig
--- PASS: TestAccResourceVSphereVirtualMachine_extraConfig (154.97s)
=== RUN   TestAccResourceVSphereVirtualMachine_extraConfigSwapKeys
--- PASS: TestAccResourceVSphereVirtualMachine_extraConfigSwapKeys (156.12s)
=== RUN   TestAccResourceVSphereVirtualMachine_attachExistingVmdk
--- PASS: TestAccResourceVSphereVirtualMachine_attachExistingVmdk (110.09s)
=== RUN   TestAccResourceVSphereVirtualMachine_attachExistingVmdkTaint
--- PASS: TestAccResourceVSphereVirtualMachine_attachExistingVmdkTaint (177.24s)
=== RUN   TestAccResourceVSphereVirtualMachine_resourcePoolMove
--- PASS: TestAccResourceVSphereVirtualMachine_resourcePoolMove (155.29s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppContainerAndFolder
--- PASS: TestAccResourceVSphereVirtualMachine_vAppContainerAndFolder (67.12s)
=== RUN   TestAccResourceVSphereVirtualMachine_vAppContainerMove
--- PASS: TestAccResourceVSphereVirtualMachine_vAppContainerMove (202.58s)
=== RUN   TestAccResourceVSphereVirtualMachine_inFolder
--- PASS: TestAccResourceVSphereVirtualMachine_inFolder (103.38s)
=== RUN   TestAccResourceVSphereVirtualMachine_moveToFolder
--- PASS: TestAccResourceVSphereVirtualMachine_moveToFolder (148.52s)
=== RUN   TestAccResourceVSphereVirtualMachine_staticMAC
--- PASS: TestAccResourceVSphereVirtualMachine_staticMAC (100.48s)
=== RUN   TestAccResourceVSphereVirtualMachine_singleTag
--- PASS: TestAccResourceVSphereVirtualMachine_singleTag (101.11s)
=== RUN   TestAccResourceVSphereVirtualMachine_multipleTags
--- PASS: TestAccResourceVSphereVirtualMachine_multipleTags (100.43s)
=== RUN   TestAccResourceVSphereVirtualMachine_switchTags
--- PASS: TestAccResourceVSphereVirtualMachine_switchTags (145.59s)
=== RUN   TestAccResourceVSphereVirtualMachine_renamedDiskInPlaceOfExisting
--- PASS: TestAccResourceVSphereVirtualMachine_renamedDiskInPlaceOfExisting (279.45s)
=== RUN   TestAccResourceVSphereVirtualMachine_blockComputedDiskName
    resource_vsphere_virtual_machine_test.go:1389: Step 1/1, expected an error with pattern, no match on: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          + create
        
        Terraform will perform the following actions:
        
          # random_pet.pet will be created
          + resource "random_pet" "pet" {
              + id        = (known after apply)
              + length    = 2
              + separator = "-"
            }
        
          # vsphere_nas_datastore.ds1 will be created
          + resource "vsphere_nas_datastore" "ds1" {
              + access_mode          = "readWrite"
              + accessible           = (known after apply)
              + capacity             = (known after apply)
              + free_space           = (known after apply)
              + host_system_ids      = [
                  + "host-17",
                ]
              + id                   = (known after apply)
              + maintenance_mode     = (known after apply)
              + multiple_host_access = (known after apply)
              + name                 = "nfs-vol2"
              + protocol_endpoint    = (known after apply)
              + remote_hosts         = [
                  + "10.161.153.253",
                ]
              + remote_path          = "/nfs/ds2"
              + type                 = "NFS"
              + uncommitted_space    = (known after apply)
              + url                  = (known after apply)
            }
        
          # vsphere_resource_pool.pool1 will be created
          + resource "vsphere_resource_pool" "pool1" {
              + cpu_expandable           = true
              + cpu_limit                = -1
              + cpu_reservation          = 0
              + cpu_share_level          = "normal"
              + cpu_shares               = (known after apply)
              + id                       = (known after apply)
              + memory_expandable        = true
              + memory_limit             = -1
              + memory_reservation       = 0
              + memory_share_level       = "normal"
              + memory_shares            = (known after apply)
              + name                     = "testacc-resource-pool1"
              + parent_resource_pool_id  = "resgroup-21"
              + scale_descendants_shares = "disabled"
            }
        
          # vsphere_virtual_machine.vm will be created
          + resource "vsphere_virtual_machine" "vm" {
              + annotation                              = (known after apply)
              + boot_retry_delay                        = 10000
              + change_version                          = (known after apply)
              + cpu_limit                               = -1
              + cpu_share_count                         = (known after apply)
              + cpu_share_level                         = "normal"
              + datastore_id                            = (known after apply)
              + default_ip_address                      = (known after apply)
              + ept_rvi_mode                            = "automatic"
              + extra_config_reboot_required            = true
              + firmware                                = "bios"
              + force_power_off                         = true
              + guest_id                                = "other3xLinuxGuest"
              + guest_ip_addresses                      = (known after apply)
              + hardware_version                        = (known after apply)
              + host_system_id                          = (known after apply)
              + hv_mode                                 = "hvAuto"
              + id                                      = (known after apply)
              + ide_controller_count                    = 2
              + imported                                = (known after apply)
              + latency_sensitivity                     = "normal"
              + memory                                  = 2048
              + memory_limit                            = -1
              + memory_share_count                      = (known after apply)
              + memory_share_level                      = "normal"
              + migrate_wait_timeout                    = 30
              + moid                                    = (known after apply)
              + name                                    = (known after apply)
              + num_cores_per_socket                    = 1
              + num_cpus                                = 2
              + power_state                             = (known after apply)
              + poweron_timeout                         = 300
              + reboot_required                         = (known after apply)
              + resource_pool_id                        = (known after apply)
              + run_tools_scripts_after_power_on        = true
              + run_tools_scripts_after_resume          = true
              + run_tools_scripts_before_guest_shutdown = true
              + run_tools_scripts_before_guest_standby  = true
              + sata_controller_count                   = 0
              + scsi_bus_sharing                        = "noSharing"
              + scsi_controller_count                   = 1
              + scsi_type                               = "pvscsi"
              + shutdown_wait_timeout                   = 3
              + storage_policy_id                       = (known after apply)
              + swap_placement_policy                   = "inherit"
              + tools_upgrade_policy                    = "manual"
              + uuid                                    = (known after apply)
              + vapp_transport                          = (known after apply)
              + vmware_tools_status                     = (known after apply)
              + vmx_path                                = (known after apply)
              + wait_for_guest_ip_timeout               = 0
              + wait_for_guest_net_routable             = true
              + wait_for_guest_net_timeout              = 5
        
              + disk {
                  + attach            = false
                  + controller_type   = "scsi"
                  + datastore_id      = "<computed>"
                  + device_address    = (known after apply)
                  + disk_mode         = "persistent"
                  + disk_sharing      = "sharingNone"
                  + eagerly_scrub     = false
                  + io_limit          = -1
                  + io_reservation    = 0
                  + io_share_count    = 0
                  + io_share_level    = "normal"
                  + keep_on_remove    = false
                  + key               = 0
                  + path              = (known after apply)
                  + size              = 20
                  + storage_policy_id = (known after apply)
                  + thin_provisioned  = true
                  + unit_number       = 0
                  + uuid              = (known after apply)
                  + write_through     = false
                }
        
              + network_interface {
                  + adapter_type          = "vmxnet3"
                  + bandwidth_limit       = -1
                  + bandwidth_reservation = 0
                  + bandwidth_share_count = (known after apply)
                  + bandwidth_share_level = "normal"
                  + device_address        = (known after apply)
                  + key                   = (known after apply)
                  + mac_address           = (known after apply)
                  + network_id            = "network-14"
                }
            }
        
        Plan: 4 to add, 0 to change, 0 to destroy.
--- FAIL: TestAccResourceVSphereVirtualMachine_blockComputedDiskName (57.86s)
=== RUN   TestAccResourceVSphereVirtualMachine_blockVAppSettingsOnNonClones
--- PASS: TestAccResourceVSphereVirtualMachine_blockVAppSettingsOnNonClones (64.99s)
=== RUN   TestAccResourceVSphereVirtualMachine_blockVAppSettingsOnNonClonesAfterCreation
--- PASS: TestAccResourceVSphereVirtualMachine_blockVAppSettingsOnNonClonesAfterCreation (157.50s)
=== RUN   TestAccResourceVSphereVirtualMachine_blockDiskLabelStartingWithOrphanedPrefix
--- PASS: TestAccResourceVSphereVirtualMachine_blockDiskLabelStartingWithOrphanedPrefix (41.37s)
=== RUN   TestAccResourceVSphereVirtualMachine_createIntoEmptyClusterNoEnvironmentBrowser
--- PASS: TestAccResourceVSphereVirtualMachine_createIntoEmptyClusterNoEnvironmentBrowser (76.42s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneFromTemplate
--- PASS: TestAccResourceVSphereVirtualMachine_cloneFromTemplate (110.59s)
=== RUN   TestAccResourceVSphereVirtualMachine_clonePoweredOn
--- PASS: TestAccResourceVSphereVirtualMachine_clonePoweredOn (229.27s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool
    resource_vsphere_virtual_machine_test.go:1538: Step 1/1 error: Error running apply: exit status 1
        
        Error: error sending customization spec: Customization of the guest operating system is not supported due to the given reason: 
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 71, in resource "vsphere_virtual_machine" "vm":
          71: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool (85.08s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore
    resource_vsphere_virtual_machine_test.go:1560: Step 2/4 error: Error running apply: exit status 1
        
        Error: error sending customization spec: Customization of the guest operating system is not supported due to the given reason: 
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 73, in resource "vsphere_virtual_machine" "vm":
          73: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore (118.44s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneModifyDiskAndSCSITypeAtSameTime
--- PASS: TestAccResourceVSphereVirtualMachine_cloneModifyDiskAndSCSITypeAtSameTime (201.70s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneMultiNICFromSingleNICTemplate
--- PASS: TestAccResourceVSphereVirtualMachine_cloneMultiNICFromSingleNICTemplate (110.53s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone
    resource_vsphere_virtual_machine_test.go:1667: Step 1/1 error: Error running apply: exit status 1
        
        Error: error sending customization spec: Customization of the guest operating system is not supported due to the given reason: 
        
          with vsphere_virtual_machine.vm,
          on terraform_plugin_test.tf line 70, in resource "vsphere_virtual_machine" "vm":
          70: resource "vsphere_virtual_machine" "vm" {
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone (82.86s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneBlockESXi
    helper_test.go:115: set TF_VAR_VSPHERE_TEST_ESXI to run ESXi-specific acceptance tests
--- SKIP: TestAccResourceVSphereVirtualMachine_cloneBlockESXi (41.19s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithBadTimezone
--- PASS: TestAccResourceVSphereVirtualMachine_cloneWithBadTimezone (46.11s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithLinkedClone
--- PASS: TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithLinkedClone (47.16s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithoutLinkedClone
--- PASS: TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithoutLinkedClone (47.22s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneIntoEmptyCluster
    resource_vsphere_virtual_machine_test.go:1791: Step 1/2 error: Error running post-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
    testing_new.go:85: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cloneIntoEmptyCluster (35.76s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname
    resource_vsphere_virtual_machine_test.go:1812: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname (48.76s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneWithDiskTypeChange
    resource_vsphere_virtual_machine_test.go:1832: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cloneWithDiskTypeChange (44.47s)
=== RUN   TestAccResourceVSphereVirtualMachine_cpuHotAdd
    resource_vsphere_virtual_machine_test.go:1853: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cpuHotAdd (44.37s)
=== RUN   TestAccResourceVSphereVirtualMachine_memoryHotAdd
    resource_vsphere_virtual_machine_test.go:1884: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_memoryHotAdd (44.48s)
=== RUN   TestAccResourceVSphereVirtualMachine_dualStackIPv4AndIPv6
    resource_vsphere_virtual_machine_test.go:1915: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_dualStackIPv4AndIPv6 (44.18s)
=== RUN   TestAccResourceVSphereVirtualMachine_hostCheck
    resource_vsphere_virtual_machine_test.go:1936: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_hostCheck (44.09s)
=== RUN   TestAccResourceVSphereVirtualMachine_hostVMotion
    resource_vsphere_virtual_machine_test.go:1964: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_hostVMotion (44.17s)
=== RUN   TestAccResourceVSphereVirtualMachine_resourcePoolVMotion
    resource_vsphere_virtual_machine_test.go:1992: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_resourcePoolVMotion (44.60s)
=== RUN   TestAccResourceVSphereVirtualMachine_storageVMotionGlobalSetting
    resource_vsphere_virtual_machine_test.go:2020: Step 1/4 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_storageVMotionGlobalSetting (44.37s)
=== RUN   TestAccResourceVSphereVirtualMachine_storageVMotionSingleDisk
    resource_vsphere_virtual_machine_test.go:2056: Step 1/3 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_storageVMotionSingleDisk (44.65s)
=== RUN   TestAccResourceVSphereVirtualMachine_storageVMotionPinDatastore
    resource_vsphere_virtual_machine_test.go:2091: Step 1/3 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_storageVMotionPinDatastore (44.41s)
=== RUN   TestAccResourceVSphereVirtualMachine_storageVMotionRenamedVirtualMachine
    resource_vsphere_virtual_machine_test.go:2126: Step 1/4 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_storageVMotionRenamedVirtualMachine (44.22s)
=== RUN   TestAccResourceVSphereVirtualMachine_storageVMotionLinkedClones
    resource_vsphere_virtual_machine_test.go:2169: Step 1/4 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_storageVMotionLinkedClones (45.21s)
=== RUN   TestAccResourceVSphereVirtualMachine_storageVMotionBlockExternallyAttachedDisks
    resource_vsphere_virtual_machine_test.go:2208: Step 1/3 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_storageVMotionBlockExternallyAttachedDisks (44.62s)
=== RUN   TestAccResourceVSphereVirtualMachine_singleCustomAttribute
    resource_vsphere_virtual_machine_test.go:2239: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_singleCustomAttribute (44.54s)
=== RUN   TestAccResourceVSphereVirtualMachine_multiCustomAttribute
    resource_vsphere_virtual_machine_test.go:2260: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_multiCustomAttribute (44.43s)
=== RUN   TestAccResourceVSphereVirtualMachine_switchCustomAttribute
    resource_vsphere_virtual_machine_test.go:2281: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_switchCustomAttribute (44.87s)
=== RUN   TestAccResourceVSphereVirtualMachine_multipleDisksAtDifferentSCSISlotsImport
    resource_vsphere_virtual_machine_test.go:2309: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_multipleDisksAtDifferentSCSISlotsImport (44.52s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneImport
    resource_vsphere_virtual_machine_test.go:2350: Step 1/5 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_cloneImport (44.52s)
=== RUN   TestAccResourceVSphereVirtualMachine_interpolatedDisk
    resource_vsphere_virtual_machine_test.go:2431: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_interpolatedDisk (44.52s)
=== RUN   TestAccResourceVSphereVirtualMachine_deployOvfFromUrl
    resource_vsphere_virtual_machine_test.go:2455: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_deployOvfFromUrl (44.79s)
=== RUN   TestAccResourceVSphereVirtualMachine_deployOvaFromUrl
    resource_vsphere_virtual_machine_test.go:2477: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: POST https://sc2-rdops-vm06-dhcp-194-204.eng.vmware.com/rest/com/vmware/cis/session: 503 Service Unavailable
        
          with provider["registry.terraform.io/hashicorp/vsphere"],
          on terraform_plugin_test.tf line 1, in provider "vsphere":
           1: provider "vsphere" {}
        
--- FAIL: TestAccResourceVSphereVirtualMachine_deployOvaFromUrl (2.11s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-vsphere/vsphere 8549.182s
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/viapi   (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/virtualdisk     (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/virtualdevice  (cached) [no tests to run]
FAIL
make: *** [testacc] Error 1
vasila@vasila2VDJN terraform-provider-vsphere % 

Failed tests run separately because of the environment when all tests are executed.

--- PASS: TestAccResourceVSphereVirtualMachine_cloneIntoEmptyCluster (100.63s)
--- PASS: TestAccResourceVSphereVirtualMachine_cloneWithDiskTypeChange (216.24s)
--- PASS: TestAccResourceVSphereVirtualMachine_memoryHotAdd
--- PASS: TestAccResourceVSphereVirtualMachine_resourcePoolVMotion (197.11s)
--- PASS: TestAccResourceVSphereVirtualMachine_storageVMotionGlobalSetting (386.62s)
--- PASS: TestAccResourceVSphereVirtualMachine_storageVMotionSingleDisk (286.34s)
--- PASS: TestAccResourceVSphereVirtualMachine_storageVMotionBlockExternallyAttachedDisks (263.32s)
--- PASS: TestAccResourceVSphereVirtualMachine_singleCustomAttribute (127.75s)
--- PASS: TestAccResourceVSphereVirtualMachine_multiCustomAttribute (124.91s)
--- PASS: TestAccResourceVSphereVirtualMachine_switchCustomAttribute (174.64s)
--- PASS: TestAccResourceVSphereVirtualMachine_interpolatedDisk (170.94s)
--- PASS: TestAccResourceVSphereVirtualMachine_deployOvfFromUrl (134.02s)
--- PASS: TestAccResourceVSphereVirtualMachine_deployOvaFromUrl (170.93s)
--- PASS: TestAccResourceVSphereVirtualMachine_cpuHotAdd  (59.13s)
--- PASS: TestAccResourceVSphereVirtualMachine_upgradeCPUAndRam (43.71s)
--- PASS: TestAccResourceVSphereVirtualMachine_cdromConflictingParameters (15.84s)

Failing on localy and on acceptance.

- TestAccResourceVSphereVirtualMachineContentLibrary_basic
- TestAccResourceVSphereVirtualMachine_highLatencySensitivity
- TestAccResourceVSphereVirtualMachine_highDiskUnitNumbers
- TestAccResourceVSphereVirtualMachine_highDiskUnitsToRegularSingleController
- TestAccResourceVSphereVirtualMachine_vAppIsoBasic
- TestAccResourceVSphereVirtualMachine_vAppIsoNoCdrom
- TestAccResourceVSphereVirtualMachine_vAppIsoConfigIsoIgnored
- TestAccResourceVSphereVirtualMachine_vAppIsoChangeCdromBacking
- TestAccResourceVSphereVirtualMachine_vAppIsoPoweredOffCdromRead
- TestAccResourceVSphereVirtualMachine_cdromIsoBacking
- TestAccResourceVSphereVirtualMachine_blockComputedDiskName
- TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool
- TestAccResourceVSphereVirtualMachine_cloneCustomizeForceNewWithDatastore
- TestAccResourceVSphereVirtualMachine_cloneWithDifferentTimezone
- TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname
- TestAccResourceVSphereVirtualMachine_dualStackIPv4AndIPv6
- TestAccResourceVSphereVirtualMachine_storageVMotionPinDatastore
- TestAccResourceVSphereVirtualMachine_cloneImport
- TestAccResourceVSphereVirtualMachine_multipleDisksAtDifferentSCSISlotsImport
- TestAccResourceVSphereVirtualMachine_storageVMotionLinkedClones
- TestAccResourceVSphereVirtualMachine_storageVMotionRenamedVirtualMachine
- TestAccResourceVSphereVirtualMachine_hostVMotion
- ТestAccResourceVSphereVirtualMachine_hostCheck

Release Note

r/vsphere_virtual_machine: Disk changes sent in relocate spec when the VM is cloned do not depend so solely on presence of datastore id in disk configuration in HCL. The need to send the disk spec is calculated based on attribute differences on the existing disk for following attributes:

"datastore_id",
"disk_mode",
"eagerly_scrub",
"disk_sharing",
"thin_provisioned",
"write_through",

Still the thin_provisioned and eagerly_scrub properties depend mostly on the storage backend, so it is not guaranteed that ones provided in the config will be applied. the following workaround will do the job.

lifecycle {
    ignore_changes = [disk]
}

References

#1028

@vasilsatanasov vasilsatanasov requested a review from a team as a code owner October 2, 2023 12:41
@hashicorp-cla
Copy link

hashicorp-cla commented Oct 2, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added provider Type: Provider size/l Relative Sizing: Large labels Oct 2, 2023
Fixes hashicorp#1028

1) According to the issue eagerly_scrubbed and thin_provision are not
applied correctly when set and the providers is throwing an error.

It is nomrmal VM disk to receive values different from the ones in the
configuration - it depends entirely on the vSphere backend. In such
cases the provider should not throw an error.

See https://kb.vmware.com/s/article/2145183

- removed the validation regarding both fields so ignore_state fixes the
  deployment

2) In another comment of the issue it is stated that when VM is cloned with
different values for  eagerly_scrubbed and thin_provision from the ones
of the original disk the values are not applied (tested on VMFS
datastore).

- initialy the provider stated that if there is no datastore explicitly
  set for the disk no relocation changes will be sent to the api for
  this disk. This is changed to making a diff between the disk properties
  specified in HCL and the same on the exisiting disk on the source VM

Added e2e test to cover both cases.

Fixed unit tests broken by Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.30.7 to 0.31.0.
hashicorp@37f0a77

Signed-off-by: Vasil Atanasov <vasila@vmware.com>
@tenthirtyam tenthirtyam added this to the v2.5.0 milestone Oct 2, 2023
@tenthirtyam tenthirtyam changed the title Disk settings are not correctly applied fix: disk provisioning settings are not correctly applied Oct 2, 2023
Updates `CHANGELOG.md`.

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
@github-actions github-actions bot added documentation Type: Documentation size/xl Relative Sizing: Extra-Large labels Oct 2, 2023
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@iBrandyJackson iBrandyJackson merged commit 5787466 into hashicorp:main Oct 2, 2023
5 checks passed
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

This functionality has been released in v2.5.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Nov 9, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Type: Documentation provider Type: Provider size/l Relative Sizing: Large size/xl Relative Sizing: Extra-Large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disk provisioning settings are not correctly applied based on provided arguments
4 participants