Return-Path: X-Original-To: apmail-stratos-dev-archive@minotaur.apache.org Delivered-To: apmail-stratos-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 698EC10598 for ; Sat, 29 Mar 2014 06:24:37 +0000 (UTC) Received: (qmail 51212 invoked by uid 500); 29 Mar 2014 06:24:36 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 51173 invoked by uid 500); 29 Mar 2014 06:24:36 -0000 Mailing-List: contact dev-help@stratos.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.incubator.apache.org Delivered-To: mailing list dev@stratos.incubator.apache.org Received: (qmail 51166 invoked by uid 99); 29 Mar 2014 06:24:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Mar 2014 06:24:34 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nirmal070125@gmail.com designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-ig0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Mar 2014 06:24:30 +0000 Received: by mail-ig0-f176.google.com with SMTP id uy17so1692256igb.9 for ; Fri, 28 Mar 2014 23:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=2hp86KsVZBCDUgmMxXkFDCr1iG7ZtLxzwH+9+wgMRLQ=; b=CE7RJ4QKCmF2nfL9dOWt2gKPS+jfdZgHnooPfg6LGs1jXaGi7pbCpHy7gyV7Jq7hmZ gj8fj5PqX5wayO9EDoRb7QQS0sTxSfgUR7eKnsxk1QhsCPJAXM3VU3CraAiy14U4v2h5 0NFJohAWsmalhUHGcnDEGVtk4yk5b/E4BFxbbIFOZXTO533blpvIvQFhra9aTEV4SHQ8 AG5bTbzPCEJOef/ex95bzVeioaSK0hOA3lgvkdQagzZvBzQXadpYF7dW2lN+o1+5niEL +ww+JH3nXSQpIN9WEyxQmDoZMENCFwgF5XvVI+keBFqbnnnlftJgZm8PWM3bELQ1AzAA smhg== MIME-Version: 1.0 X-Received: by 10.42.41.212 with SMTP id q20mr343798ice.80.1396074250069; Fri, 28 Mar 2014 23:24:10 -0700 (PDT) Received: by 10.64.12.134 with HTTP; Fri, 28 Mar 2014 23:24:09 -0700 (PDT) In-Reply-To: References: <7382487.ztJP4WPFTn@shahhaqu-w520.cisco.com> Date: Sat, 29 Mar 2014 11:54:09 +0530 Message-ID: Subject: Re: Passing Payload to VMware vCloud VMs From: Nirmal Fernando To: "dev@stratos.incubator.apache.org" Content-Type: multipart/alternative; boundary=20cf301d3d7ec16ad004f5b8dd8f X-Virus-Checked: Checked by ClamAV on apache.org --20cf301d3d7ec16ad004f5b8dd8f Content-Type: text/plain; charset=ISO-8859-1 Hi Isuru, Great work! Have you also considered implementing VcloudPartitionValidator? On Sat, Mar 22, 2014 at 8:06 PM, Lahiru Sandaruwan wrote: > Great ! > > > On Sat, Mar 22, 2014 at 7:31 AM, Isuru Haththotuwa wrote: > >> Awesome! great work! >> >> >> On Sat, Mar 22, 2014 at 8:18 AM, Lakmal Warusawithana wrote: >> >>> Great work Isuru! >>> >>> >>> On Sat, Mar 22, 2014 at 1:58 AM, Isuru Perera wrote: >>> >>>> Hi all, >>>> >>>> I was able to test a PHP cartridge and an LB cartridge successfully on >>>> vCloud! >>>> >>>> I will document the steps to create the cartridges and will share soon. >>>> >>>> Thanks! >>>> >>>> Best Regards, >>>> >>>> >>>> On Fri, Mar 21, 2014 at 9:34 AM, Isuru Perera wrote: >>>> >>>>> Hi all, >>>>> >>>>> I committed all changes did for using a customization script to pass >>>>> payloads to VMs. >>>>> >>>>> Please note that I used the property name "shellType", not the >>>>> "shell_type" as discussed. >>>>> >>>>> Now when spawning an instance for vCloud, the relevant script file is >>>>> read and the "PAYLOAD" string will be replaced by the actual payload being >>>>> passed. >>>>> >>>>> For example: >>>>> repository/conf/scripts/*sh*/*customization* >>>>> >>>>> #!/bin/sh >>>>> mkdir -p /tmp/payload >>>>> echo "PAYLOAD" > /tmp/payload/launch-params >>>>> /root/bin/init-vcloud.sh >>>>> >>>>> Note that I call the init-vcloud.sh script from the customization >>>>> script itself, unlike in EC2/OpenStack where we execute the init script >>>>> from /etc/rc.local. >>>>> >>>>> The reason for this is that we need to make sure the init is executed >>>>> only after the payload values were written to the temp file. >>>>> >>>>> I'm working on testing some cartridges on vCloud now. >>>>> >>>>> Thanks! >>>>> >>>>> Best Regards, >>>>> >>>>> >>>>> On Wed, Mar 19, 2014 at 10:40 AM, Isuru Perera wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> I'm going put these scripts into repository/conf and the >>>>>> "customization" script will be under a specific shell_type directory. >>>>>> >>>>>> The name "customization" will be a constant. >>>>>> >>>>>> For example, for "sh" >>>>>> >>>>>> repository/conf/scripts/*sh*/*customization* >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Mar 14, 2014 at 7:01 PM, Isuru Perera wrote: >>>>>> >>>>>>> An update on my effort: >>>>>>> >>>>>>> I was trying to get the customization script working on vCloud and >>>>>>> it was not working. >>>>>>> >>>>>>> I just figured out the issue. >>>>>>> >>>>>>> The script on Ubuntu is invoked via "sh" and I was trying the >>>>>>> following sample script to test. >>>>>>> >>>>>>> #!/bin/bash >>>>>>> echo $1 >>>>>>> mkdir /root/isurutest >>>>>>> if [ x$1 == x"precustomization" ]; then >>>>>>> echo "Do Precustomization tasks " `date` > pretasks >>>>>>> elif [ x$1 == x"postcustomization" ]; then >>>>>>> echo "Do Postcustomization tasks " `date` > posttasks >>>>>>> fi >>>>>>> >>>>>>> So this script gives an error. >>>>>>> >>>>>>> precustomization >>>>>>> /root/.customization/customize.sh: 4: [: xprecustomization: >>>>>>> unexpected operator >>>>>>> /root/.customization/customize.sh: 6: [: xprecustomization: >>>>>>> unexpected operator >>>>>>> >>>>>>> The customization script log can be found at >>>>>>> /var/log/vmware-imc/customization.log >>>>>>> >>>>>>> The script is saved at /root/.customization/customize.sh >>>>>>> >>>>>>> I should make sure that the script is working with "sh". >>>>>>> >>>>>>> Also the script will not be updated even if we change it from VMware >>>>>>> vCloud Director interface. I hope this won't be a problem when spawning the >>>>>>> instance via jclouds. >>>>>>> >>>>>>> Now that I found out how customization script works, I will go ahead >>>>>>> do the code changes. >>>>>>> >>>>>>> Thanks! >>>>>>> >>>>>>> Best Regards, >>>>>>> >>>>>>> >>>>>>> On Fri, Mar 14, 2014 at 6:50 PM, Isuru Perera wrote: >>>>>>> >>>>>>>> Hi Shaheed, >>>>>>>> >>>>>>>> Thanks for the suggestion. >>>>>>>> >>>>>>>> The plan is to use the customization script and send the payload to >>>>>>>> vCloud VM. Then we plan to configure the base image to read those payload >>>>>>>> and run puppet agent etc. >>>>>>>> >>>>>>>> >>>>>>>> On Thu, Mar 13, 2014 at 2:37 PM, Shaheed Haque wrote: >>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Please ensure that Python2 and Python3 are possible options! >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> (If nothing else, we probably want to encourage people towards >>>>>>>>> these higher layers rather than bash/cmd/etc.) >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Thursday 13 March 2014 11:28:36 Isuru Perera wrote: >>>>>>>>> >>>>>>>>> Planning to implement following solution. >>>>>>>>> >>>>>>>>> 1. Define "shell_type" as a property in Cartridge Definition. >>>>>>>>> Possible values can be "bash", "sh", "cmd", etc. >>>>>>>>> >>>>>>>>> 2. Dynamically create a customization script based on "shell_type" >>>>>>>>> in vCloud IaaS implementation. >>>>>>>>> >>>>>>>>> I will try to implement this in an extensible way (without code >>>>>>>>> modifications) for any shell_type. >>>>>>>>> >>>>>>>>> Thanks! >>>>>>>>> >>>>>>>>> Best Regards, >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Thu, Mar 13, 2014 at 10:32 AM, Isuru Perera >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>> Thanks Udara for the information. >>>>>>>>> >>>>>>>>> So, it seems we have to go ahead with the use of customization >>>>>>>>> script in vCloud. >>>>>>>>> >>>>>>>>> Next problem is that the script is dependent on the target >>>>>>>>> Cartridge OS. >>>>>>>>> >>>>>>>>> Please let me know if you have any suggestions to solve this >>>>>>>>> problem. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Thu, Mar 13, 2014 at 7:44 AM, Udara Liyanage >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>> AFIR the metadata is read by a init script inside the instance, >>>>>>>>> not the cartridge agent. >>>>>>>>> In EC2 and Openstack we can pass the user data using jclouds API. >>>>>>>>> However it can not be done in VCloud scenario. In VCloud custom metadata >>>>>>>>> can be stored in VApp. However in order retrieve username/password are >>>>>>>>> needed. >>>>>>>>> >>>>>>>>> I'v written to some blog post where they suggest to go via script >>>>>>>>> as Isuru is trying. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Touched, not typed. Erroneous words are a feature, not a typo. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>>> Isuru Perera >>>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>>>>>>> Lean . Enterprise . Middleware >>>>>>>>> >>>>>>>>> about.me/chrishantha >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>>> Isuru Perera >>>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>>>>>>> Lean . Enterprise . Middleware >>>>>>>>> >>>>>>>>> about.me/chrishantha >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Isuru Perera >>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>>>>>> Lean . Enterprise . Middleware >>>>>>>> >>>>>>>> about.me/chrishantha >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Isuru Perera >>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>>>>> Lean . Enterprise . Middleware >>>>>>> >>>>>>> about.me/chrishantha >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Isuru Perera >>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>>>> Lean . Enterprise . Middleware >>>>>> >>>>>> about.me/chrishantha >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Isuru Perera >>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>>> Lean . Enterprise . Middleware >>>>> >>>>> about.me/chrishantha >>>>> >>>> >>>> >>>> >>>> -- >>>> Isuru Perera >>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>> Lean . Enterprise . Middleware >>>> >>>> about.me/chrishantha >>>> >>> >>> >>> >>> -- >>> Lakmal Warusawithana >>> Software Architect; WSO2 Inc. >>> Mobile : +94714289692 >>> Blog : http://lakmalsview.blogspot.com/ >>> >>> >> >> >> -- >> Thanks and Regards, >> >> Isuru H. >> +94 716 358 048* * >> >> >> > > > -- > -- > Lahiru Sandaruwan > Software Engineer, > Platform Technologies, > WSO2 Inc., http://wso2.com > lean.enterprise.middleware > > email: lahirus@wso2.com cell: (+94) 773 325 954 > blog: http://lahiruwrites.blogspot.com/ > twitter: http://twitter.com/lahirus > linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146 > > -- Best Regards, Nirmal Nirmal Fernando. PPMC Member & Committer of Apache Stratos, Senior Software Engineer, WSO2 Inc. Blog: http://nirmalfdo.blogspot.com/ --20cf301d3d7ec16ad004f5b8dd8f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Isuru,

