hashicorp / packer-plugin-vmware

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

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

Closed sujitdey1 closed 4 months ago

sujitdey1 commented 4 years ago

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.

nywilken commented 4 years ago

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.

sujitdey1 commented 4 years ago

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 ,

SwampDragons commented 4 years ago

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 commented 4 years ago

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.

mahcsig commented 4 years ago

@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>
sujitdey1 commented 4 years ago

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 ...

ChrisDek commented 2 years ago

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

msilveirabr commented 2 years ago

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

tenthirtyam commented 8 months ago

Please transfer to hashicorp/packer-plugin-vmwaree.

cc @nywilken

tenthirtyam commented 6 months ago

cc @nywilken @lbajolet-hashicorp for transfer