vSphere

 View Only
  • 1.  Not able to create Server side objects using Perl Sdk

    Broadcom Employee
    Posted Jan 15, 2014 09:29 AM

    Problem : They are Two scripts

                 Script A : Scans for the propertires and stores in a disks

                 Script B : loads the file and start's creating the objects ("not able to create objects");

    If i remove storable perl library or disable any of the function related to the library objects are getting created

    Code snippet :

         use Storable;

         use VMware::VIRuntime;

         

         my $url = "https://".$desip."/sdk/vimService";

         Util::connect($url , $desur, $despwd);

          my $hashref = retrieve('file');

      # Creating a Sample object

         my $cpu = ResourceAllocationInfo->new ();

    o/p:

    perl storable-error.pl
    Undefined subroutine &ResourceAllocationInfo::new called at storable-error.pl line 27.

    Even tried DBM:DEEP facing the same issue Could any one help me out with the issue Thank you



  • 2.  RE: Not able to create Server side objects using Perl Sdk

    Posted Jan 16, 2014 04:13 PM

    Not sure I fully understand your script process -

    You want to capture an existing configuration by storing the inventory data with the Storable module?  Then create that object in another vCenter inventory by just loading the Storable hash data?

    That won't work simply because references change between inventories (so the parent and other items will not exist).  Also, many of the data objects have to be converted to proper function arguments for the create/modify calls.

    Can you explain your logic a bit further or post a larger sample script?