Great work! Have you also cons= idered implementing VcloudPartitionValidator?


On Sat, Mar 22, 2014 at 8:06 PM,= Lahiru Sandaruwan <lahirus@wso2.com> wrote:
Great !


On S= at, Mar 22, 2014 at 7:31 AM, Isuru Haththotuwa <isuruh@wso2.com> wrote:
Awesome! great work!


On Sat, Mar 22, 2014 at 8:18 AM, Lakmal Warusawithana <= ;lakmal@wso2.com&g= t; wrote:
Great work Isuru!


On Sat,= Mar 22, 2014 at 1:58 AM, Isuru Perera <isurup@wso2.com> wrote= :
Hi all,
<= /div>

I was able to test a PHP cartridge and an LB cartridge succes= sfully on vCloud!

I will document the steps to create the cartridges and will share= soon.

Thanks!

Best Regards,


On Fri, Mar 21, 2014 at= 9:34 AM, Isuru Perera <isurup@wso2.com> wrote:
Hi all,

I committed all changes did for using a customi= zation script to pass payloads to VMs.

Please note that I used the property name "shellType", not th= e "shell_type" as discussed.

Now when spawning an instance for vCloud, the relevant script fil= e is read and the "PAYLOAD" string will be replaced by the actual= payload being passed.

