You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Nux! <nu...@li.nux.ro> on 2014/12/20 11:58:21 UTC

Question about the userdata availability

Hello,

I notice that when a VM is deployed with userdata, this userdata is then available at http://VR/latest/user-data indefinitely, subsequent reboots of the VM will get the userdata again and again.

When the userdata is retrieved is there a way to let the VR know it has been retrieved and can be deleted/deactivated?
Like there is the case with the root password script which send a "DomU_Request: saved_password" header to confirm it.

Lucian



--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

Re: Question about the userdata availability

Posted by Nux! <nu...@li.nux.ro>.
Jeff,

I'll use the script in a very small template I'm making[1]. Userdata scripts was the last important bit missing.
I'm not interested at this time in systemd or upstart, but in the future I'd like to be able to use Ansible for some thing, so cheers for that.

[1] - https://github.com/NuxRo/macchinina

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Jeff Moody" <je...@fifthecho.com>
> To: dev@cloudstack.apache.org
> Sent: Monday, 22 December, 2014 21:49:58
> Subject: Re: Question about the userdata availability

> Go for it. Also in that repo are systemd unit files and Upstart jobs for
> the same.
> 
> The entire repo is an Ansible Playbook for setting up templates from a
> basic OS install. Feel free to use the whole playbook (that's what it's
> on GitHub for ;) ).
> 
> On 12/22/2014 04:27 PM, Nux! wrote:
>> Jeff,
>>
>> Awesome, I'll steal your script. :)
>>
>> Regards,
>> Lucian
>>
>> --
>> Sent from the Delta quadrant using Borg technology!
>>
>> Nux!
>> www.nux.ro
>>
>> ----- Original Message -----
>>> From: "Jeff Moody" <je...@fifthecho.com>
>>> To: dev@cloudstack.apache.org
>>> Sent: Monday, 22 December, 2014 15:07:29
>>> Subject: Re: Question about the userdata availability
>>> I have UserData init scripts that touch a file in the filesystem for the
>>> VM to show that the UD has run and won't re-run on reboot.
>>>
>>> https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-rhel.j2
>>> for RHEL and
>>> https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-debian.j2
>>> for Debian/Ubuntu.
>>>
>>> On 12/22/2014 07:33 AM, Nux! wrote:
>>>> Antoine,
>>>>
>>>> Ok, thanks for clarifying. So it's a feature, not a bug. I'll have to deal with
>>>> it client-side then.
>>>>
>>>> Regards,
>>>> Lucian
>>>>
>>>> --
>>>> Sent from the Delta quadrant using Borg technology!
>>>>
>>>> Nux!
>>>> www.nux.ro
>>>>
>>>> ----- Original Message -----
>>>>> From: "Coetsier, Antoine" <an...@exoscale.ch>
>>>>> To: dev@cloudstack.apache.org, "sebgoa" <ru...@gmail.com>, "Lambiel, Loic"
>>>>> <lo...@exoscale.ch>
>>>>> Sent: Monday, 22 December, 2014 11:55:47
>>>>> Subject: Re: Question about the userdata availability
>>>>> Hello,
>>>>>
>>>>> The user data should stay there until the VM is destroyed, this is the
>>>>> expected behavior for cloud-init for CloudStack but all other stacks too.
>>>>>
>>>>> --
>>>>>
>>>>> Antoine COETSIER
>>>>>
>>>>>
>>>>> Le 22.12.14 11:04, « sebgoa » <ru...@gmail.com> a écrit :
>>>>>
>>>>>> Pinging Loic on this, he most likely has first hand experience with thisŠ
>>>>>>
>>>>>>
>>>>>> On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I notice that when a VM is deployed with userdata, this userdata is
>>>>>>> then available at http://VR/latest/user-data indefinitely, subsequent
>>>>>>> reboots of the VM will get the userdata again and again.
>>>>>>>
>>>>>>> When the userdata is retrieved is there a way to let the VR know it has
>>>>>>> been retrieved and can be deleted/deactivated?
>>>>>>> Like there is the case with the root password script which send a
>>>>>>> "DomU_Request: saved_password" header to confirm it.
>>>>>>>
>>>>>>> Lucian
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Sent from the Delta quadrant using Borg technology!
>>>>>>>
>>>>>>> Nux!
> >>>>>> www.nux.ro

