New Question

dev-rowbot's profile - activity

2020-08-05 16:20:00 +0300 received badge  Notable Question (source)
2020-08-05 16:20:00 +0300 received badge  Famous Question (source)
2020-05-13 18:57:02 +0300 received badge  Commentator
2020-05-13 18:57:02 +0300 commented answer Failure running multipart shellscript with Terraform and OpenStack

Great - thank you

2020-05-13 17:54:58 +0300 received badge  Self-Learner (source)
2020-05-13 17:54:58 +0300 received badge  Teacher (source)
2020-05-13 17:54:57 +0300 marked best answer Failure running multipart shellscript with Terraform and OpenStack

Hi,

I am hitting an issue when launching Windows 2012R2 images on OpenStack Stein using Terraform. I initially thought though issue was with my image but I have used the "eval" image from Cloudbase and the results are the same. Cloud-init is working fine and all the standard provisioning seems to work but when I try execute multipart userdata that consists of 2 shell scripts fail to execute.

The backtrace for each script is identical:

2020-04-29 14:04:58.381 924 DEBUG cloudbaseinit.plugins.common.userdata [-] Executing userdata plugin: ShellScriptPlugin _process_part c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py:145
2020-04-29 14:04:58.396 924 ERROR cloudbaseinit.plugins.common.userdata [-] Exception during multipart part handling: text/x-shellscript, None
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata [-] object of type 'NoneType' has no len()
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata Traceback (most recent call last):
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py", line 153, in _process_part
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata     ret_val = user_data_plugin.process(part)
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\plugins\common\userdataplugins\shellscript.py", line 36, in process
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata     target_path = os.path.join(tempfile.gettempdir(), file_name)
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\ntpath.py", line 110, in join
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata     p_drive, p_path = splitdrive(p)
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\ntpath.py", line 159, in splitdrive
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata     if len(p) > 1:
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata TypeError: object of type 'NoneType' has no len()
2020-04-29 14:04:58.412 924 ERROR cloudbaseinit.plugins.common.userdata

I am not sure where to start looking for a solution.

I have pasted the full output here: https://pastebin.com/FkpGQfWK

2020-05-13 12:00:56 +0300 commented answer Failure running multipart shellscript with Terraform and OpenStack

ok great - should I open a issue on the cloudbase github page with these same details?

2020-05-12 18:19:28 +0300 received badge  Famous Question (source)
2020-05-05 16:54:22 +0300 received badge  Editor (source)
2020-05-05 16:54:22 +0300 edited answer Failure running multipart shellscript with Terraform and OpenStack

Quite by chance I managed to figure out why this is failing. When creating the terraform template_cloudinit_config I had

2020-05-05 16:51:49 +0300 answered a question Failure running multipart shellscript with Terraform and OpenStack

Quite by chance I managed to figure out why this is failing. When creating the terraform "templatecloudinitconfig" I had

2020-05-04 13:47:18 +0300 received badge  Notable Question (source)
2020-05-01 12:17:47 +0300 received badge  Popular Question (source)
2020-04-30 09:13:55 +0300 received badge  Enthusiast
2020-04-29 19:21:15 +0300 asked a question Failure running multipart shellscript with Terraform and OpenStack

Failure running multipart shellscript with Terraform and OpenStack Hi, I am hitting an issue when launching Windows 201

2017-11-01 08:09:30 +0300 received badge  Famous Question (source)
2017-06-19 16:07:18 +0300 commented answer user_data in MultipartMime is base64 encoded

Hi Adrian, Just realised I had not marked this as fixed. I have used the beta installer a couple times with no further issues. Do you know when this will become official?

2017-06-12 13:32:44 +0300 received badge  Notable Question (source)
2017-06-12 10:07:19 +0300 commented answer user_data in MultipartMime is base64 encoded

Hi Adrian - the beta installer worked great! The user_data still shows as base64 encoded in the log but the script is executed correctly and I can see the decoded content in c:\cfn. Thank you for your help

2017-06-08 08:41:19 +0300 commented answer user_data in MultipartMime is base64 encoded

Thanks Adrian, I'll keep monitoring this case for updates

2017-06-07 23:35:01 +0300 received badge  Popular Question (source)
2017-06-07 16:50:03 +0300 commented answer user_data in MultipartMime is base64 encoded

Thanks Adrian - for now I'll execute the 1 script inline and pull/execute anything else required from another web server. Out of interest is there a guide on how to get setup for cloudbase-init development? I don't mind making/testing minor changes myself

2017-06-07 16:05:44 +0300 commented answer user_data in MultipartMime is base64 encoded

I get the same result using the 2013-05-23 template version. Does cloudbase-init decode the content when the mime Content-Transfer-Encoding is base64?