For example:
repository/conf/scripts= /sh/customization

#!/bin/sh=
mkdir -p /tmp/payload
echo "PAYLOAD" > /tmp/payload/launch-= params
/root/bin/init-vcloud.sh

Not= e that I call the init-vcloud.sh script from the customization script itsel= f, unlike in EC2/OpenStack where we execute the init script from /etc/rc.lo= cal.

<= font face=3D"arial,helvetica,sans-serif">The reason for this is that we nee= d to make sure the init is executed only after the payload values were writ= ten to the temp file.

<= font face=3D"arial,helvetica,sans-serif">I'm working on testing some ca= rtridges on vCloud now.

Thanks!

Best Regards,


On Wed, Mar 19, 2014 at 10:40 AM, Isuru Perera <isurup@ws= o2.com> wrote:
Hi all,

I&= #39;m going put these scripts into repository/conf and the "customizat= ion" script will be under a specific shell_type directory.

The name "customization" will be a constant.

For example, for "sh"

repository/conf/scripts/sh/customization




On Fri, Mar 14, 2014 at 7:01 PM, Isuru Perera <isurup@wso2.com> wrote:
An update on= my effort:

I was trying to get the customization script worki= ng on vCloud and it was not working.

I just figured out the issue.

The script on Ubuntu is invo= ked via "sh" and I was trying the following sample script to test= .

