VMware Cloud Community
JasonGillis
Enthusiast
Enthusiast

Obtain VM info in customization script

Hi all,

We're in a process of migrating from Lab Manager to vCloud Director.  One of the things we've relied on for some templates in Lab Manager is the ability to retrieve the newly deployed VM's IP, name, MAC, etc via a call to  VMware tools using the machine.id.get command.  This returned a single line string with all of the relevant information about the network interfaces and the name.

In working with vCloud Director it doesn't appear that we can retrieve this information in the same way.  It's not clear whether this is just the wrong way to get it in a vCD VM, or if it's not there at all anymore.  Is anyone successfully doing this?

Related to this would be whether there's any ability to retrieve information about the other systems in a vApp from within the guest.  That is, if a vApp has systems A & B, and we're customizing B, is there any easy way to get details about A from vCD?

Thanks!

Jason

Reply
0 Kudos
3 Replies
IamTHEvilONE
Immortal
Immortal

Jason,

There are some architectual differences between LM and vCloud's method of performing guest customization.

Lab Manager uses the scripting feature as you are use to.

vCloud Director uses OVF properties instead.  We pull the OVF Environment values, and then use that to proceed with Guest Customization.

I think this Blog post should nudge you in the right direction:

http://blogs.vmware.com/vapp/2009/07/selfconfiguration-and-the-ovf-environment.html

The OVF environment must be read by some "glue" code in the guest - typically upon power-on. It is the responsibility of this code to configure the guest. In our example, we wrote a small Python script. It reads the property values from the XML file on the CD-ROM and configures the IP stack in the guest using netsh.exe: setupIp.py This script is called from a Windows scheduled task that is executed upon system startup. For Linux, a similar script can be added to /etc/init.d (depending on the Linux distribution).

To access the OVF environment using VMware Tools instead of using the CD-ROM, we could execute the command:

Windows: "C:\Program Files\VMware\VMware Tools\VMwareService.exe" -cmd "info-get guestinfo.ovfEnv"

Linux: vmware-guestd --cmd 'info-get guestinfo.ovfEnv'

Best Regards,

Jon Hemming

Reply
0 Kudos
JasonGillis
Enthusiast
Enthusiast

Those appear to be the droids we're looking for!  Smiley Happy

Thanks for the pointer, Jon.  My google-fu wasn't coming up with that blog post.  I'll take a deeper look at that info and see where I can get to with it.

Jason

Reply
0 Kudos
guitzer
Contributor
Contributor

Dear Sender:

I will be out of office on training today and tomorrow. Please expect delays in your email responding.

Regards

GR

Reply
0 Kudos