On 2014-10-12 09:17, Omer Frenkel wrote:
----- Original Message -----
> From: "Chris Routh" <routh(a)amateurwriting.net>
> To: users(a)ovirt.org
> Sent: Wednesday, October 8, 2014 1:42:53 PM
> Subject: [ovirt-users] Custom Cloud-Init script only partially
> executing
>
> I'm trying to get the custom cloud-init script section in my site to
> run. My goal is to have the VM run 'yum update', add the PuppetLabs
> repository, and then install the latest puppet agent, and join it to
> Puppet.
>
> Following the docs for oVirt and Cloud-Init I have this:
>
> BEGIN SCRIPT
> =======================
> yum_repos:
> # The name of the repository
> puppetlabs-release:
> baseurl:
>
http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
> enabled: true
> failovermethod: priority
> gpgcheck: true
> gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
> name: Puppet Labs repository for Enterprise Linux 6
>
>
> # Upgrade the instance on first boot
> package_upgrade: true
>
>
> # Install additional packages on first boot
> packages:
> - puppet
>
> # Automatically setup and run puppetd
> puppet:
> conf:
> agent:
> server: "puppet.example.com"
> certname: "%f"
> ca_cert: |
> -----BEGIN CERTIFICATE-----
> < My Cert >
> -----END CERTIFICATE-----
>
>
> =======================
> END SCRIPT
>
> However what I end up with from this is:
>
> - No Yum update
> - No added repository
> - Puppet gets installed from the default repos
> - No attempt to join
>
>
> According to the cloud-init docs my code is correct, however oVirt is
> not respecting anything, with the sole exception being the 'packages:'
> argument. Can someone please explain?
>
> Also, I have combed the script and ensured that the indentation was 4
> spaces, and not tabs. I noted that previous users in this mailing list
> have had that issue before.
the custom script should be sent as-is to the vm,
you can check what is actually attached to the vm,
just mount the "config-2" cd rom and look for it under openstack/latest
please update if it somehow sent wrong
> _______________________________________________
> Users mailing list
> Users(a)ovirt.org
>
http://lists.ovirt.org/mailman/listinfo/users
>
I have gotten much farther in troubleshooting this thanks to your help.
I managed to find the config-2 cdrom by using 'blkid' and then mounted
it. I see that my code is correct. I was then able to run the script
manual with debug mode and being some trial and error troubleshooting.
I managed to figure out that in order for my script to work, I needed
two extra modules added to /etc/cloud/cloud.cfg:
/etc/cloud/cloud.cfg
=======================
cloud_config_modules:
- yum-add-repo
- package-update-upgrade-install
=======================
Now, while that allows me to fix the issue with a manual run after the
VM has been created, it doesn't really cure the root issue.
How do I add these modules to the cdrom-2 so that this will work without
intervention on the first run?
I'm using the ovirt-image-repository CentOS-6.5 image as a template. Is
the issue in the image? Or the cdrom? Will creating a custom template
help?