packer-plugin-vmware icon indicating copy to clipboard operation
packer-plugin-vmware copied to clipboard

How to specify multiple ISO definition in a vmware-iso JSON file

Open sujitdey1 opened this issue 5 years ago • 10 comments

is it possible to add multiple CD drives at time vmaware-iso build? say one would for OS ISO and other would be Vmware tool

Issues on GitHub are intended to be related to bugs or feature requests, so we recommend using our other community resources instead of asking here if you have a question.

  • Packer Guides: https://www.packer.io/guides
  • Discussion List: https://groups.google.com/group/packer-tool
  • Any other questions can be sent to the packer section of the HashiCorp forum: https://discuss.hashicorp.com/c/packer
  • Packer community links: https://www.packer.io/community

sujitdey1 avatar Sep 21 '20 12:09 sujitdey1

Hi there @sujitdey1 thanks for reaching out. There is a new feature set to release in v1.6.3 that would allow for adding additional CD drives - https://deploy-preview-9796--packer-www.netlify.app/docs/builders/vmware/iso#cd-configuration

You can gain access to the feature now via the Packer nightly releases if you would like to try it out.

With that said, are you just looking to attach the Vmware tools?

There is a tools_upload_flavor configuration option available for the VMware iso builder that will upload the iso to the guest machine so that you can mount it and install it via a provisioner. I normally refer to https://github.com/luciusbono/Packer-Windows10/blob/master/install-guest-tools.ps1 for the commands to run for installing the tools via the Powershell provisioner.

Please let us know if this answers your question.

nywilken avatar Sep 21 '20 14:09 nywilken

Thanks for the reply . Actually i am trying to build windows machine from linux host(RedHat). and build is failing when i specify "scsi0.virtualDev": "pvscsi", and giving pvscsi drivers in Floppy section like... "floppy_files": [ "./floppy/Autounattend.xml", "./floppy/amd64", "./floppy/pvscsi-Windows8.flp" ],
i am doing it through Jenkins pipeline and i don't have console access(though it is working in windows host). So i don't know what exactly happening. But if i specify custom windows ISO with pvscsi driver ,it is working .

so just want to try mount the vmware tool as CD and give the driver path in answer file.

i am using Vmware Workstation version 15

and problem of tool upload flavor option is it will fetch the ISO from internet ,

sujitdey1 avatar Sep 21 '20 14:09 sujitdey1

Hi, thanks for reaching out.

Sounds like this is a feature request that could go one of two ways

  1. Allow user to set vmware tool upload from a local source rather than downloading from the internet.
  2. More generally, provide paths to isos to mount as CDs.

Both seem like reasonable feature requests to me. hashicorp/packer#1 is probably the easiest to implement, but I think the groundwork for hashicorp/packer#2 has been laid fairly well and shouldn't be too difficult either.

SwampDragons avatar Sep 23 '20 21:09 SwampDragons

In investigating this for hashicorp/packer#9983, I found that vmware isn't downloading the tools from the internet -- it's loading them from the vmware installation directory.

SwampDragons avatar Sep 24 '20 18:09 SwampDragons

@sujitdey1 we've got pvscsi working before using floppy_img_path for the floppy image rather than adding it as a file under floppy_files

"floppy_img_path": "provisioning_temp/pvscsi-Windows8.flp"

and adding the following to Autounattend.xml under <settings pass="windowsPE">:

<component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <DriverPaths>
    <PathAndCredentials wcm:action="add" wcm:keyValue="A">
      <!-- pvscsi-Windows8.flp -->
      <Path>B:\</Path>
    </PathAndCredentials>
  </DriverPaths>
</component>

mahcsig avatar Sep 24 '20 20:09 mahcsig

But for vmware-iso , "floppy_img_path": is not valid string. i found one way, build the machine with "lsisas1068" adapter and add one extra controller like "scsi1.present": "TRUE", "scsi1.virtualDev": "pvscsi",

after windows installation update the "scsi0.virtualDev": "lsisas1068", to "pvscsi" in vmx file . (but i will prefer not to update vmx file)

Most probably it is not booting if i specify "scsi0.virtualDev": "pvscsi" at time of windows setup ...

sujitdey1 avatar Sep 25 '20 04:09 sujitdey1

I use two ISOs to have windows installation media and VMtools for the driver. Has been working since several years ago. JSON "iso_paths": [ "[{{ user vcenter_datastore}}]ISOS/PTAUT-4147.iso", "[{{ user iso_datastore}}]ISOS/VMware-tools-windows-11.3.5.iso" ], HCL iso_paths = ["[${var.vcenter_datastore}]ISOS/PTAUT-4147.iso", "[${var.iso_datastore}]ISOS/VMware-tools-windows-11.3.5.iso"]

HTH Chris

ChrisDek avatar Mar 14 '22 09:03 ChrisDek

I use two ISOs to have windows installation media and VMtools for the driver. Has been working since several years ago. JSON "iso_paths": [ "[{{ user vcenter_datastore}}]ISOS/PTAUT-4147.iso", "[{{ user iso_datastore}}]ISOS/VMware-tools-windows-11.3.5.iso" ], HCL iso_paths = ["[${var.vcenter_datastore}]ISOS/PTAUT-4147.iso", "[${var.iso_datastore}]ISOS/VMware-tools-windows-11.3.5.iso"]

HTH Chris

AFAIK iso_paths is for vsphere-iso plugin, not vmware-iso . The topic is about vmware-iso.

I wonder if there is an easy way to re-use the host storage where an "ISO library" is . eg: /vmfs/volumes/myISOs/image_file.iso

msilveirabr avatar May 17 '22 20:05 msilveirabr

Please transfer to hashicorp/packer-plugin-vmwaree.

cc @nywilken

tenthirtyam avatar Mar 06 '24 04:03 tenthirtyam

cc @nywilken @lbajolet-hashicorp for transfer

tenthirtyam avatar Apr 27 '24 20:04 tenthirtyam