
This is a multi-part message in MIME format. --------------030008090705050402030703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hello, I've been unsuccessfully trying to make work a custom yalm script with the cloud-init option in 3.4.1. All other native UI parameters are correctly configured (hostname...) My goal is to change the keyboard layout: write_files: - content: | # My new /etc/sysconfig/keyboard file KEYTABLE="fr" MODEL="pc105" LAYOUT="fr" KEYBOARDTYPE="pc" path: /etc/sysconfig/keyboard permissions: '0644' I can't see what is wrong and there is nothing into cloud-init logs on the guest (/var/log/clou-init-output.log). Is it possible to see the whole yalm file generated by the engine somewhere? -- Nathanaël Blanchet Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr --------------030008090705050402030703 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <font size="-1">Hello,<br> <br> I've been unsuccessfully trying to make work a custom yalm script with the cloud-init option in 3.4.1.<br> All other native UI parameters are correctly configured (hostname...)<br> <br> My goal is to change the keyboard layout:<br> write_files:<br> - content: |<br> # My new /etc/sysconfig/keyboard file<br> KEYTABLE="fr"<br> MODEL="pc105"<br> LAYOUT="fr"<br> KEYBOARDTYPE="pc"<br> path: /etc/sysconfig/keyboard<br> permissions: '0644'<br> <br> I can't see what is wrong and there is nothing into cloud-init logs on the guest (/var/log/clou-init-output.log).<br> Is it possible to see the whole yalm file generated by the engine somewhere?<br> <br> </font> <pre class="moz-signature" cols="72">-- Nathanaël Blanchet Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 <a class="moz-txt-link-abbreviated" href="mailto:blanchet@abes.fr">blanchet@abes.fr</a> </pre> </body> </html> --------------030008090705050402030703--

----- Original Message -----
From: "Nathanaël Blanchet" <blanchet@abes.fr> To: "users" <users@ovirt.org> Sent: Friday, May 30, 2014 6:49:34 PM Subject: [ovirt-users] yaml cloud-init custom scripts
Hello,
I've been unsuccessfully trying to make work a custom yalm script with the cloud-init option in 3.4.1. All other native UI parameters are correctly configured (hostname...)
My goal is to change the keyboard layout: write_files: - content: | # My new /etc/sysconfig/keyboard file KEYTABLE="fr" MODEL="pc105" LAYOUT="fr" KEYBOARDTYPE="pc" path: /etc/sysconfig/keyboard permissions: '0644'
I can't see what is wrong and there is nothing into cloud-init logs on the guest (/var/log/clou-init-output.log).
isn't it in /var/log/cloud-init.log ?
Is it possible to see the whole yalm file generated by the engine somewhere?
the cloud init data is attached to the vm as a cd-rom you can mount it locally and look inside the drive name is config-2 (look for it with blkid) for me on fedora 19 it always appear in /dev/sr1
-- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

On 01.06.14 11:20, Omer Frenkel wrote:
----- Original Message -----
From: "Nathanaël Blanchet" <blanchet@abes.fr> To: "users" <users@ovirt.org> Sent: Friday, May 30, 2014 6:49:34 PM Subject: [ovirt-users] yaml cloud-init custom scripts
Hello,
I've been unsuccessfully trying to make work a custom yalm script with the cloud-init option in 3.4.1. All other native UI parameters are correctly configured (hostname...)
My goal is to change the keyboard layout: write_files: - content: | # My new /etc/sysconfig/keyboard file KEYTABLE="fr" MODEL="pc105" LAYOUT="fr" KEYBOARDTYPE="pc" path: /etc/sysconfig/keyboard permissions: '0644'
I can't see what is wrong and there is nothing into cloud-init logs on the guest (/var/log/clou-init-output.log).
isn't it in /var/log/cloud-init.log ?
Is it possible to see the whole yalm file generated by the engine somewhere?
the cloud init data is attached to the vm as a cd-rom you can mount it locally and look inside the drive name is config-2 (look for it with blkid) for me on fedora 19 it always appear in /dev/sr1
First look at the mounted content as Omer suggested and take a look if the YAML output as you expected. You can also try to set the data that is written in the "custom script" commit: http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=d46ebd8712f369b... see if adding this content is working for your setup: write_files: - content: | # some file content path: /root/myfile This sample was tested and worked under RHEL 6 and Fedora 19. Please note that you need to add a tab/4 spaces as shown above. What OS and what version of cloud-init you are using?
-- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

