/srv/irclogs.ubuntu.com/2020/07/01/#cloud-init.txt

crandonOdd_Bloke: Hi Again! So I rather recreated the issue locally. Here's the cloud-init.log: https://pastebin.com/33iVf0pb As a reminder: the ntp config from user-data not getting populated to chrony.conf11:29
=== meetingology` is now known as meetingology
=== vrubiolo1 is now known as vrubiolo
=== cpaelzer__ is now known as cpaelzer
blackboxswcrandon Odd_Bloke is off today. I see you are on cloud-init 18.5 I'm wondering two things, would you be able to run and paste `sudo cloud-init query userdata` be wary if you have secrets/passwords defined in your user data17:22
blackboxswalso, it may make a difference as a lot has changes since 18.5, we have a copr repo up with some rpms built from tip of upstream cloud-init master here that may assist in confirming if this a bug that has already been resolved https://copr.fedorainfracloud.org/coprs/g/cloud-init/cloud-init-dev/17:23
blackboxswcrandon: ^17:23
blackboxswas well17:23
=== vrubiolo1 is now known as vrubiolo
AnhVoMSFT@rharper what are the potential ramifications of moving mounts to config stage?18:45
AnhVoMSFTOne thing that comes to mind would be modules such as write_files won't be able to use mounts indicated in mounts unless write_files is moved to config stage as well18:45
rharperAnhVoMSFT: yeah, also, folks can mount up things like /home or whereever write_files might want to send things;18:55
crandonblackboxsw: Hi! Thanks for taking this over. I checked and the command you've sent prints out the user-data file content.19:03
crandonblackboxsw: I'm updating now cloud-init to see if the newer version behaves differently.19:07
rharpercrandon: can you confirm if you have /etc/cloud/templates/chrony.conf.*.tmpl ?19:08
AnhVoMSFTactually in Ubuntu cloud images today (at least the azure ones) mounts module comes after write_files, so that point is moot anyway19:09
rharperah, in this centos7 cloud image, I don't see 'ntp' in /etc/cloud/cloud.cfg19:10
crandonrharper: I do, but: there's no chrony.conf.centos.tmpl (only fedora and rhel, plus some other non relevant ones)19:10
rharperah, centos should use the rhel tmpl19:10
rharperin your paste earlier I don't see cc_ntp   ...   and your user-data has ntp: {}  at min in there?19:11
crandonNope, there's no ntp in /etc/cloud/cloud.cfg19:11
crandonSo you're saying the ntp module is not enabled, hence the problem?19:12
rharpercrandon: right, so they've left the ntp config module off by default19:12
rharpercrandon: yes19:12
rharperyou can manually force to run it like:  cloud-init single --name cc_ntp19:12
rharperassuming you've already supplied ntp:  {} config in your user-data;  if not, you can do it in a separate file,  cloud-init --file my_conf.cfg single --name cc_ntp;  that should run it19:13
crandonGrrr... why would one do that I wonder... I'm using a cloud image not to have to maintain an image myself. Configuring NTP is something very basic, unless of course the reason is, that they assume, that the VM will sync it's clock with the host, which then can be synced via NTP19:13
crandonThis didn't alter the chrony.conf either: cloud-init single --name cc_ntp19:14
rharperAnhVoMSFT: right; wont help write files, but it does help with user homedir19:14
rharpercrandon: I think I need to get you more config;  each distro may have a default policy; I though centos preferred chrony; lemme dig up the config19:14
crandonAh wait, I updated cloud-init, but didn't reboot yet.19:15
crandonHmm "cloud-init single --name cc_ntp" failed.19:17
rharperlooks like there's a bug, chronyd.service not chrony.service19:17
crandonYep, that seems to be the issue19:18
rharperand, if you run in a container, it may not allow you to run;19:18
crandonBut now at least I can see the entries from user-data being populated to the config19:18
rharpercrandon: can you file a bug on the chrony/chronyd  ?19:18
crandonSure, but the version is still cloud-init single --name cc_ntp19:19
crandonIs it still relevant?19:19
rharperlemme check upstream; one sec19:19
rharpercrandon: yeah, it's still listed as chrony for the service name19:20
rharperso, bug is relevant;19:21
crandonOk, I'll submit a bug. I guess NTP being off by default is something I should check with the RH/CentOS guys, right?19:21
rharperwell, I suspect you're getting systemd-timesyncd by default ; it's a "good enough" one-shot ntp service;19:22
rharperin this centos7 cloud image, it has systemd-timedatad.service ...   not sure if that's the same;19:23
crandonChrony is there by default, I haven't installed it myself also it is enabled by default, while systemd-timedated is not. Regardless, either will require modifying the cloud.cfg to include ntp... Is it possible to modify cloud.cfg via cloud-init :) ?19:26
crandonThe filed bugreport: https://bugs.launchpad.net/cloud-init/+bug/188595219:29
ubot5Ubuntu bug 1885952 in cloud-init "Wrong service name used for chrony when restarting service" [Undecided,New]19:29
rharpercrandon: thanks!19:31
crandonhttps://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/chap-kvm_guest_timing_management: "To avoid the problems described above, the Network Time Protocol (NTP) should be configured on the host and the guest virtual machines. "19:33
crandonSo it seems RedHat suggests using NTP in guest eventhough: "KVM avoids these issues by providing guest virtual machines with a paravirtualized clock (kvm-clock)"19:33
crandonrharper: Well, I guess there isn't much we can do for now. I'll try to submit a bug/feature request to RH to include the NTP module by default. I wonder if they left it out because of this bug...(which would not be nice without raising the bug themselves...)19:35
rharperright, typically modern hosts and guests use kvmclock and a paravirtual interface to keep the guest clock up-to-date;  however;  ntp in the guest can help with higher resolution data and drift, https://opensource.com/article/17/6/timekeeping-linux-vms19:37
rharpercrandon: I played around with getting ptp bits enabled, but never finished up that work;19:38
crandonWell, I guess for new, I'll either create a custom image with ntp enabled in cloud.cfg and the service name fixed (or systemd-timesyncd being used), or just configure chrony via ansible after deployment. I guess I'll do the later, otherwise I'll have to maintain the image for the customer, which I'd like to avoid....19:44
crandonrharper: Thanks for your and also blackboxsw' and Odd_Bloke's help!19:45
rharpercrandon: yw19:45
crandonA small compliment if you allow, is that there aren't that many IRC communities around, with this level of activeness/support. Thx again.19:46
rharpercrandon: =) Thank you19:57
rharperparide: cloud_tests lxd bits don't seem to work with lxd 4.0 ... I'm fighting the image export;  is this known ?20:56

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!