Home > Blogs > VMware vApp Developer Blog > Tag Archives: ovf

Tag Archives: ovf

Introduction to the Eclipse plugin in VMware Studio 2.0

There are many steps in developing, building and testing VMs and vApps using VMware Studio.  To make it easier Studio 2.0 adds a new tool to help, the VMware Studio Eclipse plugin. The plugin makes life simpler to many users by adding simple ways to package applications and build the application along with the VM or vApp, all in a single click.  To demonstrate the simplicity, in this blog entry, I will walk through an example of how to develop a simple web-based VM or vApp.

To follow along you will already need to have VMware Studio running and will need to set up an Eclipse development environment.

To get started I downloaded the Eclipse IDE distributed by Aptanu at http://www.aptana.org/ and installed the optional Aptana Aflax feature by going to Help->Install Aptana Features then selecting Ajax Libraries->Aflax and then clicking install.  You can also select the editing tools that you want to use for your app.

I then installed the VMware Studio Eclipse Plugin by following the guide at http://www.vmware.com/support/developer/studio/studio20/eclipse_plugin.html.

Now the normal application development tasks take place, I will just use a sample project that is provided by Aptana as my application.  If the Samples view is not open in your environment, then you can open it by selecting Window->Show View->Other…->Aptana Views->Samples then clicking OK.  Once the view is open, I will find the sample named spirograph, right click on it and select Import Sample as Project...

Once the project is opened I used the Project Explorer view to create a new directory named html and moved all the web files into it.  I then created a VMware Studio Package for Linux (.vsp) in the project and called it mypackage.  To created the vsp file, right-click on the project name and select New->Other…->VMware Studio->VMware Studio Package for Linux .

You can use the Eclipse tools to further test and develop this web app.  Open the index.html file and modify the source or preview the changes.


Once you are satisfied with the app, it is time to package it.  Open the mypackage.vsp file and fill out the package details.  This application requires a httpd server with php on the VM which is provided by the operating system, so add them to the dependencies line.

Now set up the file mapping.  The file tree on the left represents how the files will be laid out in the VM after it is built.  The source location is where the files are on your local machine.  For this application, we will just set the top level html directory, Eclipse will recursively go through all the files and automatically add them at build time.



This application needs the web server to automatically start when the VM is booted.  To make this happen, we edit the post-install script for vsp.



We are almost done!  Now we just need to set up a VM build profile on VMware Studio.  For this blog I chose to use CentOS and keep the default configuration for everything except setting the root password and editing the settings for the provisioning engine.

You can create the profile directly in Eclipse by clicking on VMware Studio Web Console in the VMware Studio Explorer view.  Create the profile then save and close it.

Then when you are ready, click on Build Package… in the vsp editor.  The first time you may be prompted to create a package repository, just accept the default by clicking Yes then OK.  Select the VM profile to add this package to, and enable Automatically start VM build.  Then click on Finish.

A new Eclipse job is started, which monitors the build, and will notify you when it is finished.  You can monitor the status of the build by opening the Progress view.


Once the build is done you can deploy the VM to test it.




That is all that is needed.  Easy!  Your VM is now ready to be shipped.

The Eclipse plugin provides several other feature, like looking at the build logs, and creating default service packages to extend the VAMI framework.

Please leave comments and let us know how this went for you!


VMware Studio 2.0 GA – What’s new?

VMware Studio 2.0 GA was announced at VMworld Developer Day. The GA release comes two months after Beta. It mainly focuses on product quality and usability improvements with few enhancements from the Beta feedback. One of the key features added was support for CD based updates for virtual appliances. This feature is critical for production appliances that are deployed behind firewall. Since these appliances cannot connect to ISV's web based update repository, GA version of Studio allows appliance authors to create CD based update repository alongwith web based version it supported since 1.0. The end-user web console allows users to configure updates to be received from CD or through the phone-home URL. The other key area where we spent a good time during GA release was ensuring support for various vCenter environments for building vApps and virtual appliances. You can have VC environments with distributed vSwitches, VC deployments integrated with Active Directory and specify them as provisioning target in Studio. GA version also allows the author to specify clusters and sub resource pools for provisioning hosts. It detects hosts that are in maintenance mode and prevents their use during provisioning. 