On 01.06.14 11:20, Omer Frenkel wrote:
----- Original Message -----
From: "Nathanaël Blanchet" <blanchet@abes.fr> To: "users" <users@ovirt.org> Sent: Friday, May 30, 2014 6:49:34 PM Subject: [ovirt-users] yaml cloud-init custom scripts
Hello,
I've been unsuccessfully trying to make work a custom yalm script with the cloud-init option in 3.4.1. All other native UI parameters are correctly configured (hostname...)
My goal is to change the keyboard layout: write_files: - content: | # My new /etc/sysconfig/keyboard file KEYTABLE="fr" MODEL="pc105" LAYOUT="fr" KEYBOARDTYPE="pc" path: /etc/sysconfig/keyboard permissions: '0644'
I can't see what is wrong and there is nothing into cloud-init logs on the guest (/var/log/clou-init-output.log). isn't it in /var/log/cloud-init.log ?
Is it possible to see the whole yalm file generated by the engine somewhere?
the cloud init data is attached to the vm as a cd-rom you can mount it locally and look inside the drive name is config-2 (look for it with blkid) for me on fedora 19 it always appear in /dev/sr1
First look at the mounted content as Omer suggested and take a look if the YAML output as you expected. You can also try to set the data that is written in the "custom script" commit: http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=d46ebd8712f369b... see if adding this content is working for your setup: write_files: - content: | # some file content path: /root/myfile
This sample was tested and worked under RHEL 6 and Fedora 19. Please note that you need to add a tab/4 spaces as shown above.
What OS and what version of cloud-init you are using?
Le 01/06/2014 20:00, Shahar Havivi a écrit : that's it, I finally managed to make it work after many an many tests, that wasn't so trivial. First I followed your advices and I successfully tested the sample script you suggested without modify it. Then each time I attempted to add a line to the same file, it wasn't executed anymore. I read the file with cat -T /media/openstack/latest/user_data and then noticed that the lines weren't uniformly formated : some were with tab and other ones with 8 spaces. Following "Please note that you need to add a tab/4 spaces as shown above" I added tab on every lines related to content of the file, but it didn't work. I began again with only 8 spaces and then it ran. Seems YAML to be very format sensitive and it is not clear enough when begining this kind of job, so that I hope my leak will help many other ones. I think the custom script field in the UI is not helpful because it is impossible to insert a line, when doing a CR it leads to the end of file, and it is a behaviour which easily leads to format error. It could be a good idea to refuse validating OK if any tab is detected there. Can I have your feeling about this?
-- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
-- Nathanaël Blanchet Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr

On 02.06.14 13:07, Nathanaël Blanchet wrote:
On 01.06.14 11:20, Omer Frenkel wrote:
----- Original Message -----
From: "Nathanaël Blanchet" <blanchet@abes.fr> To: "users" <users@ovirt.org> Sent: Friday, May 30, 2014 6:49:34 PM Subject: [ovirt-users] yaml cloud-init custom scripts
Hello,
I've been unsuccessfully trying to make work a custom yalm script with the cloud-init option in 3.4.1. All other native UI parameters are correctly configured (hostname...)
My goal is to change the keyboard layout: write_files: - content: | # My new /etc/sysconfig/keyboard file KEYTABLE="fr" MODEL="pc105" LAYOUT="fr" KEYBOARDTYPE="pc" path: /etc/sysconfig/keyboard permissions: '0644'
I can't see what is wrong and there is nothing into cloud-init logs on the guest (/var/log/clou-init-output.log). isn't it in /var/log/cloud-init.log ?
Is it possible to see the whole yalm file generated by the engine somewhere?
the cloud init data is attached to the vm as a cd-rom you can mount it locally and look inside the drive name is config-2 (look for it with blkid) for me on fedora 19 it always appear in /dev/sr1
First look at the mounted content as Omer suggested and take a look if the YAML output as you expected. You can also try to set the data that is written in the "custom script" commit: http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=d46ebd8712f369b... see if adding this content is working for your setup: write_files: - content: | # some file content path: /root/myfile
This sample was tested and worked under RHEL 6 and Fedora 19. Please note that you need to add a tab/4 spaces as shown above.
What OS and what version of cloud-init you are using?
Le 01/06/2014 20:00, Shahar Havivi a écrit : that's it, I finally managed to make it work after many an many tests, that wasn't so trivial. First I followed your advices and I successfully tested the sample script you suggested without modify it. Then each time I attempted to add a line to the same file, it wasn't executed anymore. I read the file with cat -T /media/openstack/latest/user_data and then noticed that the lines weren't uniformly formated : some were with tab and other ones with 8 spaces. Following "Please note that you need to add a tab/4 spaces as shown above" I added tab on every lines related to content of the file, but it didn't work. I began again with only 8 spaces and then it ran. Seems YAML to be very format sensitive and it is not clear enough when begining this kind of job, so that I hope my leak will help many other ones. I think the custom script field in the UI is not helpful because it is impossible to insert a line, when doing a CR it leads to the end of file, and it is a behaviour which easily leads to format error. It could be a good idea to refuse validating OK if any tab is detected there. Can I have your feeling about this?
The problem was the CR at the end of the "custom script" field, or any CR?
-- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
-- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr

