Hi Remi, the goal is that cloud-init is able to recreate a correct /etc/hosts file. Right now this is not possible at least on Debian 8 with cloud-init 0.7.7 (installed from jessie-backport).
The problem is: cloud-init cannot create a correct fqdn because of missing var in meta-data. Correct fqdn should be hostname (name of instance) and network name in CS. dhcp is providing the correct values, but cloud-init is not getting the values out of dhcp. Right now a rewriten /etc/hosts (hostname is "d8-ci") by cloud-init looks like this: 127.0.1.1 d8-ci.localdomain d8-ci 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts You see in the first line that it uses "localdomain" as domain name, but it should use the name of the network in CS, right? Mit freundlichen Grüßen / With kind regards, Swen -----Ursprüngliche Nachricht----- Von: Remi Bergsma [mailto:rberg...@schubergphilis.com] Gesendet: Montag, 14. März 2016 11:34 An: S. Brüseke - proIO GmbH; dev@cloudstack.apache.org Betreff: Re: AW: user-data/meta-data Hi Swen, That depends on what exactly needs to be changed. So if you could gather that and let us know, I’ll have a look and otherwise we’ll ask someone else. A good description of what we need to have helps a lot so thanks for figuring that out. Regards, Remi On 14/03/16 09:14, "S. Brüseke - proIO GmbH" <s.brues...@proio.com> wrote: >Hi Remi, > >as far as I understand the documentation correctly cloud-init uses a var >called "hostname" (at least in EC2) which contains the full fqdn. >Please take a look at >https://github.com/number5/cloud-init/blob/177cf3bb6690f9669a0a560c09ca >5abbcbea964a/doc/examples/cloud-config.txt, Line 441 to 445 > >To me it would make more sense to provide a var called "fqdn" instead, because >CoreOS is using this var in the YAML-File. I need to take a look at the >cloud-init code of the latest version to confirm. > >Could you provide new code for user-data/meta-data? > >Mit freundlichen Grüßen / With kind regards, > >Swen > > >-----Ursprüngliche Nachricht----- >Von: Remi Bergsma [mailto:rberg...@schubergphilis.com] >Gesendet: Samstag, 12. März 2016 02:18 >An: dev@cloudstack.apache.org; S. Brüseke - proIO GmbH >Betreff: Re: user-data/meta-data > >Hi Swen, > >So you need an extra parameter with name ‘fqdn’. Does that simply also need to >contain the name of the vm or really the FQDN? Because I cannot see a FQDN set >in the vm object and if there is it would most likely be different per nic. >Please let me know. > >Regards, >Remi > > > > >On 11/03/16 14:39, "S. Brüseke - proIO GmbH" <s.brues...@proio.com> wrote: > >>Hi to all, >> >>I am testing cloud-init right now and run into a limitation of CS with the >>provided user-data/meta-data. >> >>As far as docu goes >>(http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/virtual_machines.html#user-data-and-meta-data) >> CS is providing the following meta-data: >>service-offering, availability-zone, local-ipv4, local-hostname, >>public-ipv4, public-hostname, instance-id >> >>Actually it is providing more: >>vm-id (looks like an alias to instance-id), public-keys, >>cloud-identifier >> >>To get cloud-init to recreate /etc/hosts correctly one more parameter is >>needed. >>cloud-init needs to get the fqdn of the vm via meta-data. The name of the >>parameter is "hostname", which is providing the fqdn of the vm. >> >>https://github.com/number5/cloud-init/blob/177cf3bb6690f9669a0a560c09c >>a 5abbcbea964a/doc/examples/cloud-config.txt, Line 441 to 445 >> >>Does anybody plan to integrate this into CS? >> >>Mit freundlichen Grüßen / With kind regards, >> >>Swen >> >> >> >> >>- proIO GmbH - >>Geschäftsführer: Swen Brüseke >>Sitz der Gesellschaft: Frankfurt am Main >> >>USt-IdNr. DE 267 075 918 >>Registergericht: Frankfurt am Main - HRB 86239 >> >>Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte >>Informationen. >>Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich >>erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie >>diese Mail. >>Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht >>gestattet. >> >>This e-mail may contain confidential and/or privileged information. >>If you are not the intended recipient (or have received this e-mail in >>error) please notify the sender immediately and destroy this e-mail. >>Any unauthorized copying, disclosure or distribution of the material in this >>e-mail is strictly forbidden. >> >> > > >- proIO GmbH - >Geschäftsführer: Swen Brüseke >Sitz der Gesellschaft: Frankfurt am Main > >USt-IdNr. DE 267 075 918 >Registergericht: Frankfurt am Main - HRB 86239 > >Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. >Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich >erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie >diese Mail. >Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht >gestattet. > >This e-mail may contain confidential and/or privileged information. >If you are not the intended recipient (or have received this e-mail in >error) please notify the sender immediately and destroy this e-mail. >Any unauthorized copying, disclosure or distribution of the material in this >e-mail is strictly forbidden. > > - proIO GmbH - Geschäftsführer: Swen Brüseke Sitz der Gesellschaft: Frankfurt am Main USt-IdNr. DE 267 075 918 Registergericht: Frankfurt am Main - HRB 86239 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.