#!/bin/bash
echo $1
mkdir /root/isurutest
if [ x$1 =3D=3D x"precustomization" ]; then
echo "Do Precustomization tasks " `date` > pretasks
elif [ x$1 =3D=3D x"postcustomization" ]; then
echo "Do Postcustomization tasks " `date` > posttasks
fi


So this script gives an error.

precustomization
/root/.customizatio= n/customize.sh: 4: [: xprecustomization: unexpected operator
/root/.cust= omization/customize.sh: 6: [: xprecustomization: unexpected operator
=

The customization script log can be found at /var/log/vmware-imc/custo= mization.log

The script is saved at= /root/.customization/customize.sh

I should make sure that the script is = working with "sh".

=
Also the script will not be updated even if we c= hange it from VMware vCloud Director interface. I hope this won't be a = problem when spawning the instance via jclouds.

Now that I found out how customization script works, I will go ahead do= the code changes.

Thanks!

<= /div>
Best Regards,


On Fri,= Mar 14, 2014 at 6:50 PM, Isuru Perera <isurup@wso2.com> wrote= :
Hi Shahe= ed,

Thanks for the suggestion.

The plan is to use the custom= ization script and send the payload to vCloud VM. Then we plan to configure= the base image to read those payload and run puppet agent etc.


On Thu, Mar 13, 2014 at 2:37 PM, Shaheed Haque <shahhaqu@cisco.com= > wrote:

=A0

=A0

Please ensure that Python2 and Pyth= on3 are possible options!

=A0

(If nothing else, we probably want = to encourage people towards these higher layers rather than bash/cmd/etc.)<= /p>

=A0

=A0

On Thursday 13 March 2014 11:28:36 = Isuru Perera wrote:

Planning to implement fol= lowing solution.

1. Define "shell_type" as= a property in Cartridge Definition. Possible values can be "bash"= ;, "sh", "cmd", etc.

2. Dynamically create a customizati= on script based on "shell_type" in vCloud IaaS implementation.
I will try to implement this in an extensible way (without code modif= ications) for any shell_type.

Thanks!

Best Regards,




On Thu, Mar 13, 2014 at 10:32 = AM, Isuru Perera <<= span style=3D"text-decoration:underline;color:rgb(0,87,174)">isurup@wso2.co= m> wrote:

Thanks Udara for the = information.

So, it seems we have to go ahead with the use of custom= ization script in vCloud.

Next problem is that the script is = dependent on the target Cartridge OS.

Please let me know if you have any = suggestions to solve this problem.



On Thu, Mar 13, 2014 = at 7:44 AM, Udara Liyanage <udara= @wso2.com> wrote:

AFIR the metadata i= s read by a init script inside the instance, not the cartridge agent.
In= EC2 and Openstack we can pass the user data using jclouds API. However it = can not be done in VCloud scenario. In VCloud custom metadata can be stored= in VApp. However in order retrieve username/password are needed.

I'v written to = some blog post where they suggest to go via script as Isuru is trying.
<= br>

Touched, not typed.= Erroneous words are a feature, not a typo.




--

Isuru Pe= rera
Senior Software Engineer | WSO2, Inc. |
http://wso2.= com/
Lean . Enterprise . Middleware

about.me/chrishantha




--

Isuru Perera
S= enior Software Engineer | WSO2, Inc. |
http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha






--
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middle= ware

about.me/chrishantha



--
Isuru Perera
Senior Software Engineer | W= SO2, Inc. | htt= p://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha



--
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com= /
Lean . Enterprise . Middleware

about.me/chrishantha



--
Isuru Perera
Senior Software Engineer | W= SO2, Inc. | htt= p://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha



--
Isuru Perera
Senior Software Engineer | W= SO2, Inc. | htt= p://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha



<= /div>--
Lakmal Warusawit= hana
Software Architect; WSO2 Inc.



--
Thanks and Regards,

Isuru = H.



--



--
Best R= egards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of= Apache Stratos,
Senior Software Engineer, WSO2 Inc.

--20cf301d3d7ec16ad004f5b8dd8f--