VMware {code} Community
SamancchiTim
Contributor
Contributor

How to deploy OVF files using vSphere SDK for Perl?

Dear All,

can some please enlighten me on how can I deply ovf files using vSphere SDK for Perl?

I have an ovf file which contains 4 Linux based servers. The following are the steps when done manually from the vCenter console:

  • Click on "File",

  • Select "Deploy OVF tempolate"

  • I select the source : "file" or "url"

  • I give the Vapp a name and select the inventory location.

  • Then I select the ESX host where I want my VApp to be installed

  • now I select the data store always local

  • click finsh

this is what I have done so far, not sure if it correct as i don't get no errors!

printf "\nSuccessfully accessed vCenter: %s\n",$IP;

my $DC_views = Vim::find_entity_view(view_type => 'Datacenter');

print $DC_views->name;

my $content = Vim::get_service_content();

my $OVF_Mgr = Vim::get_view(mo_ref => $content->ovfManager);

my $pdp_spec = OvfParseDescriptorParams->new(deploymentOption => "", locale => "");

my $opdr = $OVF_Mgr->ParseDescriptor(ovfDescriptor => $ovfpath, pdp => $pdp_spec);

Thanks

Reply
0 Kudos
2 Replies
lamw
Community Manager
Community Manager

Take a look at this blog article on both import and export an OVF using the vSphere API - http://www.doublecloud.org/2010/04/how-to-import-and-export-ovf-packages/

Though the full examples above are using the VI Java SDK, you will get an idea of the API methods to use and the order in which to use them.

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

William Lam

VMware vExpert 2009,2010

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".

Reply
0 Kudos
SamancchiTim
Contributor
Contributor

Thanks Lamw. Will keep you in the loop

Reply
0 Kudos