-
Notifications
You must be signed in to change notification settings - Fork 108
vsphere-iso: Failure to Power-On VM after reattach_cdroms removes excess CD/DVD drives #516
Description
Overview of the Issue
Multiple CD-ROM drives are mounted in our packer build, and then we use reattach_cdroms=1 to remove the excess CD-ROMs at the end of the build.
The packer build completes successfully, but if we try to power on the VM created by Packer, we get an error message:
Module DevicePowerOn power on failed. Failed to start the virtual machine.
The IDE device (disks/CD-ROM) configuration is incorrect.
There is an IDE slave with no master at ide0:1. This configuration does not work correctly in virtual machines. Move the disk/CD-ROM from ide0:1 to ide0:0 using the configuration editor.
We only experience this issue after upgrading to version 1.2.5 (or later) of the plugin.
Reproduction Steps
Configure the vsphere-iso build as per the simplified buildfile provided below. Ensure multiple CD/DVD drives are mounted by using the "cd_files" and "iso_urls" options. Ensure the excess drives are removed by specifying "reattach_cdroms=1". Make sure the plugin is at least version 1.2.5.
Power-On the VM after the packer build is complete, and you will see the error.
The same error can be reproduced by creating a new VM manually in vCenter with two CD/DVD drives both attached to "IDE 0". If the first CD/DVD drive is then subsequently removed leaving only "CD/DVD drive 2", the VM does not power on and the same error message is displayed.
Packer Version
- 1.7.8
Plugin Version and Builders
vsphere-iso- Reproducible in versions 1.2.5 and later
VMware vSphere Version
8.0.3
Guest Operating System
Any
Simplified Packer Buildfile
source "vsphere-iso" "vmware" {
CPUs = 2
RAM = 4096
boot_command = [
"<esc><esc><esc><wait1>c<wait>",
"linux /casper/vmlinuz quiet ",
"autoinstall ",
"ds='nocloud' ",
"<enter><wait>",
"initrd /casper/initrd",
"<enter><wait>",
"boot<enter>"
]
cd_files = [
"${path.root}/data/meta-data",
"${path.root}/data/user-data"
]
cd_label = "cidata"
cluster = "${var.cluster}"
communicator = "none"
cpu_cores = 1
datastore = "${var.datastore}"
disk_controller_type = ["pvscsi"]
firmware = "efi"
folder = "${var.folder}"
guest_os_type = "ubuntu64Guest"
insecure_connection = "true"
iso_checksum = "file:https://releases.ubuntu.com/24.04.2/SHA256SUMS"
iso_urls = ["https://releases.ubuntu.com/24.04.2/ubuntu-24.04.2-live-server-amd64.iso"]
network_adapters {
network = "${var.network}"
network_card = "vmxnet3"
}
password = "${var.password}"
reattach_cdroms = 1
resource_pool = "${var.resourcepool}"
shutdown_timeout = "30m"
storage {
disk_size = 5120
disk_thin_provisioned = true
}
username = "${var.username}"
vcenter_server = "${var.vcenter_server}"
vm_name = "${local.vm_name}"
vm_version = 19
}
build {
sources = ["source.vsphere-iso.vmware"]
}