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

Each apply reboots for attributes update ept_rvi_mode and hv_mode #2202

Closed
1 of 4 tasks
aj014506 opened this issue May 20, 2024 · 4 comments
Closed
1 of 4 tasks

Each apply reboots for attributes update ept_rvi_mode and hv_mode #2202

aj014506 opened this issue May 20, 2024 · 4 comments
Labels
bug Type: Bug

Comments

@aj014506
Copy link

aj014506 commented May 20, 2024

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

v1.8.3

Terraform Provider

v2.8.1

VMware vSphere

v8.0.2

Description

Deployed and OVF using below resource. Post deployment, subsequent 'terraform plan' show the attributes ept_rvi_mode and hv_mode are updated and a terraform apply restarts the virtual machine.

Have tried with explicit adding attributes to below resources with either ept_rvi_mode = automatic/manual and hv_mode = on/off.

root@linuxlinux:~# terraform plan
Terraform will perform the following actions:

  # vsphere_virtual_machine.nsx_manager_multi[0] will be updated in-place
  ~ resource "vsphere_virtual_machine" "nsx_manager_multi" {
      + ept_rvi_mode                            = "automatic"
      + hv_mode                                 = "hvAuto"
        id                                      = "42170883-5719-2fb5-bcdf-ec2bd6294ede"
        name                                    = "ajayakumar-nsxmanager-0"
        tags                                    = []
        # (72 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

  # vsphere_virtual_machine.nsx_manager_multi[1] will be updated in-place
  ~ resource "vsphere_virtual_machine" "nsx_manager_multi" {
      + ept_rvi_mode                            = "automatic"
      + hv_mode                                 = "hvAuto"
        id                                      = "42175506-48ea-27a5-1ead-8f92cdafa3bc"
        name                                    = "ajayakumar-nsxmanager-1"
        tags                                    = []
        # (72 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

  # vsphere_virtual_machine.nsx_manager_multi[2] will be updated in-place
  ~ resource "vsphere_virtual_machine" "nsx_manager_multi" {
      + ept_rvi_mode                            = "automatic"
      + hv_mode                                 = "hvAuto"
        id                                      = "4217bed9-47af-aa89-aef8-bf26477ead92"
        name                                    = "ajayakumar-nsxmanager-2"
        tags                                    = []
        # (72 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

Plan: 0 to add, 3 to change, 0 to destroy.

Warning: Quoted references are deprecated

  on resource.tf line 24, in data "vsphere_network" "penv_mgt_network":
  24:         provider = "vsphere.vsphere-pod-data"

In this context, references are expected literally rather than in quotes. Terraform 0.11 and earlier required quotes, but quoted references are now deprecated and will be removed in a future version of Terraform. Remove the quotes surrounding this reference to silence this warning.

(and 4 more similar warnings elsewhere)

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
root@linuxlinux:~# terraform apply --auto-approve
data.vsphere_datacenter.pos_test_dc: Reading...
data.vsphere_datacenter.pos_test_dc: Read complete after 0s [id=datacenter-3]
data.vsphere_datastore.penv_datastore: Reading...
data.vsphere_compute_cluster.penv_cluster: Reading...
data.vsphere_host.penv_host: Reading...
data.vsphere_network.penv_mgt_network: Reading...
data.vsphere_network.penv_mgt_network: Read complete after 0s [id=network-38]
data.vsphere_datastore.penv_datastore: Read complete after 0s [id=datastore-1417]
data.vsphere_host.penv_host: Read complete after 0s [id=host-1405]
data.vsphere_compute_cluster.penv_cluster: Read complete after 0s [id=domain-c8]
vsphere_virtual_machine.nsx_manager_multi[0]: Refreshing state... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede]
vsphere_virtual_machine.nsx_manager_multi[2]: Refreshing state... [id=4217bed9-47af-aa89-aef8-bf26477ead92]
vsphere_virtual_machine.nsx_manager_multi[1]: Refreshing state... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc]

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.nsx_manager_multi[0] will be updated in-place
  ~ resource "vsphere_virtual_machine" "nsx_manager_multi" {
      + ept_rvi_mode                            = "automatic"
      + hv_mode                                 = "hvAuto"
        id                                      = "42170883-5719-2fb5-bcdf-ec2bd6294ede"
        name                                    = "ajayakumar-nsxmanager-0"
        tags                                    = []
        # (72 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

  # vsphere_virtual_machine.nsx_manager_multi[1] will be updated in-place
  ~ resource "vsphere_virtual_machine" "nsx_manager_multi" {
      + ept_rvi_mode                            = "automatic"
      + hv_mode                                 = "hvAuto"
        id                                      = "42175506-48ea-27a5-1ead-8f92cdafa3bc"
        name                                    = "ajayakumar-nsxmanager-1"
        tags                                    = []
        # (72 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

  # vsphere_virtual_machine.nsx_manager_multi[2] will be updated in-place
  ~ resource "vsphere_virtual_machine" "nsx_manager_multi" {
      + ept_rvi_mode                            = "automatic"
      + hv_mode                                 = "hvAuto"
        id                                      = "4217bed9-47af-aa89-aef8-bf26477ead92"
        name                                    = "ajayakumar-nsxmanager-2"
        tags                                    = []
        # (72 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

Plan: 0 to add, 3 to change, 0 to destroy.
vsphere_virtual_machine.nsx_manager_multi[2]: Modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92]
vsphere_virtual_machine.nsx_manager_multi[1]: Modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc]
vsphere_virtual_machine.nsx_manager_multi[0]: Modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 1m0s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 1m0s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 1m0s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 1m10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 1m10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 1m10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 1m20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 1m20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 1m20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 1m30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 1m30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 1m30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 1m40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 1m40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 1m40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 1m50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 1m50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 1m50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 2m0s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 2m0s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 2m0s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 2m10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 2m10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 2m10s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 2m20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 2m20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 2m20s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 2m30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 2m30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 2m30s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 2m40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 2m40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 2m40s elapsed]
vsphere_virtual_machine.nsx_manager_multi[2]: Still modifying... [id=4217bed9-47af-aa89-aef8-bf26477ead92, 2m50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[1]: Still modifying... [id=42175506-48ea-27a5-1ead-8f92cdafa3bc, 2m50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Still modifying... [id=42170883-5719-2fb5-bcdf-ec2bd6294ede, 2m50s elapsed]
vsphere_virtual_machine.nsx_manager_multi[0]: Modifications complete after 2m53s [id=42170883-5719-2fb5-bcdf-ec2bd6294ede]
vsphere_virtual_machine.nsx_manager_multi[2]: Modifications complete after 2m53s [id=4217bed9-47af-aa89-aef8-bf26477ead92]
vsphere_virtual_machine.nsx_manager_multi[1]: Modifications complete after 2m53s [id=42175506-48ea-27a5-1ead-8f92cdafa3bc]

Warning: Quoted references are deprecated

  on resource.tf line 24, in data "vsphere_network" "penv_mgt_network":
  24:         provider = "vsphere.vsphere-pod-data"

In this context, references are expected literally rather than in quotes. Terraform 0.11 and earlier required quotes, but quoted references are now deprecated and will be removed in a future version of Terraform. Remove the quotes surrounding this reference to silence this warning.

(and 4 more similar warnings elsewhere)

Affected Resources or Data Sources

resource_vsphere_virtual_machine

Terraform Configuration

https://github.com/hashicorp/terraform-provider-vsphere/blob/main/website/docs/r/virtual_machine.html.markdown

Debug Output

https://github.com/aj014506/Support_logs/blob/main/Manager_redeployment

Panic Output

No response

Expected Behavior

Post deployment, did not expect to reboot every time.

Actual Behavior

Once VM's deployed did not expected to restart or reboot

Steps to Reproduce

Use below resource to reproduce the issue.

resource "vsphere_virtual_machine" "nsx_manager_multi" {
  count                     = 3
  provider                  = vsphere.vsphere-pod-data
  name                      = format("VM-%d%d", count.index)
  datacenter_id             = data.vsphere_datacenter.pos_test_dc.id
  resource_pool_id          = data.vsphere_compute_cluster.penv_cluster.resource_pool_id
  datastore_id              = data.vsphere_datastore.penv_datastore.id
  host_system_id            = data.vsphere_host.penv_host.id
  num_cpus                  = 4
  memory                    = 16384
  wait_for_guest_ip_timeout = 10
  network_interface {
    network_id = data.vsphere_network.penv_mgt_network.id
  }

  ovf_deploy {
    allow_unverified_ssl_cert = true
    remote_ovf_url            = "<VM ovf path>"
    disk_provisioning         = "thin"
    ip_protocol               = "IPv4"
    ovf_network_map           = {
      "Network 1" = data.vsphere_network.penv_mgt_network.id
    }
  }

  vapp {
    properties = {
      "nsx_hostname"          = format("VM-%d", count.index)
      "nsx_ip_0"              = "dhcp"
      "nsx_netmask_0"         = "dhcp"
      "nsx_ntp_0"             = "ntp.vmware.com"
      "nsx_passwd_0"          = "Admin!23Admin"
      "nsx_isSSHEnabled"      = "True"
      "nsx_cli_passwd_0"      = "Admin!23Admin"
      "nsx_allowSSHRootLogin" = "True"
    }
  }
  lifecycle {
    ignore_changes = [
      vapp
    ]
  }
}

Environment Details

No response

Screenshots

No response

References

No response

@aj014506 aj014506 added bug Type: Bug needs-triage Status: Issue Needs Triage labels May 20, 2024
Copy link

Hello, aj014506! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@rvdh
Copy link

rvdh commented May 22, 2024

I'm also running into this issue on vSphere 8, on vSphere 7 the problem does not occur.

@tenthirtyam tenthirtyam changed the title For every plan/apply VM reboots for attributes update ept_rvi_mode = "automatic "hv_mode = "hvAuto" Each apply reboots for attributes update ept_rvi_mode and hv_mode Jun 11, 2024
@tenthirtyam
Copy link
Collaborator

Duplicate of #1902

@tenthirtyam tenthirtyam marked this as a duplicate of #1902 Jun 12, 2024
@tenthirtyam tenthirtyam closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
Copy link

I'm going to lock this issue 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 similar to this, 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 Jul 12, 2024
@tenthirtyam tenthirtyam removed the needs-triage Status: Issue Needs Triage label Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants