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

Changing nutanix_virtual_machine description needlessly restarts VM #574

Open
jantari opened this issue Mar 27, 2023 · 2 comments
Open

Changing nutanix_virtual_machine description needlessly restarts VM #574

jantari opened this issue Mar 27, 2023 · 2 comments
Labels

Comments

@jantari
Copy link

jantari commented Mar 27, 2023

Nutanix Cluster Information

Please provide the version of:

  • Nutanix Cluster (Prism Element / AOS): 5.20.3 LTS
  • Nutanix Prism Central: pc.2022.6.0.3

Terraform Version

Terraform v1.4.2
on linux_amd64

Affected Resource(s)

  • nutanix_virtual_machine

Terraform Configuration Files

resource "nutanix_virtual_machine" "server" {
  count                = 1
  name                 = "prod-db-fundb${format("%02d", count.index)}"
  description          = join(" ", [
                           "Database Server of fun.",
                           "Repository: https://git.domain.tld/platforms/fun"
                         ])
  num_sockets          = 4
  num_vcpus_per_socket = 1
  memory_size_mib      = 17312

  hardware_clock_timezone = "Europe/Berlin"

  cluster_uuid = local.cluster_b

  nic_list {
    subnet_uuid = data.nutanix_subnet.subnet_prod_b.id
  }

  disk_list {
    data_source_reference = {
      kind = "image"
      uuid = "<SOME_UUID>"
    }
    device_properties {
      disk_address = {
        device_index = 0
        adapter_type = "SCSI"
      }
      device_type = "DISK"
    }
  }

  disk_list {
    device_properties {
      disk_address = {
        device_index = 1
        adapter_type = "SCSI"
      }
      device_type = "DISK"
    }
    disk_size_mib = 256000
  }

  disk_list {
    device_properties {
      disk_address = {
        device_index = 2
        adapter_type = "IDE"
      }
      device_type = "CDROM"
    }
  }

  nutanix_guest_tools = {
    state           = "ENABLED"
    iso_mount_state = "MOUNTED"
  }

  lifecycle {
    ignore_changes = [
      nutanix_guest_tools,
      disk_list[0].data_source_reference,
    ]
  }
}

Debug Output

I will do this if it's requested and really needed, looking through the entire debug output many times over to ensure it is sanitized is a lot of work.

Panic Output

no panic

Expected Behavior

The VMs description should have been updated in-place without restarting / power-cycling the VM.

Actual Behavior

The VM was needlessly restarted.

Steps to Reproduce

  1. Provision a nutanix_virtual_machine with terraform
  2. Change the description
  3. Perform a plan - it will show that the description will be updated in-place
  4. Apply the plan - the VM will be restarted just for a description change

Important Factors

We are using AHV hypervisor and Prism Central on official Nutanix hardware.

References

Terraform plan output:

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:
  # nutanix_virtual_machine.server[0] will be updated in-place
  ~ resource "nutanix_virtual_machine" "server" {
      ~ description                                      = "Database Server of fun" -> "Database Server of fun. Repository: https://git.domain.tld/platforms/fun"
        id                                               = "<VM_UUID>"
        name                                             = "prod-db-fundb00"
        # (35 unchanged attributes hidden)
      - timeouts {}
        # (4 unchanged blocks hidden)
    }
Plan: 0 to add, 1 to change, 0 to destroy.

Restart showing in Prism Central Tasks:

image

Restart evidenced by ping drop:

image

@abhimutant
Copy link
Collaborator

Hi @jantari , we have tried the same with pc 2022.9 . We weren't able to see the restarting of VM by updating the description. We have used your resource information to verify the behaviour . Can you give it a try with pc 2022.9 ?
Do let us know if you are still facing the same.

@abhimutant
Copy link
Collaborator

Hi @jantari ,can you confirm if you are still able to see this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants