VMware {code} Community
ChetanSaundanka
Contributor
Contributor

Time taken for Guest IP address population is way too large.

Hello,

I am trying to get ip address(es) of vm once its powered on using guest info. However, the guest info gets populated only when the vmware tools inside guest starts (naturally!). We have observed that the time taken to change the tools status from 'notRunning' to 'ok' & actual population of ip address varies immensely (from few seconds to few minutes).

Its unclear as to how much time code should wait for address population? clearly waiting for few minutes is definitely not an option. I would like to know if theres any way to speed up address population or any other solution to tackle this issue.

Thanks in advanced.

0 Kudos
6 Replies
lamw
Community Manager
Community Manager

You're basically waiting for the underlying guestOS to start the VMware Tools services, this will depend on the number of applications that your OS may need to startup. I would suggest taking a look at the VMs who's tools startup much quicker than those that take slightly longer and see if there are any services that you can disable or see what applications are loading up. I take it, the ones that take much longer are Windows OSes?

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

William Lam

VMware vExpert 2009,2010

VMware VCP3,4

VMware VCAP-DCA4

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
ChetanSaundanka
Contributor
Contributor

Thanks William for your quick response.

The problem is that the code doesnt have (at least at this point in time) guest os, apps awareness. I would ideally like to make it os, app independent. I fully understand that the whole thing depends on the timing of tools service startup which really is out of vmware platform's control . Unfortunately this makes the situation very unpredictable & as I said taking several minutes to complete powerOn call (which includes getting ip info) is really unacceptable.

Yes we have observed that windows guests tend to take longer time to report guest info. Having said that the windows guest is pristine without any additional apps/services being installed apart from the ones which are default.

Message was edited by: ChetanSaundan…

0 Kudos
lamw
Community Manager
Community Manager

So the only recommendation since you understand this is outside of the VMware platform is to spin up threads for checking these guestOSes if you don't want to be blocked by it, or just put it in a "not ready" queue ... there's several approaches you can take. Basically you'll want to loop and check the state until it's ready, that'll probably be your best bet since there's nothing you can really do until the system is up and running.

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

William Lam

VMware vExpert 2009,2010

VMware VCP3,4

VMware VCAP-DCA4

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
ChetanSaundanka
Contributor
Contributor

Thanks for your suggestion William. We are actually considering the approach you have suggested. However that still would be a workaround for us & is not in line with the requirements.

We were also looking at the option of running a script at a startup to get IP info & pass it on to our application but even if we are able to catch hold of IP info in guest we don't have (or possibly don't know) a way in which the IP information could be mapped to a particular vm. Is there any way to achieve this?

0 Kudos
lamw
Community Manager
Community Manager

I was originally going to suggest using VMware VIX API, it's a way to actually run commands or a script within the guestOS, but one of the requirements for this is having VMware Tools running ....

I think running a script within the guestOS boots up is definitely another idea you could try, you could try obtaining the hostname, IP Address and MAC Address of the first vNic to use as a comparison with the virtual infrastructure. I don't know if this is software is custom for your environment or if you're an ISV .. so it'll be hard to do the mapping back. There are certain guest level attributes that can be set which can be queried using the VMware Tools CLI on the guestOS, but in a secured environment these can be blocked by special .vmx settings, so again you don't want to rely on the fact that these may not be available. I would say what I suggested above would be a good start, hopefully the environments have at least unique hostnames and non-duplicated MAC addresses 😃

Good Luck

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

William Lam

VMware vExpert 2009,2010

VMware VCP3,4

VMware VCAP-DCA4

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

ChetanSaundanka
Contributor
Contributor

This should give us a good point to start. Let me try this out and I will update this thread with my findings.

Thanks a lot again for your help.

0 Kudos