Le 02/06/2014 13:25, Shahar Havivi a écrit : > On 02.06.14 13:07, Nathanaël Blanchet wrote: >> Le 01/06/2014 20:00, Shahar Havivi a écrit : >>> On 01.06.14 11:20, Omer Frenkel wrote: >>>> ----- Original Message ----- >>>>> From: "Nathanaël Blanchet" <blanchet@abes.fr> >>>>> To: "users" <users@ovirt.org> >>>>> Sent: Friday, May 30, 2014 6:49:34 PM >>>>> Subject: [ovirt-users] yaml cloud-init custom scripts >>>>> >>>>> Hello, >>>>> >>>>> I've been unsuccessfully trying to make work a custom yalm script with the >>>>> cloud-init option in 3.4.1. >>>>> All other native UI parameters are correctly configured (hostname...) >>>>> >>>>> My goal is to change the keyboard layout: >>>>> write_files: >>>>> - content: | >>>>> # My new /etc/sysconfig/keyboard file >>>>> KEYTABLE="fr" >>>>> MODEL="pc105" >>>>> LAYOUT="fr" >>>>> KEYBOARDTYPE="pc" >>>>> path: /etc/sysconfig/keyboard >>>>> permissions: '0644' >>>>> >>>>> I can't see what is wrong and there is nothing into cloud-init logs on the >>>>> guest (/var/log/clou-init-output.log). >>>> isn't it in /var/log/cloud-init.log ? >>>> >>>>> Is it possible to see the whole yalm file generated by the engine somewhere? >>>>> >>>> the cloud init data is attached to the vm as a cd-rom >>>> you can mount it locally and look inside the drive name is config-2 (look for it with blkid) >>>> for me on fedora 19 it always appear in /dev/sr1 >>> First look at the mounted content as Omer suggested and take a look if the YAML >>> output as you expected. >>> You can also try to set the data that is written in the "custom script" >>> commit: >>> http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=d46ebd8712f369b924e199b82197e59568a686ff >>> see if adding this content is working for your setup: >>> write_files: >>> - content: | >>> # some file content >>> path: /root/myfile >>> >>> This sample was tested and worked under RHEL 6 and Fedora 19. >>> Please note that you need to add a tab/4 spaces as shown above. >>> >>> What OS and what version of cloud-init you are using? >> that's it, I finally managed to make it work after many an many tests, that >> wasn't so trivial. >> First I followed your advices and I successfully tested the sample script >> you suggested without modify it. Then each time I attempted to add a line to >> the same file, it wasn't executed anymore. I read the file with cat -T >> /media/openstack/latest/user_data and then noticed that the lines weren't >> uniformly formated : some were with tab and other ones with 8 spaces. >> Following "Please note that you need to add a tab/4 spaces as shown above" I >> added tab on every lines related to content of the file, but it didn't work. >> I began again with only 8 spaces and then it ran. >> Seems YAML to be very format sensitive and it is not clear enough when >> begining this kind of job, so that I hope my leak will help many other ones. >> I think the custom script field in the UI is not helpful because it is >> impossible to insert a line, when doing a CR it leads to the end of file, >> and it is a behaviour which easily leads to format error. It could be a good >> idea to refuse validating OK if any tab is detected there. >> Can I have your feeling about this? > The problem was the CR at the end of the "custom script" field, or any CR? any CR in the field leads to the end on the script >>>>> -- >>>>> Nathanaël Blanchet >>>>> >>>>> Supervision réseau >>>>> Pôle exploitation et maintenance >>>>> Département des systèmes d'information >>>>> 227 avenue Professeur-Jean-Louis-Viala >>>>> 34193 MONTPELLIER CEDEX 5 >>>>> Tél. 33 (0)4 67 54 84 55 >>>>> Fax 33 (0)4 67 54 84 14 blanchet@abes.fr >>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> Users@ovirt.org >>>>> http://lists.ovirt.org/mailman/listinfo/users >>>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users@ovirt.org >>>> http://lists.ovirt.org/mailman/listinfo/users >> -- >> Nathanaël Blanchet >> >> Supervision réseau >> Pôle exploitation et maintenance >> Département des systèmes d'information >> 227 avenue Professeur-Jean-Louis-Viala >> 34193 MONTPELLIER CEDEX 5 >> Tél. 33 (0)4 67 54 84 55 >> Fax 33 (0)4 67 54 84 14 >> blanchet@abes.fr >> -- Nathanaël Blanchet Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr

