Closed asimkhawaja closed 8 years ago
Your log is actually looking good. Cloud-init always applies commands while rebooting the machine, and things done at this stage are not reflected by plumbery. This is inherent to the way cloud-config is working, and not related to plumbery. Maybe you could ssh to the node that has been created, and check the /var/log/cloud-config-init.log file. This is where cloud-config is logging results of your commands.
Sorry the correct log file is /var/log/cloud-init-output.log
Hey Bernard, there appears to be no cloud-init log files in the /var/log dir
further more I can also confirm that the prepare.cloud-init.sh file is not and cloud init is not installed on the machine.
What is plumbery supposed to be doing once it puts the prepare.cloud-init.sh onto the machine?
@bernard357 , on further investigation and based on the output above it is clear now that the prepare-cloud.init.sh file never runs, and we never get cloud-init installed. Since cloud-init is not installed none of the instructions are executed. I have now confirmed that if I install cloud-init manually on the VM and re-run plumbery the packages and instructions get followed.
I am now trying to figure out when and how prepare.cloud-init.sh should run, but any guidance you can provide would be most appreciated
@bernard357 --- one potential cause of this issue is that the prepare.clould-init.sh has windows line endings so if you try to execute it in linux it throws a bad interpreter error!
[root@10-0-0-9 ~]# ls
anaconda-ks.cfg c.sh prepare.cloud-init.sh
[root@10-0-0-9 ~]# ./prepare.cloud-init.sh
: No such file or directory
[root@10-0-0-9 ~]# dos2unix prepare.cloud-init.sh
dos2unix: converting file prepare.cloud-init.sh to Unix format ...
[root@10-0-0-9 ~]# ./prepare.cloud-init.sh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.steadfast.net
* extras: mirror.steadfast.net
* updates: mirror.steadfast.net
Resolving Dependencies
--> Running transaction check
---> Package cloud-init.x86_64 0:0.7.5-10.el7.centos.1 will be installed
--> Processing Dependency: python-requests for package: cloud-init-0.7.5-10.el7.centos.1.x86_64
Looks like the problem is infact with prepare-.cloud-init.sh
Apparently what is checked into source control is ok However the file that is available as per the build 0.80 using pip has prepare.cloud-init.sh that has incorrect line endings , i.e line endings for windows that will cause problems on linux machines!
@asimkhawaja, after the upload of prepare.cloud-init.sh plumbery just runs it to install cloud-init. Your feedback on newlines is surprising since we are using plumbery on Ubuntu and CentOS images on a daily basis. Which image are you using here?
I am testing on Cetos 7 and ubuntu 14
Here is the docker file that is being used to run plumbery:
FROM centos:7
#comment
MAINTAINER A.K Asim Khawaja
#set up data directoty for mongodb
RUN mkdir -p /data/db
RUN mkdir -p /var/log/mongodb.log
RUN mkdir -p /root/Development/mp3checker
#COPY mp3checker /root/Development/mp3checker/
#COPY sampleMusic /root/Downloads
RUN cd /root/Development
RUN ls -lh
#RUN cd /root/Development/mp3checker/node_webUI; npm install
#The follwing redis line does not work
#RUN /usr/bin/redis-server "--daemonize yes"
#installing python requirements
RUN yum install -y epel-release
RUN yum install -y git
RUN yum install -y gcc
RUN yum install -y python
RUN yum install -y python-pip python-devel openssl-devel
RUN yum install -y python-cffi
RUN yum install -y libffi-devel
RUN yum install -y mercurial
RUN pip install --upgrade pip
RUN pip install redis mutagen pyechonest jsonpickle
RUN pip install pyOpenSSL
RUN pip install pycrypto
RUN pip install -e git+https://git-wip-us.apache.org/repos/asf/libcloud.git@trun
k#egg=apache-libcloud
RUN pip install plumbery
@bernard357 I am going to change my pip installed plumber preare.cloud-init.sh file and then re-run plumbery deployed to confirm it is infact the pip install package that is suffering from the problem.
Ok. FYI: on my Mac the prepare.cloud-init.sh file only has newlines, as expected on any Unix machine.
hmm so how is the build for pip happening? is that on a windows or linux machine?
Confirmed,having changed the line-endings on my pip install plumbery installation and re-running plumbery results in a VM where cloud-init is executing. So I would propose, that somwhere in the build pip package process we are introducing windows characters into that file
@asimkhawaja this is great feedback indeed, since some funky process was used for previous generation of PIP release. Maybe you would like to use for plumbery a command similar to what you put for libcloud? pip install -e git+https://github.com/DimensionDataCBUSydney/plumbery.git#egg=plumbery
pip install through git does much better, Thanks Bernard
thanks @asimkhawaja
Hi Guys, I am running the yaml file below using plumbery in a CaaS VM. Looks like my cloud-config params from fittings file is being picked up by plumbery but none of the instructions are actually being executed on the machine. I have verfied by logging into the machine and checking as well.
asim_fittings.yaml
output log: