/srv/irclogs.ubuntu.com/2017/09/07/#cloud-init.txt

=== shardy is now known as shardy_afk
=== shardy_afk is now known as shardy
Be-Elhi11:11
Be-Elwe are planning to provide a shared filesystem in our cloud, and the information how to mount is should be stored in the vendor data. but we want users to have more control over it, e.g. enable/disable mounting11:14
Be-Elis there a simple way to do this, or does it require an extension to cloud init itself?11:14
=== asthasr_ is now known as asthasr
smoserBe-El, who is "we" are you the cloud provider or the user? and what is the cloud ?13:27
smoserif cloud-init gets storage configuration that says to mount things, it will write those things into /etc/fstab.13:28
smoseruser-data can be used to override any vendor-data provided.13:28
Be-El'we' are a group of several cloud providers working together and trying to provide a similar service to our users13:28
Be-Elthe details for each site (e.g. filesystem, host names / ip address of fileservers) may and will vary13:29
Be-Elthe cloud instances are all based on openstack, and using the package and mount modules works so far13:34
smoserso if the user wants to override the data you've provided they can provide 'mounts: []'13:35
smoserthat should work, then they'll get none. user-data wins over vendor-data.13:35
Be-Elbut I want to restrict the functionality to certain images (afaik there's no image metadata that can be accessed by cloudinit) and allow the user to disable it13:35
smoserso you want the vendor-data to only appear to certain images ? is that what you're saying ?13:36
Be-Elthat would be my preferred solution13:37
smoserwell, when i originally added vendor-data support on openstack i  did so in a way that you could implement a python class on the host.13:37
smoserthat class was given the instance-id and told to give vendor-data13:37
smoserthe default class just  read from the /etc/.../vendor_data.json13:38
smoser(this is from memory)13:38
smoserbut then at some point openstack started ripping out things like that. so that extensible functionality might be gone now13:38
Be-ElI'm currently thinking about a helper script whose execution is triggered by runcmd in vendor-data13:40
Be-Eland the script checks for the existence of some touched file (-> user data) and skips the mount operation13:40
Be-Elscript arguments will define the mount options etc.13:40
Be-Eldoable, simple design, but feels wrong13:41
smoserwell, if you want to provide different vendor-data to different instances based on some criteria, that was originally supported.13:42
smoserand i think that is what "would be [your] preferred solution".13:43
smoserso honestly that is what i would go for.13:45
smoserit looks like current openstack trunk has some mechanism to run a vendor-data service and have nova client plug into that.13:46
smoseri'm just looking at git logs13:46
Be-Elthe clouds are all based on the newton release, and openstack version upgrades are not that easy... ;-)13:46
dpb1heh13:47
Be-Elthere's a vendordata_driver option, but it is marked as deprecated13:47
smoserwell. 1f53bfcc7998f63f130a2cedaf15b41a4506c56813:47
smoseris a good commit message13:47
smoserhttps://review.openstack.org/gitweb?p=openstack/nova.git;a=commitdiff;h=1f53bfcc7998f63f130a2cedaf15b41a4506c56813:48
smoser"It is intended that this fix be backported to newton as well."13:48
Be-Elnewton also has a mechanism for using external rest services instead of a simple file13:50
Be-Elnot as easy as just providing the python class, but i'll have a closer look at it. thx for the hints13:51
Be-Eldoes cloud-init already use vendor-data.json and vendor-data2.json?13:55
smoserdoes not read vendor-data2.json only vendor-data.json13:56
smoserwhat is interesting to me is that they coudl have  used the existing class functionality to implement the remote rest api stuff13:56
smoserand thus kept backward compatibility a13:56
smoseroh well13:56
smoserbut i guess they wanted to be more strict on the extensibility portion13:57
Be-Eland backwards compatibility, data merging....14:04
smoserblackboxsw, rharper i'm working on bug 171512814:07
ubot5`bug 1715128 in cloud-init (Ubuntu) "Crashes in convert_ec2_metadata_network_config on ScalingStack bos01 (ppc64el)" [Critical,Confirmed] https://launchpad.net/bugs/171512814:07
smoserBe-El, are you poking fun at me!14:07
smoser(its entirely acceptable)14:07
Be-Eli'm german, we don't know how to have fun14:08
rharpersmoser: yeah; two things  1) we certainly should check that we have 'network' in the metadata dictionary safely  2) EC2Local runs before OpenStack datasource;  that's generally a problem if local datasources are positively identified14:13
rharperfor Azure, we confirm UUID;  and I thought that EC2 in Artful was in strict mode, which should have forced the UUID check, no ?14:13
smoserrharper, well, yeah.14:17
rharperoh, right14:17
rharperwell, even on non-intel, the system has a UUID, so unless they rolled unluckily and got ec2* for their UUID14:17
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33036114:24
smoserrharper, systems only have uuid (from dmi) on intel14:25
smosernot sure what you were meaning14:25
rharperon intel, yes via dmi;  in ppc64 though, they do set a uuid value from the hypervisor; they just don't send any product or other DMI related values (and it's not under the dmi path in sys)14:35
rharperthat info won't identify it as OpenStack, but it can be used to check that it's not EC2 (which I think is the path you're taking w.r.t EC2Local);14:36
rharperas other platforms run in Local mode and hit network; I think we need to require the positive ID to run the local variant14:36
smoserwell.. due to clones it can't identify "not ec2"14:40
smoserwe could be more strict yes. but we are not, so that it generally still works but give the warning, so we can fix things later (on non-intel).14:41
smoseron intel, cloud-init would have disabled completely14:41
rharperdo the clones report ec2 in UUID ? I didn't think any of them actually did that  vs. just subclassing EC2 and providing something else to identify themselves14:44
smoserunknown clones is the concern.14:49
smoseras they do not identify themselves at all and rely upon the old default behavior of falling back to ec214:49
rharperec2 in network mode though14:50
smoserif you said "uuid doesnt start with ec2, so exit", then they'd get no warning14:50
powersjsmoser: rharper: can one of you respond to https://bugs.launchpad.net/cloud-init/+bug/1711963 Reporter is asking how to get vendor and user data working together.15:29
ubot5`Ubuntu bug 1711963 in cloud-init "unable to merge vendor-data and user-data" [Undecided,Incomplete]15:29
smoserthis is wierd15:36
smoser2017-09-07 06:03:25,838 - stages.py[INFO]: Skipping modules ['runcmd'] because they are not verified on distro 'ubuntu'.  To run anyway, add them to 'unverified_modules' in config.15:36
rharperwhoa15:39
rharpersmoser: where's that from ?15:39
smoserthat was in the log on https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/171512815:45
ubot5`Ubuntu bug 1715128 in cloud-init (Ubuntu) "Crashes in convert_ec2_metadata_network_config on ScalingStack bos01 (ppc64el)" [Critical,Confirmed]15:45
rharperpowersj: on that one maybe smoser;  by my read there isn't anyway to "merge" keys from vendor data into user-data;  it's an override situation only ; ie, if you set the same key in user-data; that's all you get;  smoser do you expect that we could support a case where user-data wants to inspect/inherit vendor-data values ?15:48
powersjrharper: thx for looking - that's what I thought and tried to say in my response, so hopefully having someone else convey it15:49
smoserwell it merges in some way.15:51
rharperpowersj: I think you did; the submitter is right that "merging" config isn't clear about which sorts of configs get merged (and which dont)15:51
smoserit certainly *should* use the full merge support15:51
rharperI think the request is to merge conflicting keys between user-data and vendor-data; which I've always understand that to not be mergable w.r.t combining keys15:52
rharperthat is, how would a user override vendor-data if it's always merged together ?15:52
smoseruser-data always "wins".15:53
rharperright15:54
rharperin this case, I think the submitter wants to modify that15:54
smoserrharper, what is wierd in 'Skipping' above is that later in log15:54
smoser2017-09-07 03:06:10,312 - helpers.py[DEBUG]: Running config-runcmd using lock (<FileLock using file '/var/lib/cloud/instances/06c0123d-0393-44c7-87f5-3fb4734ffdd2/sem/config_runcmd'>)15:54
rharpersmoser: I can't find any record of that "unverified" string in cloud-init ; where is that coming from ?15:55
rharpersmoser: this is a proposed migration, right? so maybe it's being upgraded and rebooted ?15:55
rharperso same instance but different behavior due to reboot and upgrade ?15:55
smosercloudinit/stages.py15:56
smoser        if skipped:15:56
smoser            LOG.info("Skipping modules %s because they are not verified "15:56
smoser                     "on distro '%s'.  To run anyway, add them to "15:56
smoser                     "'unverified_modules' in config.", skipped, d_name)15:56
smoseri really can't come up with anything on that other than if they've added a cc_runcmd somewhere.15:56
smoseri dont know15:56
=== shardy is now known as shardy_afk
rharpercommit cc9762a2d737ead386ffb9f067adc5e54322456015:57
rharperAuthor: Chad Smith <chad.smith@canonical.com>15:57
rharperDate:   Tue Aug 22 20:06:20 2017 -060015:57
rharper    schema cli: Add schema subcommand to cloud-init cli and cc_runcmd schema15:57
rharperthat added the 'distros' tag to the module; possible they're on older artful image, booted, upgraded cloud-init, rebooted15:57
rharperand we don't handle that ?15:57
blackboxswreading backlog context now15:58
rharpersmoser: AFAICT this is a separate issue (unrelated to ec2 local on non-intel)15:58
rharperwe can file a separate bug for that I think15:58
blackboxswwhoa, so if I add a distros attr to the module it requires some level of validation16:00
blackboxswok looking at what we are doing there w/ the skip16:00
blackboxswstrange as the module documentation claimed "all" was supported16:00
blackboxsw(I think I also added a distros attr to cc_bootcmd too)16:01
blackboxswin a recent branch16:01
smoserblackboxsw, yeah, i didn't understand how 'all' was working16:02
smoserbut it sure seems to be. otherwise runcmd would log that error everywhere.16:02
blackboxswyeah looks like we extrapolate mod.distros as worked_distros and check against the actual distro name.  ok, so we need to expand 'all' to all known cloud init distros or define  DISTROS_ALL = None16:07
blackboxswjust filed #1715690 I'll get a branch together and I'm adding a unit test to https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33036116:15
blackboxswhttps://bugs.launchpad.net/cloud-init/+bug/1715690 rather16:16
ubot5`Ubuntu bug 1715690 in cloud-init "Defining distros = 'all' in a module for documentation results in a module skip as 'all' doesn't match distro 'x'" [High,New]16:16
smoserah. ok. so your chagne is new.16:21
smoserthat is good. understood now.16:21
blackboxswsmoser: yeah and it affects the existing bootcmd branch too.16:21
blackboxswtoo bad we do discovery on distro modules, I was thinking it would be nice to have a get_all_distro_names() method, but that'd be expensive as I need to find_modules and collect all the names16:22
blackboxswmaybe that's an okay expense as we do it only once in stages16:22
smoserblackboxsw, i *think* runcmd is straight up busted then, right?16:23
smoseras in an integration test of:16:23
smoserruncmd:16:23
smoser - [touch, /run/foobar]16:23
smoserwould show that failure16:23
smoserright?16:23
blackboxswyeah it'll skip it because it defines distros 'all' which doens't match actualy distro name16:23
blackboxswyeah I'll add an integration test16:23
smoserblackboxsw, thanks.16:23
smoserblackboxsw, so... on my networkign thing in ec2local16:24
smoseri was saying i wanted to raise NotImplemented16:24
blackboxswI like the branch, wanted a tiny unit test but yeah16:24
smoserbut returning None is the same from the consumer's perspective16:24
smoserie, if that property (its a @property) is None16:24
smoserthen it is ignored16:24
blackboxswtrue, you mean from network_config16:24
blackboxsw?16:25
smoserso returning None on that (and logging HEY THIS IS BUSTED)16:25
smoseryes, network_config16:25
smoserso if we lgged fail on that and returned None (as it did not actually have it) then we'd be better off16:25
smoserbut the issue with returning None is that it caches based on None16:25
blackboxswyes so network_config property in base could be smarter about 'network' KeyError and return None there16:25
smoserhm.. let me show you what i was thinking16:26
rharpersmoser: where is the network-config cache check ?16:26
blackboxswwas wondering about this http://pastebin.ubuntu.com/25484907/16:27
blackboxswrharper: line 287 of DataSourceEc2.py  if self._network_config is None16:28
rharpercertainly checking post convert if the value is still none would be valid16:29
rharperbut I guess I'm not getting the smoser is suggesting;   I think it's reasonable for the EC2 local ds to crawl metadata, not find the 'network' key and raise NotImplemented;  in stages, the _find_network_config would need a try: except NotImplemented and can log the NotImplemetnted exception (which ec2 could report that the metadata didn't have the 'network' key needed)16:31
rharpers/the smoser/what smoser;16:31
smoserhttp://paste.ubuntu.com/25484930/16:32
smoserblackboxsw, ^16:32
smoserNone versus _unset ... not sure how you really are to do that.16:32
smoserbut still want to cache the None result as work was done.16:32
blackboxswsmoser: in landscape we did UNSET = objecT()16:35
blackboxswsmoser: in landscape we did UNSET = object()16:35
blackboxswbut yeah I get it16:36
blackboxswsmoser: per rharper's comment, returning a None here on when we have an invalid datasource doesn't really cause cloudinit/stages.py to balk on the datasource, it proceeds with fallback nic right?16:38
rharperstages only cares if you have the attribute and assumes the network-config attr is valid16:39
rharperI think we still need a way to tell stages that the network-config may not be valid16:39
blackboxswright so it feels maybe like our best approach is for get_data() to return false then right?16:46
blackboxswocessingrso we don't even get into the network_config p16:46
blackboxswso we don't even get into the network_config processing16:46
rharperwell; whether or not we identify a datasource, and whether a datasource has network-config support are separate things that both need addressing16:48
rharperthe latter has a bug w.r.t a datasource claiming it has network-config support (which may not be valid) and stages assuming the presence of the attribute as an indication that the configuration in the attr is valid;16:49
blackboxswdoesn't testing the return value None from datasource.network_config tell us whether the config is valid or not?16:52
blackboxswin the case of None, we know there is no helpful valid content provided by the datasource so it can be ignored in that case16:53
rharperyes, you're right16:54
rharperI see that now in find_network_config16:54
blackboxswyeah per even the default dscfg = ('ds', None)16:55
rharperthat works nicely with the attempted consuming of network metadata in smoser paste16:56
blackboxswto clarify for me: so if our ec2 local datasource is running in an openstack environment, get_data will still 'work' because it's a lookalike metadata service. but network_config would in this case not define network_config info. Won't the datasourceEc2Local still "match?16:57
blackboxswit'll just use fallback nic in this case16:57
rharperwhich is what we'd want for look-a-likes which may not implement network metadata16:57
smoserblackboxsw, i'd seen object() before too17:00
blackboxswI guess so, I wasn't sure if we'd want cloud-init to limp along using a sub-optimal datasource.17:00
smoserbut i was afraid of that across un-pickling17:01
blackboxswsmoser: fair point. /me can't wait to remove pickling17:01
blackboxsw.... and break things in the process17:01
smoserit shouldl return None17:01
smosernetwork_config attr of None17:01
smosermeans "this datasource has no network config"17:01
smoserwhich is what the base class has17:02
blackboxswyeah I think rharper and I are on the same page w/ that17:02
smoserand is what Ec2 had before it started to have that17:02
smoserthen stages does the right thing17:02
smoserright17:02
smoseryeah. ok.17:02
smoserblackboxsw, so i'll commit the _unset thing ?17:03
smoserunless you have a better idea17:03
blackboxswso in a situation where Ec2 is run  against openstack. get_data still 'works' and network_config returns None so LocalEc2 will still get detected or are you also leaving in the get_data check on Platform.AWS?17:03
rharperEc2Local shouldn't run under non-intel openstack; https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/330361 I think covers that;17:08
smoserblackboxsw, yes. still leaqving the local check for platform.aws17:09
blackboxswsmoser: +1 on adding your pastebin to the existing patch, I only think network_md should be mandatory param to the convert_ function. and the change to accept network_md will probably affect unit tests http://pastebin.ubuntu.com/25485096/17:12
smoserblackboxsw, right. i'll change it to take mandatory17:18
smoserand i have updated the test.17:18
smoserblackboxsw, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33036117:19
smoserupdated17:19
blackboxswgrabbing17:19
smoserblackboxsw, i'm just going to grag stangatori's branch17:27
smosersound fine ? just merge17:28
blackboxswsmoser: +1 on that17:28
blackboxswwe can sort long-term cards for consolidation of comon 'imc' logic into cloud-init's net functions in subsequent cycles17:29
smoserblackboxsw, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33024217:30
smosercan you quick OK that ? i addressed your feedback.17:30
smoserapprove and mark approved17:30
blackboxswsmoser: approved17:31
smoserrharper, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32981117:36
smosercan you just mark 'approved' ? you 'Need Fixing'd and then approved in words, but not in changing your status17:36
dpb1smoser: so... #1711963.  legit bug?17:58
smoserat very least a bug on doc18:01
dpb1smoser: ya, the doc could use an example18:01
blackboxswsmoser:  comments added here https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/330361 +1 with the unit test18:08
blackboxswsmoser: left it as approved assuming the changeset passes CI (I tested locally w/ tox -e py27(18:09
smoserblackboxsw, i'll grab your test.18:14
smoserthanks18:15
smoserblackboxsw, di dyou have a merge request that you wanted me to look at ?18:24
smoserfor https://bugs.launchpad.net/cloud-init/+bug/1715690 i thought.18:25
ubot5`Ubuntu bug 1715690 in cloud-init "Defining distros = 'all' in a module for documentation results in a module skip as 'all' doesn't match distro 'x'" [High,New]18:25
blackboxswsmoser: will put one up. I was sidetracked fiddling w/ unittests18:36
blackboxswI need about 20 mins18:37
blackboxswsmoser: WDYT about a get_all_distros method in distros/__init__.py which calls importer.find_modules and returns a list of all discovered distro names supported18:37
blackboxswwe'd only have to call that function once at  line 823  of cloudinit.stages18:40
blackboxswI'll draw up a sample diff18:41
blackboxsww/out unit tests for feedback18:41
rharpersmoser: done18:43
blackboxswside note, found a logic bug in stages18:43
blackboxswso for all modules we call distros.Distro.expand_osfamily18:43
blackboxswand we call expand_osfamilies(mod.osfamilies) and that'd raise a ValueError on undefined osfamilies. But an environment might have actually provided a pluggable Distro, which isn't tracked by expand_osfamilies. So they wouldn't actually be able to make use of that module18:46
blackboxswit's a corner case that impacts only non-std Distros which aren't already included in cloud-init/distros/OSFAMILIES18:47
* blackboxsw really dislikes the magic of def fixup_module(mod, def_freq=PER_INSTANCE):18:49
smoserbackwards compatibility18:50
smoserand originally crappy smoser code18:50
smosermake for crappy code18:50
blackboxswas it magically sets module attributes distros, osfamilies, frequency (due to the sideeffects & operations in stages.py)18:50
blackboxswhahaa18:50
blackboxswI'd much rather explicitly see osfamilies = [], distros = [], osfamilies = []  in all cc_*py . Then, at least it's more explicit in the module things that a module should care about defining18:52
blackboxswbut yeah, not sure how that computes w/ backward compatibility18:53
blackboxswok, for real, let me get a branch together.18:53
smoserblackboxsw, ...19:13
smoserif a:19:13
smoser  print("this is fine")19:13
smoserelif b:19:13
smoser   print('this is also fine")19:13
smoserelse:19:13
smoser   # i want to assert something here in a unit test...19:14
smoserwhat do i use .. ?19:14
smoserah. maybe just raise assertionError19:14
blackboxswor just assert(something)19:15
blackboxswand it'll cause that assertion error to be raised in unit tests19:15
blackboxswI'm not sure that's what you meant19:15
smoserwell, i just want the test to FAIL19:15
smoseri think19:16
smoser raise AssertionError("neither a nor b was true.")19:16
blackboxswI have seen that in unit tests before. it'll work19:18
smoserrharper, commented https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33036119:37
smoserplease read.19:37
smoserbasically.. .if we ds.network_config raises an exception, then cloud-init will generally fail. and such a failure will likely result in us seeing it.19:38
smoseri'm not entirelsy opposed to having convert_ec2_metadata_network_config try better to check and raise ValueError and then catching that one error and returning None and logging WARNING.19:39
blackboxswsmoser: rharper a lot of our modules document that they are supported on distros: all. Do we want module docs to represent the actual distro names, or would 'all' suffice19:43
blackboxswnow that I have a get_all_distros function we could make docs specify: ['ubuntu', 'gentoo', 'freebsd', 'debian', 'fedora', 'centos', 'sles', 'rhel', 'arch', 'opensuse']19:43
blackboxswor just leave it at "distros: all" which could account for 3rd party distro modules added in another env19:44
blackboxsw"it" being documentation on rtd19:44
smoserblackboxsw, i think 'all' should suffice19:50
smoserit means all distros supported by cloud-init19:50
smoserno ?19:50
blackboxswyes on all distros supported by cloud-init.  And agreed, the generic 'all' feels better and doesn't preclude 3rd party distro addons if there were any19:51
blackboxswstrange is we already have an integration test which exercises runcmd.19:52
blackboxswthrying to find out why that's not failing19:52
smoserhm.19:52
rharperblackboxsw: alternatively can we match any module if supported is 'all' ?19:55
rharperthat would avoid a list expansion19:55
blackboxswrharper: smoser just pushed functional https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+ref/config-modules-allow-distros-all20:03
blackboxswit shows what I was thinking, I'm adding unit tests now20:03
blackboxswhttps://git.launchpad.net/~chad.smith/cloud-init/commit/?id=34297260006768be70904cecd2d66b2b5d97d2c420:04
blackboxswyeah rharper that agrees with your suggestion20:04
blackboxswkindof20:04
blackboxswactually it doesn't. heh. it expands if 'all' is listed20:05
blackboxswlemme see if we can avoid it20:05
blackboxswhah, maybe I'm reading this wrong, that Skipped log is only a log, it looks like we still actually run the module20:07
blackboxswstages.run_section doesn't do anything with the skipped modules it finds20:08
blackboxswit still blindly calls _run_modules(mostly_mods)20:08
blackboxswit doesn't pop the module off or anything20:08
smoserblackboxsw, that would explain integration test passing20:10
smoserand lowers the severity of this bug :)20:10
blackboxswyep indeed20:10
blackboxsw:)20:10
blackboxswI was searching the logs of that bug you referenced to see if I can find a successfully ran runcmd too20:10
smoserrharper, what are you looking for on convert_ec2_...20:10
rharperit return None if it's not equivalent to fallback (ie, we have  a subnet)20:11
rharperwe should either have  a subnet with dhcp, or  a subnet with a static ip20:11
rharperotherwise, it's a busted network configuration20:11
blackboxswon the flip side of the "skipping " not really skipping, it also looks like forcing doesn't actually force the module to run either20:11
rharperblackboxsw: =/20:11
blackboxswrunning unverified_modules: %s   is just a log and has no bearing on whether the module is run20:12
smoserhttp://paste.ubuntu.com/25485882/ <--20:12
smoserthat has better validity checking.20:12
smoseri'll get one more check20:13
blackboxswman that's a lot of bulletproofing smoser20:13
blackboxswfeels like it's leaning toward overkill, and that we would actually run into that ValueError or TypeError issue if we try to use the object as a dict20:15
blackboxsw>>> a ='non-dict'20:15
blackboxsw>>> a['interfaces']20:15
blackboxswTraceback (most recent call last):20:15
blackboxsw  File "<stdin>", line 1, in <module>20:15
blackboxswTypeError: string indices must be integers, not str20:15
blackboxsw>>>20:15
rharperI'm much more worried about the values and keys in the dictionary20:15
blackboxswwhy check isinstance dict everywhere and not just try to use the object and handle typeerrors instead20:15
rharpermac address may be mixed case,  we might not have public-ipvX key;  any case where we get back a network-config that doesn't apply dhcp or a static ip is going to result in uncaught badness; in which case it would be better to report busted ec2 network config and use fallback20:16
rharpernote, this is for a  ec2-clone path20:16
blackboxswheh, validated the case from the Skipping runcmd logs, I see it also runniing that runcmd log (and why our integration tests still pass)20:18
blackboxsw2017-09-07 06:03:26,068 - stages.py[DEBUG]: Running module runcmd (<module 'cloudinit.config.cc_runcmd' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_runcmd.py'>) with frequency once-per-instance20:18
blackboxswupdating the bug20:18
smoserblackboxsw, well, the individual checking gets you better error messages. is the only reason for that.20:19
smoserand KeyError being more vague20:19
smoserrharper, i dont necessarily agree that "better to report busted ec2 network config and use fallback"20:20
smoserbecause "reporting" means no one ever sees a problem because you "fixed" it for them.20:20
rharperthat's fair20:20
smoserwhere as failing badly means you see errors20:20
rharperbut see the bugs about non-intel identifying themselves in openstack for why to log and move forward20:20
smoserhttp://paste.ubuntu.com/25485922/20:21
rharperand the bug we're fixing today that's "cloud-init" fault in artful on non-intel20:21
smoserrharper, wel... if we logged and moved forward there.20:21
smoserwe'd have just kicked the can well down the path20:21
smoserand never known about the fact that these instances were now using the "mostly functional" ec2 datasource when it owuld have been better to use the openstack one20:21
rharperI know; there's no good answer if we're not going to go and fix it ourselves20:21
smoserwhich was the original design goal20:22
rharperthe busted network config (And using fallback) can have a banner just like ds-identify did20:22
smoserwell, one way or another we need to have this fixed today.   the fix that is there irght now will solve the bug20:23
smoserand my today is running short20:23
blackboxswhttps://bugs.launchpad.net/cloud-init/+bug/1715738 filed20:27
ubot5`Ubuntu bug 1715738 in cloud-init "Cloud config modules are not skipped based on distro support" [Undecided,New]20:27
rharperI'm fine with a follow up20:27
blackboxswI'm+1 on your approach either way. will review what you have again smoser. I was just throwing peanuts at the testing if isdict, but not a true concern20:28
rharperif I work on this: https://bugs.launchpad.net/cloud-init/+bug/170825520:28
ubot5`Ubuntu bug 1708255 in cloud-init "empty or invalid network config dictionaries are not handled well" [Undecided,New]20:28
rharperthat'll help20:28
smoserok.20:29
smoseri'm going to add a unit test that trips the ValueError20:30
smoserand then push with that patch most recent above.20:30
smoserman though.20:30
smoserthat really would just kick the can and we wouldnt even know about this problem20:31
smoserso maybe i convince myself to just leave it as it is20:31
asthasrGood afternoon! Another question. I have put a script in /etc/cloud/scripts/per-boot (the pre-existing directory) while building an AMI. After standing up an EC2 instance based on this AMI, that script does not seem to run. Is there some config I have to set to make it happen?20:33
smoserasthasr,  /var/lib/cloud/scripts/per-boot20:39
asthasroh.20:39
asthasrwhat's the /etc one for?20:39
smoserthe same thing as /etc/i/dont/know/why/you/have/that/directory20:40
smoser:)20:40
asthasroh, sorry, i misspoke. I'm actually putting them in /var/lib/cloud/scripts/per-instance. Long day :p20:40
smoserasthasr, the module 'scripts_per_instance' should run those20:41
smoseri'll do a quick test20:41
asthasrmy workflow is to use packer.io, which templates that script in, and then gives me an AMI. I then use terraform to build an instance based on that AMI20:42
smoserrharper, :-(20:42
smoser$ lxc init ubuntu-daily:xenial x220:42
smoserCreating x220:42
asthasrmy expectation would've been that the script runs and I see the resulting test file when I log into the new instance20:42
smoser$ mount-image-callback lxd:x2 mchroot /bin/bash20:43
smoserlxd:x2: no rootfs in /var/lib/lxd/containers/x2/rootfs. Not a container?20:43
rharpersmoser: whoa20:43
rharper=(20:43
smoseri think the path now doesn't get created until 'start20:43
rharperboo20:43
rharperissue time20:43
rharperhrm, working for me on xenial20:44
rharpersmoser: what lxd do you have ?20:44
rharperI'm on 2.0.10-0ubuntu1~16.04.220:44
smoser$ dpkg-query --show lxd20:44
smoserlxd2.17-0ubuntu220:44
smoseri noticed it a while ago20:45
smoseri'll file an issue, but i dont have high hopes20:45
rharperwell, it's pretty critical to our integration testing on lxd no ?20:45
asthasrwell, I'm dumb. It needs to be u+x or it won't run.20:48
asthasr:)20:49
rharperasthasr: was there any log about it not being u+x ?20:49
rharperI think scripts-per are executed via cloud-init invoking subprocess on 'runparts'20:49
rharperrun-parts;  hopefully we caught some error there20:50
asthasrrharper: not that I see.20:50
asthasrsaw, I should say; I didn't spot any errors. Unfortunately I already killed the instance.20:51
rharperif you recreate, would be good to get the cloud-init.log (and cloud-init-output.log) and file an issue; it'd be helpful to see an error in the logs for something like that I think20:51
smoserhttps://github.com/lxc/lxd/issues/378420:52
asthasrrharper: Understood. Will try tomorrow.20:52
smoserrharper, we have a runparts function. does not use the utility20:53
smoserit does not log anything on non-executables20:53
rharperindeed20:54
smoseruploaded ubuntu/0.7.9-267-g922c3c5c-0ubuntu121:04
blackboxswsmoser: are we SRUing that?21:16

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