Open sYera21 opened 1 year ago
Based on the description in https://developer.vmware.com/apis/358/vim.vm.InstantCloneSpec.html
Values will be queryable via destination VM's [extraConfig](https://developer.vmware.com/apis/358/vim.vm.ConfigInfo.html#extraConfig).
I don't think you'll be able to change anything that isn't already configurable in the extraConfig location. And maybe possibly in the location section:
A device change specification. The only allowed device changes are edits of VirtualEthernetCard and filebacked Serial/Parallel ports.
you could update the VirtualEthernetCard macAddress to something else. But you'd have to pick a static address that is in the correct range (and not using one of the dynamic ones ESXi/vCenter generates).
Does the extraConfig mean values that are in the vm. ConfigInfo
https://developer.vmware.com/apis/358/vim.vm.ConfigInfo.html#extraConfig
or are they another set of arbitrary values that make up the extraConfig since it isn't explicitly stated.
This also says that you have the ability to
"To avoid network conflicts, you can customize the virtual hardware of the destination virtual machine during an Instant Clone operation. For example, you can customize the MAC addresses of the virtual NICs or the serial port configurations of the destination virtual machine. vSphere 6.7 and later does not support customization of the guest OS of the destination virtual machine."
Is this not applicable?
For the config
settings, they would be the kind of settings that are on the source config.extraConfig.
For changing network or serial port, you would use the location property of the InstantCloneSpec and modify the deviceChange property of that to update the devices.
Are there any details as to what the key values of the config.extraConfig specifically are?
Describe the bug
I am using instantClone, and I am able to spin up the clone, but am unable to adapt any of the option values, in this case they are changes to the hardware of the Instant Clone. I read that the hardware is set by the GuestOS and so I have tired to use this page https://vdc-repo.vmware.com/vmwb-repository/dcr-public/723e7f8b-4f21-448b-a830-5f22fd931b01/5a8257bd-7f41-4423-9a73-03307535bd42/doc/vim.vm.GuestInfo.html to attempt it, but i'm having issues. Currently my code looks as follows:
Option Values that are passed in: {"config.hardware.numCPUs":10,"config.hardware.memoryMB":1000,"guestinfo.nicinfo.macAddress":"00:50:56:a6:e2:9j","guestinfo.ipAddress":"192.168.0.90"}
Option Values method: `def dict_to_optionvalues(self,guestinfo_vars): """ Transform Dictionary to Optional Values type to be passed to InstantClone Config
Instant Clone method: `def instant_clone_vm(self,content,parent_vm_name,vm_name,optionalvalues): """ Instant Clones a VM
Reproduction steps
1. 2. 3. ... Use a ESXI 8 setup
Expected behavior
The VM is expected to have the hardware changes written above
Additional context
Any advice is helpful