← Back to team overview

cloud-init-dev team mailing list archive

Re: Help request: ec2-user vs root user for cloud-init

 

On Wed, Apr 25, 2012 at 6:25 AM, Scott Moser <smoser@xxxxxxxxxx> wrote:
> On Tue, 24 Apr 2012, jvlcek wrote:
>> I've made some progress.
>>
>> If I manually create the ec2-user then run
>> "cloud-init start" I can get things to work.
>>
>> I can also userdelete the ec2-user and specify
>> user: root in /etc/cloud/cloud.cfg
>>
>> It also seems as if only the things specified under
>> cloud_init_modules: in /etc/cloud/cloud.cfg will run.
>
> There are 3 sets of modules, separate really because of when the run.
>  cloud_init_modules, cloud_config_modules, cloud_final_modules
>
>  * cloud_init_modules: this list of modules run immediately upon there
>   being a data source found.  They basically block large parts of boot.
>   They can't really rely on network being up.
>  * cloud_config_modules: this list runs almost immediately upon static
>   network being up (where "static" means all with explicit configuration
>   existing in /etc, including dhcp)
>  * cloud_final_modules: this list runs basically at tradition unix
>   rc.local time frame, ie "very late in boot"
>
>> If I remove the headings "cloud_config_modules:"
>> and "cloud_final_modules:" I can get all the
>> handlers specified to run.
>>
>>
>> e.g.:
>>     % diff /etc/cloud/cloud.cfg.ORIG /etc/cloud/cloud.cfg
>>     1,2c1,2
>> < user: ec2-user
>> < disable_root: 1
>
> I suppose explicit use of 'root' as the user should work.  Its not a path
> that is used or really advised, but I understand your interest, and we can
> make it work if it does not.
>
>> <
>> < cloud_config_modules:
>>     29,30d26
>> <
>> < cloud_final_modules:
>
> I'm not really sure what you did there, but it seems like you made all
> modules into cloud-init modules, meaning they'll run earlier in boot then
> they've expected to run, and are likely to fail.
>
>> The work I am doing is based on the fedora bits Garret Holstrom
>> of Eucalyptus had done. Which do have a Fedora version of the
>> cloud.cfg file.
>> Fedora archive.  http://pkgs.fedoraproject.org/gitweb/?p=cloud-init.git
>>
>> I'll be investigating why I have to remove the headings
>> from the /etc/cloud/cloud.cfg  over the coming days.
>
> It seems to me that cloud-config.service is not getting invoked.  I've
> actually never debugged systemd jobs, but it would appear that maybe:
>  * cloud-config.target is not being achieved
>  * cloud-config.service is not starting
>
> Your /var/log/cloud-init.log would likely be helpful.

I'm afraid I have little context here, so I apologize if I
mis-understand what you are trying to do.

Switching the user that cloud-init manipulates is certainly possible,
though I haven't tested the root user in particular.  You will
probably have to shut off disable_root, of course.

What kind of guest are you running?  RHEL ought to work once you write
the needed sysvinit scripts and patch out the py27-isms, while Fedora
ought to work out of the box.  Then again I'm not sure about how RHEVm
works specifically.  But either way, the module ordering given in
Fedora's cloud-cfg file should be correct.


References