PowerCLI

 View Only
  • 1.  Way to script VMware tools status option

    Posted Oct 07, 2017 11:59 AM

    When a new VM is created, or a VM is registered to a vCenter for the first time, the VMware Tools status will display "not running, not installed". The "not running" part is obvious if it's powered off. But the "not installed" portion refers to vCenter's "memory" of the version of tools installed on the system. Normally, it will pick this up when the VM first boots and it observes VMtools is running, or when VMtools is installed it picks up the version and type (guest-managed or "official"). If a VM is powered off and this status says "not installed", then it will fail to be customized with a spec throwing the error message "customization of the guest operating system is not supported in this configuration".

    Would it be possible to tell vCenter this information? Is there an API for this? I'm trying to avoid having to automate a power-on/power-off cycle just to get vCenter to pick this info up. Any help is appreciated here.



  • 2.  RE: Way to script VMware tools status option

    Posted Oct 07, 2017 12:46 PM

    Which GuestOS did you specify when you created the VM? Was that a *nix flavour OS?

    Is the VM perhaps created from an image that contains the open VMware Tools?



  • 3.  RE: Way to script VMware tools status option

    Posted Oct 07, 2017 12:52 PM

    Hi, Luc, and thanks again for your help. I'm only testing one VM type right now, and it's "centos-64" and is using open-vm-tools. I haven't tested this behavior with Windows (yet) using the official VMware tools package. Do you think this makes a difference? Can you maybe supply any more info on this behavior?



  • 4.  RE: Way to script VMware tools status option
    Best Answer

    Posted Oct 07, 2017 01:15 PM

    I saw that in the past, not sure if it is still valid for 6.5.


    Try tricking the system into believing it's a supported Windows OS.

    It's only the Config.guestID property, you can put any of the VirtualMachineGuestOsIdentifier  values in there, and still install whatever guest OS you want.
    The alternative is/was that you needed to power on the VM at least once (still the case for the open VMware Tools I think).



  • 5.  RE: Way to script VMware tools status option

    Posted Oct 07, 2017 01:37 PM

    I'm testing on 6.5 currently, so it appears to be the same. I need to have that ID be accurate for other reasons, so I may not have any other choice but to power cycle it. Trick there is you cannot use the cmdlet Wait-VMTools if this is the case for the same reason, so I'm having to use a sleep statement.

    Do you know of any other way to set this in vCenter? Any thing other than a power cycle?



  • 6.  RE: Way to script VMware tools status option

    Posted Oct 07, 2017 06:18 PM

    No, I'm afraid not.

    But why can't you change the guestId only temporary?
    Once your customization is applied, you can set it back to the correct value.



  • 7.  RE: Way to script VMware tools status option

    Posted Oct 07, 2017 11:25 PM

    I see what you mean. That should work. However, I think I found another way around for now, but I'll test this and keep it in the back of my mind.



  • 8.  RE: Way to script VMware tools status option

    Posted Oct 09, 2017 04:08 PM

    I thought I'd just follow up after some testing with Linux VM types. Regardless if open-vm-tools or VMware's official Tools are installed, the resulting behavior is the same whereby vCenter thinks tools aren't installed. Only Windows systems, it seems, are immune to this deficiency.