Closed weakcamel closed 4 months ago
Added the documentation
label.
Per the docs this only is for the primary disk but the docs do not account for this explicitly.
The following function provides the error seen.
func findDisk(devices object.VirtualDeviceList) (*types.VirtualDisk, error) {
var disks []*types.VirtualDisk
for _, device := range devices {
switch d := device.(type) {
case *types.VirtualDisk:
disks = append(disks, d)
}
}
switch len(disks) {
case 0:
return nil, errors.New("VM has no disks")
case 1:
return disks[0], nil
}
return nil, errors.New("VM has multiple disks")
}
When filing a bug please include the following headings, if possible.
Overview of the Issue
I'm using vsphere-clone image which has 1 primary and 2 extra disks. When trying to use
disk_size
parameter, I'm getting an error:There is no mention in the docs that's not supported though.
Looking at the old implementation ticket https://github.com/jetbrains-infra/packer-builder-vsphere/issues/68#issuecomment-374897243 it appears that the intention was to support resizing of existing disks with the
storage
stanza but all that does is add even more disks.Reproduction Steps
packer build
with an source VM/image containing more than 1 diskPacker Version
Plugin Version and Builders
vsphere-iso
vsphere-clone
VMware vSphere Version
Please provide the VMware vSphere version.
Guest Operating System
Simplified Packer Buildfile
Operating System and Environment Details
Build within a Linux 22.04 Docker container
Log Fragments and
crash.log
Files