2017-06-07 15:45:29 +0300 commented answer user_data in MultipartMime is base64 encoded

We are using the stable/ocata branch, tag version 15.1.3

2017-06-07 15:05:42 +0300 commented answer user_data in MultipartMime is base64 encoded

Hi Adrian I have defined my MultipartMime as per the AD Controller example but unfortunately the behaviour is the same. Debug -> https://pastebin.com/by1pkRj3 The cfn-userdata is still base64 encoded and I can see this WARNING in the debug log: Unsupported user_data format

2017-06-07 12:35:57 +0300 asked a question user_data in MultipartMime is base64 encoded

Hi,

Using HEAT Templating. I am trying to make use of OS::Heat::MultipartMime to send a Powershell script and PEM certificate as user_data.

My initial yaml file can be found here: https://pastebin.com/29tqUnPR

My script is based on these examples:

The problem I am having is that no matter what I subtype I set for the Powershell script, it is always base64 encoded and it is not executed by Cloudbase-Init. Please see the debug log for more info --> https://pastebin.com/cSFTP4ae

I have tried setting the subtype to both x-shellscript and x-cfninitdata. With x-shellscript defined clousbase-init attempts to execute the script but does not decode it before execution and the execution fails.

I can get the script working if I "inline" the data and do not use MultipartMime: https://pastebin.com/DZB1vy9F

My goal is to pass the certificate (to be used by the WinRM plugin) and a few shell scripts (to configure services and add this host to the domain) to the Windows Instance but I cannot find any examples of this.

Is this possible?

2017-06-07 11:59:05 +0300 commented answer COM Port Permission Denied

Hi Adrian Thank you for the feedback. I changed the install to use the same user that packer uses during the provisioning since I know for sure this user has local administrator rights and now the COM port works.

2017-06-07 11:56:05 +0300 received badge  Scholar (source)
2017-06-07 08:30:54 +0300 received badge  Popular Question (source)
2017-06-05 14:45:08 +0300 asked a question COM Port Permission Denied

Hi,

I am trying to boot a Windows 2012R2 image that I built myself with Packer and add it to our Domain. When installing Cloudbase-Init I pass LOGGINGSERIALPORTNAME=COM1 on the command line.

$p = Start-Process -Wait -PassThru -FilePath msiexec -ArgumentList "/i C:\Windows\Temp\cloudbase-init.msi /qn /l*v C:\Windows\Temp\cloudbase-init.log USERNAME=$username NETWORKADAPTERNAME=""$networkAdapterName"""

I've added a script to the user_data field which will add the server to the domain on boot. The script executes and returns 1001 to trigger a reboot. However, after the reboot there are a lot of errors regarding access to COM1.

cloudbaseinit.utils.log [-] could not open port 'COM1': PermissionError(13, 'Access is denied.', None, 5) _open c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\log.py:71
cloudbaseinit.utils.log [-] could not open port 'COM1': PermissionError(13, 'Access is denied.', None, 5) _open c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\log.py:71
cloudbaseinit.utils.log [-] could not open port 'COM1': PermissionError(13, 'Access is denied.', None, 5) _open c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\log.py:71
cloudbaseinit.utils.log [-] could not open port 'COM1': PermissionError(13, 'Access is denied.', None, 5) _open c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\log.py:71
cloudbaseinit.utils.log [-] could not open port 'COM1': PermissionError(13, 'Access is denied.', None, 5) _open c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\log.py:71
cloudbaseinit.utils.log [-] could not open port 'COM1': PermissionError(13, 'Access is denied.', None, 5) _open c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\log.py:71
cloudbaseinit.shell [-] maximum recursion depth exceeded
cloudbaseinit.shell Traceback (most recent call last):
cloudbaseinit.shell   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\log.py", line 66, in _open
cloudbaseinit.shell     bytesize=int(settings[3]))
cloudbaseinit.shell   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\serial\serialwin32.py", line 31, in __init__
cloudbaseinit.shell     super(Serial, self).__init__(*args, **kwargs)
cloudbaseinit.shell   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\serial\serialutil.py", line 240, in __init__
cloudbaseinit.shell     self.open()
cloudbaseinit.shell   File "c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\serial\serialwin32.py", line 62, in open
cloudbaseinit.shell     raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
cloudbaseinit.shell serial.serialutil.SerialException: could not open port 'COM1': PermissionError(13, 'Access is denied.', None, 5)

This repeats quite a few times and then Cloudbase-Init seems to exit before configuring WinRM and injecting the Administrator password. Trying to get the password returns an empty string as well.

If I remove COM1 from the install command then the execution completes BUT I do not get any log output in Openstack.

Is there any reason why access to COM1 would be denied after adding the server to the domain and rebooting?

My first thoughts were group policy ... (more)