New Question

Revision history [back]

click to hide/show revision 1
initial version

Error when running powershell commands

I'm using vRA to deploy a blue print. Within the cloud-config section of the YAML code, I'm attempting to run PowerShell commands.

  cloudConfig: |
    #ps1_sysnative
      new-item -Path 'c:\myfolder' -itemtype directory
      Copy-Item -Path '\\p10ittech01\vRATest\Hashing-2.1.exe' -Destination 'c:\myfolder'
      install-windowsFeature -name web-server -includeManagementTools
      Set-NetfirewallProfile -Profile Domain,Public,Private -Enabled False

The PS commands are unsuccessful and I receive the following error message in the logs: 2020-07-17 11:49:23.169 2160 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdataplugins.heat.HeatPlugin' loadclass C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init [-] plugin 'UserDataPlugin' failed with error 'while scanning a simple key in "<byte string="">", line 8, column 3 could not find expected ':' in "<byte string="">", line 9, column 3': yaml.scanner.ScannerError: while scanning a simple key 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init [-] while scanning a simple key in "<byte string="">", line 8, column 3 could not find expected ':' in "<byte string="">", line 9, column 3: yaml.scanner.ScannerError: while scanning a simple key in "<byte string="">", line 8, column 3 could not find expected ':' in "<byte string="">", line 9, column 3 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init Traceback (most recent call last): 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\init.py", line 67, in _execplugin 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init shareddata) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py", line 57, in execute 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init return self.processuserdata(userdata, service) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py", line 126, in _processuserdata 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init return self.processnonmultipart(userdata, service) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py", line 203, in processnonmultipart 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init retval = cloudconfigplugin.processnonmultipart(userdata) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdataplugins\cloudconfig.py", line 110, in processnonmultipart 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init executor = CloudConfigPluginExecutor.fromyaml(part) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdataplugins\cloudconfig.py", line 65, in fromyaml 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init content = yaml.load(stream, Loader=loader) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\yaml_init.py", line 114, in load 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init return loader.getsingledata() 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\yaml\constructor.py", line 49, in getsingledata 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init node = self.getsinglenode() 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "ext_yaml.pyx", line 707, in _yaml.CParser.getsinglenode 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "ext_yaml.pyx", line 725, in _yaml.CParser.composedocument 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "ext_yaml.pyx", line 776, in _yaml.CParser.composenode 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "ext_yaml.pyx", line 890, in _yaml.CParser.composemappingnode 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "ext_yaml.pyx", line 776, in yaml.CParser.composenode 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "ext_yaml.pyx", line 892, in _yaml.CParser.composemappingnode 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "ext_yaml.pyx", line 905, in yaml.CParser.parsenextevent 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init yaml.scanner.ScannerError: while scanning a simple key 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init in "<byte string="">", line 8, column 3 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init could not find expected ':' 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init in "<byte string="">", line 9, column 3 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init 2020-07-17 11:49:23.200 2160 INFO cloudbaseinit.init [-] Plugins execution done 2020-07-17 11:49:23.200 2160 INFO cloudbaseinit.init [-] Stopping Cloudbase-Init service 2020-07-17 11:49:26.202 2160 DEBUG cloudbaseinit.osutils.windows [-] Stopping service cloudbase-init stop_service C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1140