Re: Question about the userdata availability

Posted by Jeff Moody <je...@fifthecho.com>.
Go for it. Also in that repo are systemd unit files and Upstart jobs for 
the same.

The entire repo is an Ansible Playbook for setting up templates from a 
basic OS install. Feel free to use the whole playbook (that's what it's 
on GitHub for ;) ).

On 12/22/2014 04:27 PM, Nux! wrote:
> Jeff,
>
> Awesome, I'll steal your script. :)
>
> Regards,
> Lucian
>
> --
> Sent from the Delta quadrant using Borg technology!
>
> Nux!
> www.nux.ro
>
> ----- Original Message -----
>> From: "Jeff Moody" <je...@fifthecho.com>
>> To: dev@cloudstack.apache.org
>> Sent: Monday, 22 December, 2014 15:07:29
>> Subject: Re: Question about the userdata availability
>> I have UserData init scripts that touch a file in the filesystem for the
>> VM to show that the UD has run and won't re-run on reboot.
>>
>> https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-rhel.j2
>> for RHEL and
>> https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-debian.j2
>> for Debian/Ubuntu.
>>
>> On 12/22/2014 07:33 AM, Nux! wrote:
>>> Antoine,
>>>
>>> Ok, thanks for clarifying. So it's a feature, not a bug. I'll have to deal with
>>> it client-side then.
>>>
>>> Regards,
>>> Lucian
>>>
>>> --
>>> Sent from the Delta quadrant using Borg technology!
>>>
>>> Nux!
>>> www.nux.ro
>>>
>>> ----- Original Message -----
>>>> From: "Coetsier, Antoine" <an...@exoscale.ch>
>>>> To: dev@cloudstack.apache.org, "sebgoa" <ru...@gmail.com>, "Lambiel, Loic"
>>>> <lo...@exoscale.ch>
>>>> Sent: Monday, 22 December, 2014 11:55:47
>>>> Subject: Re: Question about the userdata availability
>>>> Hello,
>>>>
>>>> The user data should stay there until the VM is destroyed, this is the
>>>> expected behavior for cloud-init for CloudStack but all other stacks too.
>>>>
>>>> --
>>>>
>>>> Antoine COETSIER
>>>>
>>>>
>>>> Le 22.12.14 11:04, « sebgoa » <ru...@gmail.com> a écrit :
>>>>
>>>>> Pinging Loic on this, he most likely has first hand experience with thisŠ
>>>>>
>>>>>
>>>>> On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I notice that when a VM is deployed with userdata, this userdata is
>>>>>> then available at http://VR/latest/user-data indefinitely, subsequent
>>>>>> reboots of the VM will get the userdata again and again.
>>>>>>
>>>>>> When the userdata is retrieved is there a way to let the VR know it has
>>>>>> been retrieved and can be deleted/deactivated?
>>>>>> Like there is the case with the root password script which send a
>>>>>> "DomU_Request: saved_password" header to confirm it.
>>>>>>
>>>>>> Lucian
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sent from the Delta quadrant using Borg technology!
>>>>>>
>>>>>> Nux!
>>>>>> www.nux.ro


Re: Question about the userdata availability

Posted by Nux! <nu...@li.nux.ro>.
Jeff,

Awesome, I'll steal your script. :)

Regards,
Lucian

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Jeff Moody" <je...@fifthecho.com>
> To: dev@cloudstack.apache.org
> Sent: Monday, 22 December, 2014 15:07:29
> Subject: Re: Question about the userdata availability

