Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

Need help: Using SDK perl for creating a new Datacenter

$
0
0

Hi All,

     I'm very new to using Vmware SDK for Perl and I'm stuck with some very basic issues. I'm trying to create a new Datacenter using the below code but its failing and I am not able to debug. Can anyone point out what is the error I'm doing?

 

#### begin code #####

 

 

use strict;

use Getopt::Long;

 

 

#VMware Connection libs

use VMware::VIRuntime;

use VMware::VILib;

 

 

my $vcname="alpha-vc-10";

 

my $service_url = "https://".$vcname."/sdk/vimService";

my $vim = Vim->new(service_url => $service_url);

 

$vim->login(user_name => "username", password => "my_password");

 

my $view = $vim->find_entity_view(view_type=>'Folder');

my $result = $view->name->CreateDatacenter("New_DataCenter");

 

# Disconnect from the server

Util::disconnect();

 

 

 

#### end code ####

 

My error is: Failed executing command. Exception: Can't load class 'Datacenters' at C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\lib/VMware/VIMRuntime.pm line 52.

 

I'm using SDK reference manual : https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/index-methods.html

 

Thanks.


Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>