Current Method
In the past I've done this by copying the ISOs to a Windows desktop then using the vCenter client to upload the ISO to a temporary datastore location on the ESXi server, then using "Datastore ISO file" to make the ISO available to the guest. This works, but requires multiple delays waiting for copies to complete, uses up more storage than necessary, and leads to situations where the extra copies get forgotten.
Background
The question Mounting ISO image on VMware ESX guest OS without VMware client is similar to this situation, except they were looking for a way to make an already-uploaded ISO connect to the VM.
Based on current VMware documentation, it appears that "esxcli" is the current preferred CLI. The older vicfg and esxcfg commands are deprecated.
So far, the closest I've found is a vmware-cmd
that connects and disconnects the CD/DVD drive:
vmware-cmd /vmfs/volumes/storage1/MyVM/MyVM.vmx connectdevice "CD/DVD Drive 2"
If I can't find a better option, I could also use vicfg-advcfg
(preferably preceded by a vicfg-cfgbackup
in case something goes wrong) to change the CD/DVD path variable.
I have not found any CLI or API method that appears to let me upload a file to a datastore like the Windows/Web client does.
Restrictions
If necessary, I can also use the Python, Perl, or Ruby APIs from a Linux server. Installing PowerCLI for Linux might be tricky, but I'm not completely ruling it out.
I cannot use a direct ssh connection to the ESXi servers. There is not a shared NFS server where I could copy the ISOs and have both the Linux server and the vCenter farm accessing the same share.
Question
How can I make an ISO file local to a Linux server available to a VMware ESXi/vCenter guest using command line tools?
Via a SAMBA share if it's an option.
Edit /etc/fstab to add that;
Create the directory;
Finaly you create a symbolic link in vmimages that point to the new share.
ln /mnt/smb /vmfs/vmimages/smb
IMO the first method is the best as all your ESX host can see the shared datastore, and thus moving a VM which as the iso mapped can't fail, but if you map the samba share to all your server you should be ok for that part.