hashicorp / packer-plugin-vmware

Packer plugin for VMware Builder
https://www.packer.io/docs/builders/vmware
Mozilla Public License 2.0
42 stars 42 forks source link

`vmware-vmx`: builder not attaching additional disks #119

Open meangrape opened 1 year ago

meangrape commented 1 year ago

Community Note

Overview of the Issue

When creating additional disks via

  disk_additional_size = [
    150000,
    150000
  ]

the additional disks are created in the output directory, but they are not attached to the created VM.

Packer version

Packer v1.8.5 vmware plugin 1.0.7

Simplified Packer Template

packer {
  required_plugins {
    vmware = {
      version = "= 1.0.7"
      source = "github.com/hashicorp/vmware"
    }
  }
}

source "vmware-vmx" "sentenai-fdb-300" {
  vm_name = "sentenai-fdb-300"
  headless = true
  source_path = "./output-sentenai-rhel-base/sentenai-rhel-base.vmx"
  ssh_username = "root"
  ssh_password = "rheluser"
  shutdown_command = "shutdown -P now"
  vmx_data = {
    "displayName" = "sentenai-fdb-300",
    "memsize" = "8192",
    "numvcpus" = "4",
  }

  disk_type_id = "0"
  disk_adapter_type = "nvme"
  disk_additional_size = [
    150000,
    150000
  ]
}

build {
  sources = ["sources.vmware-vmx.sentenai-fdb-300"]
}

Operating system and Environment details

Linux zin 5.15.0-58-generic hashicorp/packer#64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Log Fragments and crash.log files

2023/02/09 12:47:38 packer-plugin-vmware_v1.0.7_x5.0_linux_amd64 plugin: 2023/02/09 12:47:38 Executing: /usr/bin/vmware-vdiskmanager -c -s 150000M -a nvme -t 0 output-sentenai-fdb-300/disk-1.vmdk
2023/02/09 12:47:38 packer-plugin-vmware_v1.0.7_x5.0_linux_amd64 plugin: 2023/02/09 12:47:38 stdout: Creating disk 'output-sentenai-fdb-300/disk-1.vmdk'
2023/02/09 12:47:38 packer-plugin-vmware_v1.0.7_x5.0_linux_amd64 plugin: Virtual disk creation successful.

VMX file

sentenai-fdb-300.vmx

dentarg commented 8 months ago

Do we need https://github.com/hashicorp/packer-plugin-vmware/pull/95 but for vmware-vmx?

dentarg commented 7 months ago

It is possible to workaround by modifying the .vmx file by hand, like this: https://github.com/twingly/boxes/pull/41/files#diff-4fe8a1eab654c9187ffc929de002763e4733d26df46a5ed11579bedca698d2f6R110-R112