> I have UserData init scripts that touch a file in the filesystem for the
> VM to show that the UD has run and won't re-run on reboot.
> 
> https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-rhel.j2
> for RHEL and
> https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-debian.j2
> for Debian/Ubuntu.
> 
> On 12/22/2014 07:33 AM, Nux! wrote:
>> Antoine,
>>
>> Ok, thanks for clarifying. So it's a feature, not a bug. I'll have to deal with
>> it client-side then.
>>
>> Regards,
>> Lucian
>>
>> --
>> Sent from the Delta quadrant using Borg technology!
>>
>> Nux!
>> www.nux.ro
>>
>> ----- Original Message -----
>>> From: "Coetsier, Antoine" <an...@exoscale.ch>
>>> To: dev@cloudstack.apache.org, "sebgoa" <ru...@gmail.com>, "Lambiel, Loic"
>>> <lo...@exoscale.ch>
>>> Sent: Monday, 22 December, 2014 11:55:47
>>> Subject: Re: Question about the userdata availability
>>> Hello,
>>>
>>> The user data should stay there until the VM is destroyed, this is the
>>> expected behavior for cloud-init for CloudStack but all other stacks too.
>>>
>>> --
>>>
>>> Antoine COETSIER
>>>
>>>
>>> Le 22.12.14 11:04, « sebgoa » <ru...@gmail.com> a écrit :
>>>
>>>> Pinging Loic on this, he most likely has first hand experience with thisŠ
>>>>
>>>>
>>>> On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I notice that when a VM is deployed with userdata, this userdata is
>>>>> then available at http://VR/latest/user-data indefinitely, subsequent
>>>>> reboots of the VM will get the userdata again and again.
>>>>>
>>>>> When the userdata is retrieved is there a way to let the VR know it has
>>>>> been retrieved and can be deleted/deactivated?
>>>>> Like there is the case with the root password script which send a
>>>>> "DomU_Request: saved_password" header to confirm it.
>>>>>
>>>>> Lucian
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent from the Delta quadrant using Borg technology!
>>>>>
>>>>> Nux!
> >>>> www.nux.ro

Re: Question about the userdata availability

Posted by Jeff Moody <je...@fifthecho.com>.
I have UserData init scripts that touch a file in the filesystem for the 
VM to show that the UD has run and won't re-run on reboot.

https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-rhel.j2 
for RHEL and 
https://github.com/fifthecho/CloudStack-Template/blob/master/templates/cloud-run-userdata-debian.j2 
for Debian/Ubuntu.

On 12/22/2014 07:33 AM, Nux! wrote:
> Antoine,
>
> Ok, thanks for clarifying. So it's a feature, not a bug. I'll have to deal with it client-side then.
>
> Regards,
> Lucian
>
> --
> Sent from the Delta quadrant using Borg technology!
>
> Nux!
> www.nux.ro
>
> ----- Original Message -----
>> From: "Coetsier, Antoine" <an...@exoscale.ch>
>> To: dev@cloudstack.apache.org, "sebgoa" <ru...@gmail.com>, "Lambiel, Loic" <lo...@exoscale.ch>
>> Sent: Monday, 22 December, 2014 11:55:47
>> Subject: Re: Question about the userdata availability
>> Hello,
>>
>> The user data should stay there until the VM is destroyed, this is the
>> expected behavior for cloud-init for CloudStack but all other stacks too.
>>
>> --
>>
>> Antoine COETSIER
>>
>>
>> Le 22.12.14 11:04, « sebgoa » <ru...@gmail.com> a écrit :
>>
>>> Pinging Loic on this, he most likely has first hand experience with thisŠ
>>>
>>>
>>> On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>>>
>>>> Hello,
>>>>
>>>> I notice that when a VM is deployed with userdata, this userdata is
>>>> then available at http://VR/latest/user-data indefinitely, subsequent
>>>> reboots of the VM will get the userdata again and again.
>>>>
>>>> When the userdata is retrieved is there a way to let the VR know it has
>>>> been retrieved and can be deleted/deactivated?
>>>> Like there is the case with the root password script which send a
>>>> "DomU_Request: saved_password" header to confirm it.
>>>>
>>>> Lucian
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from the Delta quadrant using Borg technology!
>>>>
>>>> Nux!
>>>> www.nux.ro


Re: Question about the userdata availability

Posted by Nux! <nu...@li.nux.ro>.
Antoine,

Ok, thanks for clarifying. So it's a feature, not a bug. I'll have to deal with it client-side then.

Regards,
Lucian

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Coetsier, Antoine" <an...@exoscale.ch>
> To: dev@cloudstack.apache.org, "sebgoa" <ru...@gmail.com>, "Lambiel, Loic" <lo...@exoscale.ch>
> Sent: Monday, 22 December, 2014 11:55:47
> Subject: Re: Question about the userdata availability

