0 Replies Latest reply on Feb 22, 2018 8:44 AM by MrCommander

    Unexpected arguments while elevating FolderOperations::CreateFolder subroutine

    MrCommander Lurker

      Hi! We have vCenter v6.0 installation and i'm trying to write a Perl script. One part of this script should create a folder. For example - called "123"

      Here is the perl code I wrote:

      $folder = Vim::find_entity_view( view_type => 'Folder', filter => { 'name' => $folder_name } );

      $folder=$folder->CreateFolder("123");

       

      Unfortunately, an error occured:

       

      Odd number of elements in hash assignment at (eval 186) line 4.

      Unexpected arguments: 123 at (eval 52) line 143.

      VimService::build_arg_string(ARRAY(0x37ccdd8), HASH(0x37ccd60)) called at (eval 52) line 1183

      VimService::CreateFolder(VimService=HASH(0x32b2c98), "_this", ManagedObjectReference=HASH(0x42623a8), 123, undef) called at /usr/share/perl/5.22/VMware/VICommon.pm line 1884

      ViewBase::invoke(Folder=HASH(0x418b420), "CreateFolder", 123, undef) called at (eval 186) line 5

      FolderOperations::CreateFolder(Folder=HASH(0x418b420), 123) called at /var/www/html/perl/createvm.pl line 94

      main::deploy_template() called at /var/www/html/perl/createvm.pl line 174

       

      Can somebody assist? How should i fix this?