Hi,

You need to pass the userdata (not user-data) as a base64 encoded string (try 
https://www.base64encode.org/ or the base64 command on Linux).

template=7bf01470-e3a5-4f37-b035-023c663c1b48
service=80b47022-a341-446f-a14a-128b85a099d0
zone=530cb1c3-1c90-4055-816e-3b58fbf9de91
keypair=mykey
userdata="$(base64 ./user-data)"

cmk deploy virtualmachine templateid="$template"
serviceofferingid="$service" zoneid="$zone" keypair="$keypair"
userdata="$userdata"

Thanks,
David
________________________________
From: Poulpatine <poulpat...@gmail.com>
Sent: Wednesday, September 2, 2020 3:21 PM
To: users@cloudstack.apache.org <users@cloudstack.apache.org>
Subject: Pass userdata with CMK

Hi,

I'm trying to pass userdata in cmk command line during virtual machine
deployment but I can't figure how to do that.

Among other tests, I've tried something like that in a very basic shell
script:

#!/bin/bash

cli=cmk
template=7bf01470-e3a5-4f37-b035-023c663c1b48
service=80b47022-a341-446f-a14a-128b85a099d0
zone=530cb1c3-1c90-4055-816e-3b58fbf9de91
keypair=mykey
userdata="$(sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' user-data)"

$ cli deploy virtualmachine templateid="$template"
serviceofferingid="$service" zoneid="$zone" keypair="$keypair"
user-data="$userdata"

But I still can't figure how to make it.

Do you have any suggestions?

Many thanks.

--
\o/ Poulpatine \o/

david.jum...@shapeblue.comĀ 
www.shapeblue.com
3 London Bridge Street,  3rd floor, News Building, London  SE1 9SGUK
@shapeblue
  
 

Reply via email to