In addition to adding vSphere 6.7 support and a few security enhancements (more details in the release notes), the latest OVFTool 4.3 release has also been enhanced to support customizing either vCPU and/or Memory from the default configurations when deploying an OVF/OVA.
Historically, it was only possible to modify these values if you were deploying to a vCloud Director endpoint using either --numberOfCpus or --memorySize. When deploying to a vSphere endpoint, these settings were not applicable and users would need to perform an additional operation calling into the vSphere API using whatever automation tool of choice to reconfigure the VM after deployment. It was not the end of the world but also not ideal if you simply wanted to make a minor modification to the default OVF/OVA you were deploying. I definitely ran into this a few times where having this functionality would have been very useful and I know number of customers have also shared simliar feedback in the past.
I had asked whether it was possible to support this use case and it looks like we already had an internal feature request added to the OVFTool backlog and with some additional customer feedback, we were also able to get this enhancement added to the latest release.
The existing --numberOfCpus and --memorySize accepts a VM Identifier (usually the name) followed by the value, for example
--numberOfCpus:Foo=4
The VM Identifier is to help with vApp deployments where you may have an OVF/OVA which is composed of multiple VMs of which you would like to customize each VM with different values. To ensure we do not break backwards compatibility, this pattern has also been extended when deploying to a vSphere endpoint. Having said that, most customers that I have talked to who use OVFTool generally deploy an OVF/OVA that is comprised of a single VM. In this case, rather than specifying the name of the VM again which is derived from --name property, you can simply use the wildcard asterisk (*) to simply apply it to all VMs within the OVF/OVA.
Here is an example of deploying a PhotonOS OVA which is configured with a default of 1 vCPU and 2GB memory and as part of our deployment using OVFTool, we will increase both vCPU to 2 and memory to 4GB:
ovftool --acceptAllEulas --name=Foo --numberOfCpus:'*'=2 --memorySize:'*'=4096 photon-custom-hw11-2.0-304b817.ova 'vi://*protected email*@192.168.30.200/VSAN-Datacenter/host/VSAN-Cluster'
Endre Ligeti says
Great improvement, thanks for the hint. However, it would be more than great if --diskSize would be applicable as well, because it seems to be ignored in 4.3.0. Is it intentional or shall we expect to be introduced in a future version of ovftool?
Endre Ligeti says
One more comment. I assume, running ovftool directly on the ESXi host is not supported, however 4.3.0 works on ESXi 6.7, and 4.2.0 is also usable on 6.5U2. Unfortunately, 4.3.0 fails to load on 6.5U2 with the following message:
"error while loading shared libraries: libicudata.so.58: failed to map text segment from shared object: Error 28"
I'm a bit afraid I need to keep using ovftool 4.2.0 and my legacy method to set vCPU and vMemory values, when deploying multiple VMs requiring different CPU and memory allocations from the same template. ESXi 6.7 is not a valid option yet.
Rama Sharma says
is there a way to set the disk size of Photon VM with ovftool cli where target is VC ?