05 November, 2008

From the GUI to the CLI

VMware ships Studio as a virtual appliance (VA). I'm guessing they use VMware Studio to create VMware Studio based on the embedded CIM stack and management web GUI.

In this appliance there are a bunch of files. Lots of these are normal Linuxy files, many are from VMware.

The Studio VA itself is Ubuntu Feisty, 32bit. Almost all of the VMware bits reside in /opt/vmware/.

The easiest way to explain what files live where is to walk through an appliance build from scratch using the web interface.

Login to the VMware Studio GUI, http://whateverIP/



Click the Create Appliance button near the right side of the screen, select your base OS and specify a name for the appliance:



The list of base operating systems is generated by the XML files found in the directory:
/opt/vmware/etc/build/templates/

You'll notice an extra OS in the screenshot above, CentOS 5.2 x86_64. I added that by copying the file /opt/vmware/etc/build/templates/centos/5/2/build_profile.xml and making a few tweaks to it--those tweaks are another post in themselves.

Using the web GUI, type in your appliance name, version, description, etc. Keep clicking Next at the bottom of the screen to progress through the wizard. The only important thing here is that you have a VMware Server v1.something installed and accessible for the last step.



Click Save and Build to ensure this new profile and your build environment settings are working. If you have issues please rtfm else respond to this post and we can figure it out.

At this point you should have a completed build from the web GUI. Great stuff. What has happened under the hood is that the reference profile template was used to create a new appliance profile XML file in the directory /opt/vmware/var/lib/build/profiles/. The file in this directory should have a familiar name to it.

From now on you're ready to build from the command line. Run the command:

studiocli -cvp /opt/vmware/var/lib/build/profiles/myAppliance.xml


...And there you go. Nice. Debug-level verbosity is had with a second -v argument, as in:

studiocli -cvvp /opt/vmware/var/lib/build/profiles/myAppliance.xml

At this point you no longer need to use the web GUI to make changes to the appliance profile XML file. That file looks much like an OVF file with a few VMware Studio enhanced sections.

Nifty eh?

2 comments:

Unknown said...

I'm trying to do a very simple VMware studio build, but I can't get it to validate. It always fails on "Warning: Bad url: http://10.86.150.82/vmware-open-vm-tools/centos/5/3; please first make sure that you can access it from web browser".

The IP address is right, and when I cut and paste this URL into my browser on a different machine, it works great! So, the web-server side of the studio VM must be ok (or at least I think so). It must be something in the configuration of the web-client built into studio. But I sure can't figure out what it is (or even where I'd change something to make it better).

I can't get it to access anything in this area (and this particular application thing is one that studio put in on its own, so you'd kind of think it might work).

I'm not sure I have my DNS domain set right on the studio VM, but I can't see that making any difference with doing HTML to an IP address.

Anybody have any ideas? Or pointers to VMware community stuff that might have the answers?

Will DeHaan said...

Hi Kenneth,

Studio uses wget to test those URLs.

From the VMware Studio VM, login as root then try:

"wget http://10.86.150.82/vmware-open-vm-tools/centos/5/3"

...to see if that works.


/Will