> Hello,
> 
> The user data should stay there until the VM is destroyed, this is the
> expected behavior for cloud-init for CloudStack but all other stacks too.
> 
> --
> 
> Antoine COETSIER
> 
> 
> Le 22.12.14 11:04, « sebgoa » <ru...@gmail.com> a écrit :
> 
>>Pinging Loic on this, he most likely has first hand experience with thisŠ
>>
>>
>>On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>>
>>> Hello,
>>> 
>>> I notice that when a VM is deployed with userdata, this userdata is
>>>then available at http://VR/latest/user-data indefinitely, subsequent
>>>reboots of the VM will get the userdata again and again.
>>> 
>>> When the userdata is retrieved is there a way to let the VR know it has
>>>been retrieved and can be deleted/deactivated?
>>> Like there is the case with the root password script which send a
>>>"DomU_Request: saved_password" header to confirm it.
>>> 
>>> Lucian
>>> 
>>> 
>>> 
>>> --
>>> Sent from the Delta quadrant using Borg technology!
>>> 
>>> Nux!
>>> www.nux.ro

Re: Question about the userdata availability

Posted by "Coetsier, Antoine" <an...@exoscale.ch>.
Hello,

The user data should stay there until the VM is destroyed, this is the
expected behavior for cloud-init for CloudStack but all other stacks too.

-- 

Antoine COETSIER 


Le 22.12.14 11:04, « sebgoa » <ru...@gmail.com> a écrit :

>Pinging Loic on this, he most likely has first hand experience with thisŠ
>
>
>On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>
>> Hello,
>> 
>> I notice that when a VM is deployed with userdata, this userdata is
>>then available at http://VR/latest/user-data indefinitely, subsequent
>>reboots of the VM will get the userdata again and again.
>> 
>> When the userdata is retrieved is there a way to let the VR know it has
>>been retrieved and can be deleted/deactivated?
>> Like there is the case with the root password script which send a
>>"DomU_Request: saved_password" header to confirm it.
>> 
>> Lucian
>> 
>> 
>> 
>> --
>> Sent from the Delta quadrant using Borg technology!
>> 
>> Nux!
>> www.nux.ro
>


Re: Question about the userdata availability

Posted by Nux! <nu...@li.nux.ro>.
Rohit,

Do note I have not removed my VM. The issue is the userdata will be served every time it is requested, indefinitely. I expected it to be gone once I request it once.
Or perhaps this is a feature to be handled client-side? i.e. create some sort of lock files if the userdata init script has already run and done his job?

Lucian

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Rohit Yadav" <ro...@shapeblue.com>
> To: dev@cloudstack.apache.org
> Cc: "Loic Lambiel" <lo...@exoscale.ch>
> Sent: Monday, 22 December, 2014 11:51:41
> Subject: Re: Question about the userdata availability