Minor features include support for web console footer customization, setting hostname explicitly in built vms and virtual appliances and control EULA acceptance on first boot amongst others. Disabling EULA acceptance is needed for build and test environments to enable running regression test suite on nightly appliance builds in automated fashion. With 2.0 GA release, VMware tools are optional and explicitly specified in the build profile similar to appliance packages. This makes it easy to update or replace the tools with the version preferred for your deployment environment.

Also check out the GA version of Eclipse Plugin. We have done few usability improvements here, ability to add individual packages instead of entire application package repositories, ability to automatically create application package repository when building an application package. Studio menu items in Eclipse are now context sensitive. VMware Studio 2.0 is a view in Eclipse. Try it out with your Java, J2EE, C++ perspectives and it should integrate seamlessly. Eclipse 3.5 was released just after Studio Beta and we have ensured Studio GA Plugin continues to work with 3.5 alongwith 3.4 version of Eclipse.

A common question seen in community forums is support for various guest Operating Systems. We plan to address it in a different form by making Studio build process agnostic of various Linux distros and enabling users to create their own templates. Expect this feature in near future. In the meanwhile we have various blog posts coming to describe how to create VMs with various guest operating systems that are not supported out of the box in VMware Studio. 

The GA version includes fixes that we encountered while creating large vApps. One of the exercises we conducted internally was creation of Sharepoint vApp using Studio. We successfully created the 3 tier vApp that has MSSQL database, Index server and Frontend. The Sharepoint vApp uses OVF properties to extract environment specific variables : computer names of each vm and domain to integrate into. On first boot it runs sysprep to complete the deployment process. It also asks for existing AD instance and integrates the vApp into the existing domain. The end result is a running sharepoint vApp integrated with AD. We plan to post the details around the same including first boot scripts, sysprep commands, etc in coming weeks. 

Below are part 1 and 2 of videos that show how to build vApps using VMware Studio. Download VMware Studio 2.0 GA release from here and give it a spin. We look forward for your feedback.

From Studio Team

   
 

Command-line OVF Deployments

In the previous blog post, I showed how to deploy a multi-tiered OVF package using the Deploy OVF Template Wizard in the vSphere Client. The interactive workflow provided by the vSphere Client is hard to beat in terms of ease of use and simplicity. However, the graphical user interface also has it drawbacks. In particular, it can be fairly cumbersome to use if you have a large set of similar OVFs that needs to be deployed, or you want to automate a deployment. In those cases, a command-line utility is often preferred. Well, we have exactly the solution for that: OVF Tool 1.0.

OVF Tool provides a slew of different features, such as converting between OVF and .vmx formats and import/export of OVF 1.0 to vSphere 4.0, VirtualCenter 2.5/ESX 3.5 and earlier releases.

In the following I will show how to deploy the SugarCRM solution from the command-line and get exactly the same result as I got from the vSphere Client last week.

First, I probe the SugarCRM.ova to figure out what it contains and particular what parameters can be customized.

f:\>ovftool –hideEula http://aar-ovfrepo/ovf/SugarCRM.ova
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
OVF version:   1.0
Name:          SugarCRM
Version:       4.5.1e
Full Version:  4.5.1e-build 131
Vendor:        SugarCRM Inc
Product URL:   http://www.sugarcrm.com/crm/products/crm-products.html
Vendor URL:    http://www.sugarcrm.com/crm/

Annotation:  The sweet way to manage customer relationships.

End-user License Agreements:
  Present:     Yes (1)

Download Size:   764.49 MB

Deployment Sizes:
  Flat disks:     20.00 GB
  Sparse disks:    1.55 GB

Networks:
  Name:        Network
  Description: The network that the SugarCRM application will be available on

Virtual Hardware:
  Family:       vmx-04
  Disk Types:   SCSI-lsilogic

