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

Packer vmware-iso builder incorrectly setting cpus value #11231

Closed
kenleexyz opened this issue Aug 30, 2021 · 2 comments
Closed

Packer vmware-iso builder incorrectly setting cpus value #11231

kenleexyz opened this issue Aug 30, 2021 · 2 comments

Comments

@kenleexyz
Copy link

kenleexyz commented Aug 30, 2021

Overview of the Issue

vmware-iso builder appears to be incorrectly dividing the cpus option value by the cores / cpuid.coresPerSocket option value.

Reproduction Steps

  1. Create a template which uses the vmware-iso builder.
  2. Set cpus option to 1.
  3. Set cores option to 2.
  4. Inititate Packer build.
  5. In VMware Workstation, open the VM settings pane for the Packer VM and observe under 'Processors' that the number of processors / CPU sockets is Invalid: 0.5 (expect 1).

Same behaviour observed when cpus set to 2, cores set to 2. VMware shows number of processors as 1 (expect 2).

Same behaviour when using cpuid.coresPerSocket option under vmx_data.

image

Packer version

Packer v1.7.4

Simplified Packer Buildfile

source "vmware-iso" "ubuntu-amd64" {
  // Hardware resources
  cpus                    = 1
  cores                   = 2
  disk_size               = 32768
  disk_adapter_type       = "scsi"
  memory                  = 2048
  network                 = "NAT"

  // Communicator settings
  communicator            = "ssh"
  ssh_handshake_attempts  = 50
  ssh_password            = "vagrant"
  ssh_port                = 22
  ssh_timeout             = "10m"
  ssh_username            = "vagrant"

  // Guest OS settings
  guest_os_type           = "ubuntu-64"
  shutdown_command        = "echo 'vagrant' | sudo -S shutdown -P now"
  tools_upload_flavor     = "linux"
}

build {
  source "source.vmware-iso.ubuntu-amd64" {
    name                = "ubuntu-20-04"
    boot_command        = [" <wait>"," <wait>"," <wait>"," <wait>"," <wait>","<esc><wait>","<f6><wait>","<esc><wait>","<bs><bs><bs><bs><wait>"," autoinstall<wait5>"," ds=nocloud-net<wait5>",";s=http://<wait5>{{.HTTPIP}}<wait5>:{{.HTTPPort}}/<wait5>"," ---<wait5>","<enter><wait5>"]
    boot_wait           = "5s"
    iso_url             = "https://releases.ubuntu.com/20.04.2/ubuntu-20.04.2-live-server-amd64.iso"
    iso_checksum        = "sha256:d1f2bf834bbe9bb43faf16f9be992a6f3935e65be0edece1dee2aa6eb1767423"
    http_directory      = "resources/http"
  }

  post-processor "vagrant" {
    output              = "my.box"
  }
}

Operating system and Environment details

Windows 10 20H2 (Build 19042.1165)
VMware Workstation Pro 16.1.2 (Build 17966106)

@github-actions
Copy link

This issue has been migrated to hashicorp/packer-plugin-vmware#34 due to the Packer Plugin split.

Please follow the new issue for updates.

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

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 Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants