/srv/irclogs.ubuntu.com/2018/05/11/#cloud-init.txt

=== mgagne is now known as Guest16323
GaelHi All!14:15
Gaelis there a command to update only security upgrade on a linux with cloud-init?14:15
dpb1well, he didn't wait around long. :)14:19
caribouHello everyone, I'm investigating an issue where the cloud-init.service (bionic) fails to complete because it encounters /var/lib/cloud/instance being a directory instead of a symlink14:42
caribouI only found LP: #1531880 that talks about a similar issue but it went silent14:43
ubot5Launchpad bug 1531880 in cloud-init "Failed to start Initial cloud-init job (pre-networking)" [Undecided,New] https://launchpad.net/bugs/153188014:43
cariboulooks to me like it could be a race condition as two instances off the same image on our infrastructure (Scaleway) do behave differently14:44
rharpercaribou: I've seen those every so often when rebooting before the cloud-init has completed running;  we;ve never been able to reproduce them14:52
caribouwell, I started two instances off the same image, one has the symlink & the other has a dir :-/ I'm starting a third one for a tie breaker14:56
caribouI cannot call it reproducing it but I'm hiting it rather often, let me know if you want me to turn on some more debugging (cc_debug maybe))15:40
paulmeysmoser: I just read your comments on my NTFS mp16:40
smoseryeh16:40
smoseror backwards response 'hey'. which ever seems more approriate.16:41
paulmey:-)16:41
paulmeyI like how you propose to always wipe NTFS and explain that there are better choices for filesystems16:42
smoseron linux16:42
paulmeysure, let's not speak of any other os...16:42
smosernot that ntfs isnt a fine filesystem, but the only reason i can think to use ntfs on linux is dual boot16:43
smoseror data recovery16:43
smoserand ... dual boot on a cloud instance ?16:43
paulmey... yeah16:43
paulmeybut still, rharper seemed still pretty concerned with possible data on the NTFS partition...16:44
* paulmey checks what waagent does16:44
smoserwell, we're only doing this to the ephemeral disk16:45
smoserright ?16:45
smoseri think we safeguard that pretty well16:45
smoserso the peole that we could potentially foobar...16:45
smoserare the ones that somehow managed to use ntfs on that ephemeral disk (which cloud-init would have wiped if it could access it)16:46
smoserso on that boot, cloud-init was able to mount the filesystem16:46
smoserand then that person booted into a kernel (or os) that did not have ntfs16:46
smoserall while ignoring the "do not put important data here" warning16:47
paulmeyhttps://github.com/Azure/WALinuxAgent/blob/fb7d6c51dac236538a8c9eb8e752159d5e3f54b8/azurelinuxagent/daemon/resourcedisk/default.py#L14916:47
smoser*and* MS wipes that disk for them sometimes...16:47
paulmeywaagent doesn't care at all16:47
smoser(wipes on a re-locate)16:47
smoserso basically... if this issue comes up, i'll just say "i think your instance must have gotten re-located, and MS lost your data, not cloud-init"16:48
smoser:)16:48
smosercan i have your phone number to give the user in that case, paulmey ?16:48
paulmeysure, I'll pm it16:48
smoser:)16:48
smosercan you think of some reasonable path that got a user to this stage ?16:49
rharperpaulmey: I just wanted smoser  to sign off on the approach as well given the effort we went through to make sure cloud-init didn't wipe user-data;16:49
smoseri really really dont want to delet people's data16:49
paulmeyI understand... but their data should not be there in the first place, it's not your fault ?16:50
smoser:) that was joking.16:50
smoserhow did they get the data there was more the question16:51
smoseri think this policy seems sane:16:51
smosera.) if we can mount it, then check... dont reformat it if it has files16:51
paulmeyagreed16:52
smoserb.) if we cannot mount it... then check a config variable, if that variable says not to delete, then dont.16:52
smoserhow did the user get into the 'b' case...16:53
smoserthe 'b' case where they *had* data on it.16:53
paulmeyDefault when config is not there is to delete if we can't mount?16:53
smoseri really think that is probably in the order of 7 people ever16:53
smoserright. default the config to allow cloud-init to reformat ntfs filesystems on the ephemeral disk16:54
smoserbut we also want to make sure that this is *ONLY* the ephemeral disk that we might do this to16:54
paulmeyIn the 4 years that I've done oncall here, I've never seen a complaint about data loss on the ephemeral drive...16:54
paulmeyMy guess is that customer support just points to the docs and helps the customer go through the stages of grief16:55
smoserhttps://siliconangle.com/blog/2011/08/01/third-largest-bitcoin-exchange-bitomat-lost-their-wallet-over-17000-bitcoins-missing/16:55
* smoser wants to avoid being the reason that that happened16:56
paulmeyit's very hard to protect people from aiming at their foot16:56
paulmeybut I appreciate the effort16:57
smoser:)16:57
paulmeyI sign off on your policy, @rharper ?16:57
paulmeybtw, usually people end up in the b) case due to cloud-init not being able to format the disk in the first place. However, the issue is usually more that the fs is now NTFS instead of ext4...16:59
rharperpaulmey: smoser's additions sounds fine to me; but that is new space; also requires new cloud-init though I suppose they need that anyhow today16:59
paulmeycreating swap files or the docker directory on the ephemeral drive if it is NTFS is not going to work well...16:59
rharpersmoser: did you have a suggestion for the config namespace , what key should users add to say, don't nuke my ntfs drive even if you can't mount it ?17:00
paulmeynote that the code is in the DSAzure... so maybe a ds config?17:01
smoseryeah, in the azure datasource is the rigth place it seems17:05
smoseryou'll have to be careful though to not just set it in the dsconfig in that  module.17:05
smoserbecause if you do that, it ends up trumping config on disk17:05
smoserwe just need to make sure that if the user put it in /etc/cloud.cfg.d/ or in user-data, that they are respected.17:06
paulmeyok, I'll try to make tests for that17:06
paulmeyspecifically17:06
smoserpaulmey: and can we please me sure that we WARN iif the 'a' case found files on it17:07
smoserWARNING: it looks like you're using NTFS on the ephemeral disk, to ensure that filesystem does not get wiped, set THIS_CONFIG_OPTION17:07
paulmeywill do17:08
paulmeydatasource.azure.never-destroy-ntfs ?17:09
paulmeyor datasource.Azure.never-destroy-ntfs (I need to look that up)17:10
smoserunderscores rather than -17:13
smoserand lets qualify that with 'ephemeral' in some way17:13
paulmeyok, datasource.Azure.never_destroy_ntfs_on_ephemeral_disk ?17:15
robjoNeed some help please, out of ideas about whet to try :( need the yaml to configure ntp17:19
smoserrobjo: ok.17:20
robjo- ntp as entry under cloud_config_modules: enters cc_ntp.py17:20
robjobut as soon as I add anything then things fall over17:20
robjoI am thinking I should be able to do17:21
robjo- ntp:17:21
smoserpasetbin what you're giving it ?17:22
robjohttps://paste.ubuntu.com/p/58DdVk3wYB/17:24
smoserits not under cloud_config_modules17:25
smosercloud_config_modules is just a list of modules that are to be run17:26
robjoOK, so what should it look like?17:26
smoserjust put it in as17:26
smoser http://paste.ubuntu.com/p/52DgZBNcJh/17:26
smoserhttp://cloudinit.readthedocs.io/en/latest/topics/modules.html#ntp17:28
smoserthe code blocks (Examples) might help as an example17:29
robjobut shouldn't I see cc_ntp somewhere in the log?17:30
robjoI even put a debug statement in handle (first line) and I am not getting it17:30
robjoI am only getting the debug if I have -ntp under config modules17:31
robjobut hen of course I cannot configure anything17:31
robjoor maybe I am testing wrong, I tested with "cloud-init modules" and "cloud-init init" and for bothe cases I am not seeing the expected output in the log??17:35
smoserrobjo: well to most easily test,17:38
rharperif you're running cloud-init from the command line to re-run modules, you likely want cloud-init --file mycloud.cfg --debug single --name cc_ntp --frequency always --report17:39
smoser cloud-init single --name=17:39
smoseryeah that^17:39
rharperwhere myconfig.cfg contains the config from smosers's paste17:39
smoserbut i'd  just put myconfig.cfg in /etc/cloud/cloud.cfg.d and not ptoher with --file17:39
rharperotherwise, if you want to test how it's called during firstboot,  you can do: cloud-init clean --logs --reboot;17:40
robjothanks, testing17:46
paulmeysmoser: so should I still check for mount.ntfs? or is it safe enough to assume that if that existed on $PATH, mount would have found it?17:53
smoserwell, i think we just try to mount it17:56
smoserwith mount -t ntfs17:57
smoserif that doenst work, then we consult that config option17:57
smoserright ?17:57
paulmeyyeah I'm all for that17:58
robjoOK, I cleared out /etc/cloud.cfg and set it to only contain what's in http://paste.ubuntu.com/p/52DgZBNcJh/18:05
robjothen I ran cloud-init clean --logs --reboot18:06
robjoand when the machine comes back there is no trace of cc_ntp running in the log file18:06
robjoand  grep ubuntu /etc/ntp.conf comes back empty18:07
smosercan you paste the log ? /var/log/cloud-init.log18:07
smoseri suspect your changies to cloud_config_modules made it not ru18:07
robjowell there is no cloud_config_modules section now, do I need both? i.e. -ntp in the modules section and the ntp config outside?18:11
smosercloud_config_modules: is just a list of modules18:11
smosernot config of those mmnodules.18:11
smoserif you took that out, then it wont run the ntp module18:11
robjoyay, sorry for being so dumb about this, just goes to show how often I look/need to look at the config18:14
robjo I guess it would be good to have an ntp configuration example in the docs18:15
rharperI'm pretty sure we do18:15
rharperhttp://cloudinit.readthedocs.io/en/latest/topics/modules.html#ntp18:15
robjoI looked, I promise and search fro ntp turned up empty on http://cloudinit.readthedocs.io/en/latest/topics/examples.html18:16
robjos/fro/for/18:16
rharperyes, not added to examples. but examples under the module documentation18:16
rharperwe could add a message in the examples page to refer to module docs for further examples ?18:16
robjowell the disconnect, and I was looking at the sources which basically is that example is the it is not obvious, at least it was not obvious to me that - ntp was needed under the cloud_config_modules and the actual configuration for the parameters was outside of the cloud_config_modules section18:18
robjowhich is why I poked around at first trying to shoehorn the ntp config itself into the cloud_config_modules section18:18
robjowhich obviously didn't work either18:19
rharperso, the way I look at it, and we can clarify, is /etc/cloud configures cloud-init; and users configure the modules via user-data18:19
rharperbut I too struggled with the disconnect for a while as well18:19
rharper /etc being the system/distro config space, and user-data covers things the user would like to change, modify18:20
robjoWell that's fair but there are cases where this kind of stuff is built into an image and then you end up in the situation I was just in18:20
robjoof course I now learned my lesson and thanks for the help, but if it happens to me I bet I will not be the only one18:21
rharperfor sure18:21
robjoothers may just not necessarily know where to go for help18:21
rharperdo you have a suggestion for the docs page?18:21
robjoso a short example cloud.cfg file that shows the key bits of this case may be helpful18:21
rharperthis case being ? system-wide ntp default configuration ?18:24
rharpersorry, I missed the start of the convo18:24
robjoyes18:26
rharperyeah; that seems like a good add18:27
robjohmm doc/examples/ in the source tree has cloud-config-ntp.txt but that doesn't show up on http://cloudinit.readthedocs.io/en/latest/topics/examples.html18:30
robjobut that looks to be an example about how to send the information as user-data18:30

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