title: Openstack API - Creating instances does not accept user-data = <bash script>
body: <p>I am automating instance creation using OpenstackSDK and passing bash script with commands as userdata. But the script does not excute even though the instance is crated. When I do this manually via GUI, the bash scripts executes fine to the newly created instance.</p>
  
  <pre><code>#Reading bash script
   with open('elk.sh', 'r') as f:
          init_script = f.read()
  
  server = conn.compute.create_server(
          name=name,
          image_id=IMAGE_ID,
          flavor_id=FLAVOUR_ID,
          networks=[{"uuid": NETWORK_ID}],
          user_data=init_script,    # pass script to the instance
          key_name=KEY_PAIR
      ) 
  </code></pre>
  
  <p>Note: Also tried to encode as Base64 file butstill failed with
    is not JSON serializable.</p>
  
  <p>Code snippet:</p>
  
  <pre><code> with open(USER_DATA,'r') as file:
          f = file.read()
          bytes_content = bytes(f,encoding='utf-8')
          init_script = base64.b64encode(bytes_content)
  </code></pre>
  
  <p>Can anyone advice on this, please?</p>
  
  <p>Thanks</p>