<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can't create folder in vCenter using perl. in vSphere Command-Line Interface Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/Can-t-create-folder-in-vCenter-using-perl/m-p/1428908#M703</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;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"&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Here is the perl code I wrote:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;$folder = Vim::find_entity_view( view_type =&amp;gt; 'Folder', filter =&amp;gt; { 'name' =&amp;gt; $folder_name } );&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;$folder=$folder-&amp;gt;CreateFolder("123");&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Unfortunately, an error occured:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Odd number of elements in hash assignment at (eval 186) line 4.&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Unexpected arguments: 123 at (eval 52) line 143.&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;VimService::build_arg_string(ARRAY(0x37ccdd8), HASH(0x37ccd60)) called at (eval 52) line 1183&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;VimService::CreateFolder(VimService=HASH(0x32b2c98), "_this", ManagedObjectReference=HASH(0x42623a8), 123, undef) called at /usr/share/perl/5.22/VMware/VICommon.pm line 1884&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;ViewBase::invoke(Folder=HASH(0x418b420), "CreateFolder", 123, undef) called at (eval 186) line 5&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;FolderOperations::CreateFolder(Folder=HASH(0x418b420), 123) called at /var/www/html/perl/createvm.pl line 94&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;main::deploy_template() called at /var/www/html/perl/createvm.pl line 174&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Can somebody assist? How should i fix this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Feb 2018 08:17:49 GMT</pubDate>
    <dc:creator>MrCommander</dc:creator>
    <dc:date>2018-02-27T08:17:49Z</dc:date>
    <item>
      <title>Can't create folder in vCenter using perl.</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/Can-t-create-folder-in-vCenter-using-perl/m-p/1428908#M703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;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"&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Here is the perl code I wrote:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;$folder = Vim::find_entity_view( view_type =&amp;gt; 'Folder', filter =&amp;gt; { 'name' =&amp;gt; $folder_name } );&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;$folder=$folder-&amp;gt;CreateFolder("123");&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Unfortunately, an error occured:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Odd number of elements in hash assignment at (eval 186) line 4.&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Unexpected arguments: 123 at (eval 52) line 143.&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;VimService::build_arg_string(ARRAY(0x37ccdd8), HASH(0x37ccd60)) called at (eval 52) line 1183&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;VimService::CreateFolder(VimService=HASH(0x32b2c98), "_this", ManagedObjectReference=HASH(0x42623a8), 123, undef) called at /usr/share/perl/5.22/VMware/VICommon.pm line 1884&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;ViewBase::invoke(Folder=HASH(0x418b420), "CreateFolder", 123, undef) called at (eval 186) line 5&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;FolderOperations::CreateFolder(Folder=HASH(0x418b420), 123) called at /var/www/html/perl/createvm.pl line 94&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;main::deploy_template() called at /var/www/html/perl/createvm.pl line 174&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P style="margin: 2px; border: 0px none; font-size: 14px; font-family: proxima-nova, Arial, sans-serif; vertical-align: baseline; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 18px; color: rgb(102, 102, 102);"&gt;Can somebody assist? How should i fix this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2018 08:17:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/Can-t-create-folder-in-vCenter-using-perl/m-p/1428908#M703</guid>
      <dc:creator>MrCommander</dc:creator>
      <dc:date>2018-02-27T08:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create folder in vCenter using perl.</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/Can-t-create-folder-in-vCenter-using-perl/m-p/1428909#M704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15275776012938415" data-renderedposition="50_8_1232_32" jivemacro_uid="_15275776012938415"&gt;&lt;SPAN style="color: #afad24;"&gt;&lt;STRONG&gt;my&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #34bbc8;"&gt;&lt;STRONG&gt;$folder&lt;/STRONG&gt;&lt;/SPAN&gt; = Vim::find_entity_view( &lt;SPAN style="color: #d53bd3;"&gt;&lt;STRONG&gt;view_type&lt;/STRONG&gt;&lt;/SPAN&gt; =&amp;gt; &lt;SPAN style="color: #d53bd3;"&gt;&lt;STRONG&gt;'Folder'&lt;/STRONG&gt;&lt;/SPAN&gt;, &lt;SPAN style="color: #d53bd3;"&gt;&lt;STRONG&gt;filter&lt;/STRONG&gt;&lt;/SPAN&gt; =&amp;gt; { &lt;SPAN style="color: #d53bd3;"&gt;&lt;STRONG&gt;'name'&lt;/STRONG&gt;&lt;/SPAN&gt; =&amp;gt; &lt;SPAN style="color: #d53bd3;"&gt;&lt;STRONG&gt;"Templates"&lt;/STRONG&gt;&lt;/SPAN&gt; } );&lt;BR /&gt;&lt;STRONG&gt;$folder-&amp;gt;CreateFolder&lt;/STRONG&gt;&lt;SPAN style="color: #ffffff;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #d53bd3;"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ffffff;"&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d53bd3;"&gt;&lt;STRONG&gt;"123"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ffffff;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to tell the method "CreateFolder" the new of the new folder as a hash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you can find the docu: &lt;A href="https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.Folder.html#createFolder" title="https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.Folder.html#createFolder"&gt;https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.Folder.html#createFolder&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2018 07:06:09 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/Can-t-create-folder-in-vCenter-using-perl/m-p/1428909#M704</guid>
      <dc:creator>aleex42</dc:creator>
      <dc:date>2018-05-29T07:06:09Z</dc:date>
    </item>
  </channel>
</rss>

