VMware Cloud Community
wilson94t
Enthusiast
Enthusiast

vmware-cmd setconfig fails but editing the .vmx works fine.

We wanted to use the vmware-cmd with setconfig from the ESX 3.5 console in order to update the VMX file with an iso for booting, but this does not appear to function as expected. Instead of doing this, we have resorted to some sed of the file (and sometimes unregister/register in order to make things take) but shouldn't we be able to use the setconfig parameter?

Attempts to use setconfig result in this error -3:

# vmware-cmd /vmfs/volumes/LABV00/autoinstall_64/autoinstall_64.vmx setconfig ide0:0.fileName /vmimages/iso/our_boot.iso

VMControl error -3: Invalid arguments

Suggestions (other than rewriting what i have to use some powershell whatever)

0 Kudos
3 Replies
lamw
Community Manager
Community Manager

This is a known issue for some of the parameters with setconfig, only a subset of params can be modified using this command. You might want to take a look at vimsh to see if there is an option to do so, I don't recall off the top of my head, powershell, VI Perl Toolkit or using sed to update the configuration file but ensure that the VM is offline while you do that else the configurations will not take affect and then power on.

UPDATE: If you're resorting to sed, you don't need to register and unregister. You can modify the .vmx file while the VM is offline. Then you can use vimsh to actually reload the .vmx configuration, that way you don't need to unregister and re-register to have the settings take affect.

vmware-vim-cmd vmsvc/getallvms | grep "YOUR_VM"

to get the VmId

vmware-vim-cmd vmsvc/reload [VmId]

This will reload the configuration after you've made the changes to the .vmx file. I would take a look at vimsh to see if there is a way to dynamically set an iso to boot.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

wilson94t
Enthusiast
Enthusiast

Thanks lamw.

I suppose VMware's effort to biuld out ESXi and focus on the toolkit will make any such fix for vmware-cmd just wishful thinking. We''ve proceeded with the sed workaround for now. It works, just not quite as nicely as it's supposed to. It would seem that this has been broken for quite some time.

we did have a look at the VIMshell... didn't see what we wanted. Thanks again.

0 Kudos
lamw
Community Manager
Community Manager

Yea that sounds about right, there are other parameters that also don't function as expected. I remember there was a patch that was released a few months ago that might have fixed some of the parameters to work. Vimsh does not have a solution, but you had mentioned you had to unregister/re-register sometimes, so vimsh has an option to reload without having to unregister and re-register.

Another option you could try is look in the VI Perl Toolkit and the VI API on how to script the process, as the vmware-cmd is just a Perl script talking to the exposed VI API. You can try to look in the VI API forums to see if someone has already written a snippet of code for this. Though the current sed solution also works if you don't want to try to find another solution.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

0 Kudos