Properties:
  Key:         emailAdmin
  Category:    Application
  Label:       Administrator Email Address
  Type:        string
  Description: Enter email address for administrator. This is displayed on the help page.

  Key:         theme
  Category:    Application
  Label:       Theme
  Type:        string["Sugar", "RipCurl", "Retro", "Paradise", "Love",
               "Sunset"]
  Description: Select the default color/graphic scheme

  Key:         concurrentSessions
  Category:    Performance
  Label:       Concurrent Sessions
  Type:        int(10..1000)
  Description: The maximum allowed concurrent sessions.

  Key:         dbIp
  Category:    Network
  Label:       Database instance IP address
  Type:        ip:Network
  Description: IP address for the database instance (in dot-notation).

  Key:         webIp
  Category:    Network
  Label:       SugarCRM IP Address
  Type:        ip:Network
  Description: IP address on the SugarCRM application server. The service is made accessible at this IP address.

Deployment Options:
  Id:          small
  Label:       Evaluation
  Description: Use this configuration for evaluation purposes on
ly. The number
of CPUs required and amount of memory used is minimized, making it possible to run the system on a desktop system.

  Id:          medium
  Label:       Production
  Description: Standard settings for a typical product environment. This deployment option is suitable for a SMB production environment with less than 500 users.

  Id:          large
  Label:       Enterprise
  Description: Settings for large enterprise production environments. This deployment option is suitable for a large enterprise production environment with more than 500 users.

IP Allocation Policy:
  Schemes:     ovfenv dhcp
  Protocols:   IPv4

Completed successfully

By examining this output, I can gather the same information as was shown in the vSphere Client, such as product information, download sizes, end-user license agreements, deployment options, properties that can be customized, and supported IP policy schemes.

The next step is to deploy this to my vSphere 4.0 server. OVF Tool provides a handy pseudo-interactive mode for probing the vSphere inventory, so I do not have to open the vSphere client to look up the inventory organization or names of networks and datastores. To get started, I simply try and deploy it:

f:\>ovftool http://aar-ovfrepo/ovf/SugarCRM.ova vi://aar-dev-cluster-vc1
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
Please enter login information for target vi://aar-dev-cluster-vc1/
Username: VMWAREM\renes
Password: *********
Error: Found wrong kind of object (Folder)
Possible completions are:   
  aar-dev-datacenter/
  Jan's Test Datacenter/   

Ok, so the first completion is: vi://aar-dev-cluster-vc1/aar-dev-datacenter/. After a few more iterations, I get to this:

f:\>ovftool –acceptAllEulas http://aar-ovfrepo/ovf/SugarCRM.ova vi://VMWAREM%5Crenes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
Please enter login information for target vi://aar-dev-cluster-vc1/
Username: VMWAREM\renes
Password: *********
Opening VI target: vi://VMWAREM\renes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster
Error: No target datastore specified
Datastores found on target:
  Cluster VMFS
  Storage1

It now provides completions for datastores. Simlilarly, OVF Tool will provide completions for networks (if there are multiple choices). The final command to deploy, customize, and power-on the SugarCRM OVF package is:

f:\>ovftool "–datastore=Cluster VMFS"
            "–network=VM Network"
            –acceptAllEulas
            -ipAllocationPolicy=transient
            –prop:emailAdmin=admin@vmware.com
            –prop:theme=Retro
            –powerOn
            http://aar-ovfrepo/ovf/SugarCRM.ova
            vi://VMWAREM%5Crenes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
Please enter login information for target vi://aar-dev-cluster-vc1/
Username: VMWAREM\renes
Password: *********
Opening VI target: vi://VMWAREM\renes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Target: vi://aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Disk Transfer Completed
Powering on vApp: SugarCRM
Completed successfully

Voila! (Standard disclaimer: I inserted a few line breaks to make it more readable. How to escape spaces in parameters varies whether you are on Linux or Windows).

This was just a very quick preview of the features of OVF Tool. Consult the documentation for more examples, and download the tool today to try it out for yourself. Next time,
I will dive into the internal structure of the SugarCRM OVF package.