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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for hot add CPU and memory is broken #2171

Open
1 of 4 tasks
sgaosdgr opened this issue Apr 17, 2024 · 2 comments
Open
1 of 4 tasks

Support for hot add CPU and memory is broken #2171

sgaosdgr opened this issue Apr 17, 2024 · 2 comments
Labels
bug Type: Bug needs-triage Status: Issue Needs Triage
Milestone

Comments

@sgaosdgr
Copy link

sgaosdgr commented Apr 17, 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.7.5, v1.8.1

Terraform Provider

v2.7.0

VMware vSphere

v8.0 u2b

Description

The support for hot add CPU and memory is currently broken. A change to CPU and memory causes an VM to reboot. This is 100% reproducible.

Affected Resources or Data Sources

VM/

Terraform Configuration

#VMware vSphere Provider
provider "vsphere" {  
  #Set of variables used to connect to the vCenter
    vsphere_server = var.vsphere_server 
    user           = var.vsphere_user
    password       = var.vsphere_password
  
#If you have a self-signed cert
    allow_unverified_ssl = true
  }
  
#Name of the Datacenter in the vCenter
  data "vsphere_datacenter" "dc" {
    name = "DC1"
  }
#Name of the Cluster in the vCenter
  data "vsphere_compute_cluster" "cluster" {
    name          = "Cluster"
    datacenter_id = data.vsphere_datacenter.dc.id
  }
#Name of the Datastore in the vCenter, where VM will be deployed
  data "vsphere_datastore" "datastore" {
    name          = "vSAN"
    datacenter_id = data.vsphere_datacenter.dc.id
  }
#Name of the Portgroup in the vCenter, to which VM will be attached
  data "vsphere_network" "external_network" {
    name          = "External"
    datacenter_id = data.vsphere_datacenter.dc.id
  }
#Name of the Portgroup in the vCenter, to which VM will be attached
  data "vsphere_network" "internal_network" {
    name          = "Public"
    datacenter_id = data.vsphere_datacenter.dc.id
  }
#Name of the Templete in the vCenter, which will be used to the deployment
  data "vsphere_virtual_machine" "rocky9-template" {
    name          = "rocky9-temp"
    datacenter_id = data.vsphere_datacenter.dc.id
  }
  
#Set VM parameteres
  resource "vsphere_virtual_machine" "rocky9-vm" {
    name = "rocky91"
    num_cpus = 2
    memory   = 4096
    firmware = "efi"
    cpu_hot_add_enabled = "true"
    memory_hot_add_enabled = "true"
    guest_id = "rockylinux_64Guest"
    resource_pool_id = data.vsphere_compute_cluster.cluster.resource_pool_id
    datastore_id     = data.vsphere_datastore.datastore.id

    network_interface {
      network_id = data.vsphere_network.external_network.id
    }
    
    network_interface {
      network_id = data.vsphere_network.internal_network.id
    }

    disk {
      label            = "disk0"
      thin_provisioned = true
      size             = 50
    }
  
    clone {
      template_uuid = data.vsphere_virtual_machine.rocky9-template.id
#Linux_options are required section, while deploying Linux virtual machines
      customize {
          linux_options {
              host_name = "rocky91"
              domain = "net.local"
          }
          network_interface {
            ipv4_address = "10.10.1.5"
            ipv4_netmask = "23"
          }
          network_interface {
            #ipv4_address = "192.168.80.11"
            #ipv4_netmask = "24"
          }
          ipv4_gateway = "10.10.1.1"
      }
      
    }
    
    lifecycle {
       ignore_changes = [hv_mode, ept_rvi_mode]
    }
}

#Outup section will display vsphere_virtual_machine.ubu-testing Name and IP Address
output "VM_Name" {
  value = vsphere_virtual_machine.rocky9-vm.name
}

output "VM_IP_Address" {
  value = vsphere_virtual_machine.rocky9-vm.guest_ip_addresses
}

Debug Output

 ~ resource "vsphere_virtual_machine" "default" {
        id                                      = "421ae1e6-f4cf-6ab7-2ea7-3ec005a97055"
      ~ memory                                  = 6144 -> 8192
  ~ resource "vsphere_virtual_machine" "default" {
        id                                      = "421a661b-f5b6-619c-2e59-74175e5f562d"
        name                                    = "vm2"
      ~ num_cpus                                = 4 -> 6

Above two changes should not reboot the target VMs.

Panic Output

No response

Expected Behavior

Increasing CPU cores or memory size should take effect immediately without rebooting the target VM.

Actual Behavior

Increasing CPU core and memory size both cause the target VM reboot.

Steps to Reproduce

  1. Create a RockyLinux 9.3 x86_64 template from base OS installation. Installing open-vm-tools from RockyLinux repo.
  2. Provision a new VM from the template using above terraform config, which will enable hot add for CPU and memory.
  3. Make a change to CPU, run terraform apply.
  4. Make a change to memory, run terraform apply

Environment Details

No response

Screenshots

No response

References

No response

@sgaosdgr sgaosdgr added bug Type: Bug needs-triage Status: Issue Needs Triage labels Apr 17, 2024
Copy link

Hello, sgaosdgr! 馃枑

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.

@sgaosdgr
Copy link
Author

Please note, this is NOT a duplicate to 1902 bug report. Currently, hot add CPU and memory support is broken.

@tenthirtyam tenthirtyam added this to the Backlog milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Bug needs-triage Status: Issue Needs Triage
Projects
None yet
Development

No branches or pull requests

2 participants