On 02.06.14 14:28, Nathanaël Blanchet wrote: > > Le 02/06/2014 13:25, Shahar Havivi a écrit : > >On 02.06.14 13:07, Nathanaël Blanchet wrote: > >>Le 01/06/2014 20:00, Shahar Havivi a écrit : > >>>On 01.06.14 11:20, Omer Frenkel wrote: > >>>>----- Original Message ----- > >>>>>From: "Nathanaël Blanchet" <blanchet@abes.fr> > >>>>>To: "users" <users@ovirt.org> > >>>>>Sent: Friday, May 30, 2014 6:49:34 PM > >>>>>Subject: [ovirt-users] yaml cloud-init custom scripts > >>>>> > >>>>>Hello, > >>>>> > >>>>>I've been unsuccessfully trying to make work a custom yalm script with the > >>>>>cloud-init option in 3.4.1. > >>>>>All other native UI parameters are correctly configured (hostname...) > >>>>> > >>>>>My goal is to change the keyboard layout: > >>>>>write_files: > >>>>>- content: | > >>>>># My new /etc/sysconfig/keyboard file > >>>>>KEYTABLE="fr" > >>>>>MODEL="pc105" > >>>>>LAYOUT="fr" > >>>>>KEYBOARDTYPE="pc" > >>>>>path: /etc/sysconfig/keyboard > >>>>>permissions: '0644' > >>>>> > >>>>>I can't see what is wrong and there is nothing into cloud-init logs on the > >>>>>guest (/var/log/clou-init-output.log). > >>>>isn't it in /var/log/cloud-init.log ? > >>>> > >>>>>Is it possible to see the whole yalm file generated by the engine somewhere? > >>>>> > >>>>the cloud init data is attached to the vm as a cd-rom > >>>>you can mount it locally and look inside the drive name is config-2 (look for it with blkid) > >>>>for me on fedora 19 it always appear in /dev/sr1 > >>>First look at the mounted content as Omer suggested and take a look if the YAML > >>>output as you expected. > >>>You can also try to set the data that is written in the "custom script" > >>>commit: > >>>http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=d46ebd8712f369b924e199b82197e59568a686ff > >>>see if adding this content is working for your setup: > >>>write_files: > >>>- content: | > >>> # some file content > >>> path: /root/myfile > >>> > >>>This sample was tested and worked under RHEL 6 and Fedora 19. > >>>Please note that you need to add a tab/4 spaces as shown above. > >>> > >>>What OS and what version of cloud-init you are using? > >>that's it, I finally managed to make it work after many an many tests, that > >>wasn't so trivial. > >>First I followed your advices and I successfully tested the sample script > >>you suggested without modify it. Then each time I attempted to add a line to > >>the same file, it wasn't executed anymore. I read the file with cat -T > >>/media/openstack/latest/user_data and then noticed that the lines weren't > >>uniformly formated : some were with tab and other ones with 8 spaces. > >>Following "Please note that you need to add a tab/4 spaces as shown above" I > >>added tab on every lines related to content of the file, but it didn't work. > >>I began again with only 8 spaces and then it ran. > >>Seems YAML to be very format sensitive and it is not clear enough when > >>begining this kind of job, so that I hope my leak will help many other ones. > >>I think the custom script field in the UI is not helpful because it is > >>impossible to insert a line, when doing a CR it leads to the end of file, > >>and it is a behaviour which easily leads to format error. It could be a good > >>idea to refuse validating OK if any tab is detected there. > >>Can I have your feeling about this? > >The problem was the CR at the end of the "custom script" field, or any CR? > any CR in the field leads to the end on the script So only when you copy/paste the custom script content it works for you? > >>>>>-- > >>>>>Nathanaël Blanchet > >>>>> > >>>>>Supervision réseau > >>>>>Pôle exploitation et maintenance > >>>>>Département des systèmes d'information > >>>>>227 avenue Professeur-Jean-Louis-Viala > >>>>>34193 MONTPELLIER CEDEX 5 > >>>>>Tél. 33 (0)4 67 54 84 55 > >>>>>Fax 33 (0)4 67 54 84 14 blanchet@abes.fr > >>>>> > >>>>>_______________________________________________ > >>>>>Users mailing list > >>>>>Users@ovirt.org > >>>>>http://lists.ovirt.org/mailman/listinfo/users > >>>>> > >>>>_______________________________________________ > >>>>Users mailing list > >>>>Users@ovirt.org > >>>>http://lists.ovirt.org/mailman/listinfo/users > >>-- > >>Nathanaël Blanchet > >> > >>Supervision réseau > >>Pôle exploitation et maintenance > >>Département des systèmes d'information > >>227 avenue Professeur-Jean-Louis-Viala > >>34193 MONTPELLIER CEDEX 5 > >>Tél. 33 (0)4 67 54 84 55 > >>Fax 33 (0)4 67 54 84 14 > >>blanchet@abes.fr > >> > > -- > Nathanaël Blanchet > > Supervision réseau > Pôle exploitation et maintenance > Département des systèmes d'information > 227 avenue Professeur-Jean-Louis-Viala > 34193 MONTPELLIER CEDEX 5 > Tél. 33 (0)4 67 54 84 55 > Fax 33 (0)4 67 54 84 14 > blanchet@abes.fr >