> Hi Lucian,
> 
> I think it’s a bug like other issues where passwords, host-ip mappings and other
> information don’t get removed when VMs are removed (for example
> https://issues.apache.org/jira/browse/CLOUDSTACK-8060).
> 
> I’ve a fair idea how VR works and how we should fix this issue but it would be
> great if Jayapal or Sheng can comment on this, I aim to fix them soon among my
> other pending issues that I need to fix.
> 
>> On 22-Dec-2014, at 3:34 pm, sebgoa <ru...@gmail.com> wrote:
>>
>> Pinging Loic on this, he most likely has first hand experience with this…
>>
>>
>> On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>>
>>> Hello,
>>>
>>> I notice that when a VM is deployed with userdata, this userdata is then
>>> available at http://VR/latest/user-data indefinitely, subsequent reboots of the
>>> VM will get the userdata again and again.
>>>
>>> When the userdata is retrieved is there a way to let the VR know it has been
>>> retrieved and can be deleted/deactivated?
>>> Like there is the case with the root password script which send a "DomU_Request:
>>> saved_password" header to confirm it.
>>>
>>> Lucian
>>>
>>>
>>>
>>> --
>>> Sent from the Delta quadrant using Borg technology!
>>>
>>> Nux!
>>> www.nux.ro
>>
> 
> Regards,
> Rohit Yadav
> Software Architect, ShapeBlue
> M. +91 88 262 30892 | rohit.yadav@shapeblue.com
> Blog: bhaisaab.org | Twitter: @_bhaisaab
> 
> 
> 
> Find out more about ShapeBlue and our range of CloudStack related services
> 
> IaaS Cloud Design & Build<http://shapeblue.com/iaas-cloud-design-and-build//>
> CSForge – rapid IaaS deployment framework<http://shapeblue.com/csforge/>
> CloudStack Consulting<http://shapeblue.com/cloudstack-consultancy/>
> CloudStack Software
> Engineering<http://shapeblue.com/cloudstack-software-engineering/>
> CloudStack Infrastructure
> Support<http://shapeblue.com/cloudstack-infrastructure-support/>
> CloudStack Bootcamp Training Courses<http://shapeblue.com/cloudstack-training/>
> 
> This email and any attachments to it may be confidential and are intended solely
> for the use of the individual to whom it is addressed. Any views or opinions
> expressed are solely those of the author and do not necessarily represent those
> of Shape Blue Ltd or related companies. If you are not the intended recipient
> of this email, you must neither take any action based upon its contents, nor
> copy or show it to anyone. Please contact the sender if you believe you have
> received this email in error. Shape Blue Ltd is a company incorporated in
> England & Wales. ShapeBlue Services India LLP is a company incorporated in
> India and is operated under license from Shape Blue Ltd. Shape Blue Brasil
> Consultoria Ltda is a company incorporated in Brasil and is operated under
> license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by
> The Republic of South Africa and is traded under license from Shape Blue Ltd.
> ShapeBlue is a registered trademark.

Re: Question about the userdata availability

Posted by Rohit Yadav <ro...@shapeblue.com>.
Hi Lucian,

I think it’s a bug like other issues where passwords, host-ip mappings and other information don’t get removed when VMs are removed (for example https://issues.apache.org/jira/browse/CLOUDSTACK-8060).

I’ve a fair idea how VR works and how we should fix this issue but it would be great if Jayapal or Sheng can comment on this, I aim to fix them soon among my other pending issues that I need to fix.

> On 22-Dec-2014, at 3:34 pm, sebgoa <ru...@gmail.com> wrote:
>
> Pinging Loic on this, he most likely has first hand experience with this…
>
>
> On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:
>
>> Hello,
>>
>> I notice that when a VM is deployed with userdata, this userdata is then available at http://VR/latest/user-data indefinitely, subsequent reboots of the VM will get the userdata again and again.
>>
>> When the userdata is retrieved is there a way to let the VR know it has been retrieved and can be deleted/deactivated?
>> Like there is the case with the root password script which send a "DomU_Request: saved_password" header to confirm it.
>>
>> Lucian
>>
>>
>>
>> --
>> Sent from the Delta quadrant using Borg technology!
>>
>> Nux!
>> www.nux.ro
>

Regards,
Rohit Yadav
Software Architect, ShapeBlue
M. +91 88 262 30892 | rohit.yadav@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab



Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build<http://shapeblue.com/iaas-cloud-design-and-build//>
CSForge – rapid IaaS deployment framework<http://shapeblue.com/csforge/>
CloudStack Consulting<http://shapeblue.com/cloudstack-consultancy/>
CloudStack Software Engineering<http://shapeblue.com/cloudstack-software-engineering/>
CloudStack Infrastructure Support<http://shapeblue.com/cloudstack-infrastructure-support/>
CloudStack Bootcamp Training Courses<http://shapeblue.com/cloudstack-training/>

This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Shape Blue Ltd or related companies. If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error. Shape Blue Ltd is a company incorporated in England & Wales. ShapeBlue Services India LLP is a company incorporated in India and is operated under license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by The Republic of South Africa and is traded under license from Shape Blue Ltd. ShapeBlue is a registered trademark.

Re: Question about the userdata availability

Posted by sebgoa <ru...@gmail.com>.
Pinging Loic on this, he most likely has first hand experience with this…


On Dec 20, 2014, at 11:58 AM, Nux! <nu...@li.nux.ro> wrote:

> Hello,
> 
> I notice that when a VM is deployed with userdata, this userdata is then available at http://VR/latest/user-data indefinitely, subsequent reboots of the VM will get the userdata again and again.
> 
> When the userdata is retrieved is there a way to let the VR know it has been retrieved and can be deleted/deactivated?
> Like there is the case with the root password script which send a "DomU_Request: saved_password" header to confirm it.
> 
> Lucian
> 
> 
> 
> --
> Sent from the Delta quadrant using Borg technology!
> 
> Nux!
> www.nux.ro