Le 02/06/2014 14:38, Shahar Havivi a écrit : > On 02.06.14 14:28, Nathanaël Blanchet wrote: >> Le 02/06/2014 13:25, Shahar Havivi a écrit : >>> On 02.06.14 13:07, Nathanaël Blanchet wrote: >>>> Le 01/06/2014 20:00, Shahar Havivi a écrit : >>>>> On 01.06.14 11:20, Omer Frenkel wrote: >>>>>> ----- Original Message ----- >>>>>>> From: "Nathanaël Blanchet" <blanchet@abes.fr> >>>>>>> To: "users" <users@ovirt.org> >>>>>>> Sent: Friday, May 30, 2014 6:49:34 PM >>>>>>> Subject: [ovirt-users] yaml cloud-init custom scripts >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I've been unsuccessfully trying to make work a custom yalm script with the >>>>>>> cloud-init option in 3.4.1. >>>>>>> All other native UI parameters are correctly configured (hostname...) >>>>>>> >>>>>>> My goal is to change the keyboard layout: >>>>>>> write_files: >>>>>>> - content: | >>>>>>> # My new /etc/sysconfig/keyboard file >>>>>>> KEYTABLE="fr" >>>>>>> MODEL="pc105" >>>>>>> LAYOUT="fr" >>>>>>> KEYBOARDTYPE="pc" >>>>>>> path: /etc/sysconfig/keyboard >>>>>>> permissions: '0644' >>>>>>> >>>>>>> I can't see what is wrong and there is nothing into cloud-init logs on the >>>>>>> guest (/var/log/clou-init-output.log). >>>>>> isn't it in /var/log/cloud-init.log ? >>>>>> >>>>>>> Is it possible to see the whole yalm file generated by the engine somewhere? >>>>>>> >>>>>> the cloud init data is attached to the vm as a cd-rom >>>>>> you can mount it locally and look inside the drive name is config-2 (look for it with blkid) >>>>>> for me on fedora 19 it always appear in /dev/sr1 >>>>> First look at the mounted content as Omer suggested and take a look if the YAML >>>>> output as you expected. >>>>> You can also try to set the data that is written in the "custom script" >>>>> commit: >>>>> http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=d46ebd8712f369b924e199b82197e59568a686ff >>>>> see if adding this content is working for your setup: >>>>> write_files: >>>>> - content: | >>>>> # some file content >>>>> path: /root/myfile >>>>> >>>>> This sample was tested and worked under RHEL 6 and Fedora 19. >>>>> Please note that you need to add a tab/4 spaces as shown above. >>>>> >>>>> What OS and what version of cloud-init you are using? >>>> that's it, I finally managed to make it work after many an many tests, that >>>> wasn't so trivial. >>>> First I followed your advices and I successfully tested the sample script >>>> you suggested without modify it. Then each time I attempted to add a line to >>>> the same file, it wasn't executed anymore. I read the file with cat -T >>>> /media/openstack/latest/user_data and then noticed that the lines weren't >>>> uniformly formated : some were with tab and other ones with 8 spaces. >>>> Following "Please note that you need to add a tab/4 spaces as shown above" I >>>> added tab on every lines related to content of the file, but it didn't work. >>>> I began again with only 8 spaces and then it ran. >>>> Seems YAML to be very format sensitive and it is not clear enough when >>>> begining this kind of job, so that I hope my leak will help many other ones. >>>> I think the custom script field in the UI is not helpful because it is >>>> impossible to insert a line, when doing a CR it leads to the end of file, >>>> and it is a behaviour which easily leads to format error. It could be a good >>>> idea to refuse validating OK if any tab is detected there. >>>> Can I have your feeling about this? >>> The problem was the CR at the end of the "custom script" field, or any CR? >> any CR in the field leads to the end on the script > So only when you copy/paste the custom script content it works for you? Copy/past is the best way for not having tabs instead of the correct 8 spaces before each file content instruction >>>>>>> -- >>>>>>> Nathanaël Blanchet >>>>>>> >>>>>>> Supervision réseau >>>>>>> Pôle exploitation et maintenance >>>>>>> Département des systèmes d'information >>>>>>> 227 avenue Professeur-Jean-Louis-Viala >>>>>>> 34193 MONTPELLIER CEDEX 5 >>>>>>> Tél. 33 (0)4 67 54 84 55 >>>>>>> Fax 33 (0)4 67 54 84 14 blanchet@abes.fr >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Users mailing list >>>>>>> Users@ovirt.org >>>>>>> http://lists.ovirt.org/mailman/listinfo/users >>>>>>> >>>>>> _______________________________________________ >>>>>> Users mailing list >>>>>> Users@ovirt.org >>>>>> http://lists.ovirt.org/mailman/listinfo/users >>>> -- >>>> Nathanaël Blanchet >>>> >>>> Supervision réseau >>>> Pôle exploitation et maintenance >>>> Département des systèmes d'information >>>> 227 avenue Professeur-Jean-Louis-Viala >>>> 34193 MONTPELLIER CEDEX 5 >>>> Tél. 33 (0)4 67 54 84 55 >>>> Fax 33 (0)4 67 54 84 14 >>>> blanchet@abes.fr >>>> >> -- >> Nathanaël Blanchet >> >> Supervision réseau >> Pôle exploitation et maintenance >> Département des systèmes d'information >> 227 avenue Professeur-Jean-Louis-Viala >> 34193 MONTPELLIER CEDEX 5 >> Tél. 33 (0)4 67 54 84 55 >> Fax 33 (0)4 67 54 84 14 >> blanchet@abes.fr >> -- Nathanaël Blanchet Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr

On 02.06.14 15:16, Nathanaël Blanchet wrote:
Le 02/06/2014 14:38, Shahar Havivi a écrit :
On 02.06.14 14:28, Nathanaël Blanchet wrote:
Le 02/06/2014 13:25, Shahar Havivi a écrit :
On 02.06.14 13:07, Nathanaël Blanchet wrote:
On 01.06.14 11:20, Omer Frenkel wrote: >----- Original Message ----- >>From: "Nathanaël Blanchet" <blanchet@abes.fr> >>To: "users" <users@ovirt.org> >>Sent: Friday, May 30, 2014 6:49:34 PM >>Subject: [ovirt-users] yaml cloud-init custom scripts >> >>Hello, >> >>I've been unsuccessfully trying to make work a custom yalm script with the >>cloud-init option in 3.4.1. >>All other native UI parameters are correctly configured (hostname...) >> >>My goal is to change the keyboard layout: >>write_files: >>- content: | >># My new /etc/sysconfig/keyboard file >>KEYTABLE="fr" >>MODEL="pc105" >>LAYOUT="fr" >>KEYBOARDTYPE="pc" >>path: /etc/sysconfig/keyboard >>permissions: '0644' >> >>I can't see what is wrong and there is nothing into cloud-init logs on the >>guest (/var/log/clou-init-output.log). >isn't it in /var/log/cloud-init.log ? > >>Is it possible to see the whole yalm file generated by the engine somewhere? >> >the cloud init data is attached to the vm as a cd-rom >you can mount it locally and look inside the drive name is config-2 (look for it with blkid) >for me on fedora 19 it always appear in /dev/sr1 First look at the mounted content as Omer suggested and take a look if the YAML output as you expected. You can also try to set the data that is written in the "custom script" commit: http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=d46ebd8712f369b... see if adding this content is working for your setup: write_files: - content: | # some file content path: /root/myfile
This sample was tested and worked under RHEL 6 and Fedora 19. Please note that you need to add a tab/4 spaces as shown above.
What OS and what version of cloud-init you are using?
Le 01/06/2014 20:00, Shahar Havivi a écrit : that's it, I finally managed to make it work after many an many tests, that wasn't so trivial. First I followed your advices and I successfully tested the sample script you suggested without modify it. Then each time I attempted to add a line to the same file, it wasn't executed anymore. I read the file with cat -T /media/openstack/latest/user_data and then noticed that the lines weren't uniformly formated : some were with tab and other ones with 8 spaces. Following "Please note that you need to add a tab/4 spaces as shown above" I added tab on every lines related to content of the file, but it didn't work. I began again with only 8 spaces and then it ran. Seems YAML to be very format sensitive and it is not clear enough when begining this kind of job, so that I hope my leak will help many other ones. I think the custom script field in the UI is not helpful because it is impossible to insert a line, when doing a CR it leads to the end of file, and it is a behaviour which easily leads to format error. It could be a good idea to refuse validating OK if any tab is detected there. Can I have your feeling about this? The problem was the CR at the end of the "custom script" field, or any CR? any CR in the field leads to the end on the script So only when you copy/paste the custom script content it works for you? Copy/past is the best way for not having tabs instead of the correct 8 spaces before each file content instruction
Ok, Thank you for the help, I will test it and send a patch.
>>-- >>Nathanaël Blanchet >> >>Supervision réseau >>Pôle exploitation et maintenance >>Département des systèmes d'information >>227 avenue Professeur-Jean-Louis-Viala >>34193 MONTPELLIER CEDEX 5 >>Tél. 33 (0)4 67 54 84 55 >>Fax 33 (0)4 67 54 84 14 blanchet@abes.fr >> >>_______________________________________________ >>Users mailing list >>Users@ovirt.org >>http://lists.ovirt.org/mailman/listinfo/users >> >_______________________________________________ >Users mailing list >Users@ovirt.org >http://lists.ovirt.org/mailman/listinfo/users -- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr
-- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr
-- Nathanaël Blanchet
Supervision réseau Pôle exploitation et maintenance Département des systèmes d'information 227 avenue Professeur-Jean-Louis-Viala 34193 MONTPELLIER CEDEX 5 Tél. 33 (0)4 67 54 84 55 Fax 33 (0)4 67 54 84 14 blanchet@abes.fr
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
participants (3)
-
Nathanaël Blanchet
-
Omer Frenkel
-
Shahar Havivi