=== harlowja_ is now known as harlowja_away === zz_gondoi is now known as gondoi === gondoi is now known as zz_gondoi === zz_gondoi is now known as gondoi === sauce_ is now known as sauce === gondoi is now known as zz_gondoi === zz_gondoi is now known as gondoi === shardy is now known as shardy_afk === harlowja_away is now known as harlowja_ [18:02] smoser, so I was wondering if I had anything more to do for patch https://bugs.launchpad.net/cloud-init/+bug/1275098 [18:02] hey, r-daneel [18:03] so the reason it languisued is probably [18:03] that i just didn't have focused time to think about it. [18:03] its very non-trivial. [18:04] you mean the logic is non-trivial ? [18:04] in that bouncing network adapters early in boot feels strange. [18:05] and may have unintended side effects. [18:06] i suspect the reason the interfaces came up was because they were "left over" from a previous instance ? ie, in a "capture" ? [18:07] well, I experienced only 2 cases: 1. I have no proper networking, so bring_down/bring_up has no side-effect, 2. I have wrong IP info, so I anyway will break networking by replacing the IP [18:07] the case arises when we clone a volume [18:07] and then try booting a new VM from the clone [18:08] the OS has already an IP (the previous - wrong - one) and has it configured before cloud-init runs [18:08] of course, cloud-init does all is needed in the config files [18:08] but it's too late [18:08] as interfaces are set up [18:09] now doing an ifup, either adds the new IP or fails totally [18:09] smoser u alive! [18:09] yeah, i dont know why my bip proxy didn't join here. [18:10] now it will. [18:12] r-daneel, so i'm admittedly not all that knowledgable about how boot works on centos and cloud-init. [18:12] but in ubuntu, networking comes up in parallel to the local datasource. [18:12] smoser, as far as I could understand from the code, we end up calling the _bring_up_interface() method [18:12] if thats the case on centos (or even if its not, because i want to solve this correctly), [18:13] then the 'ifdown' could fail with "interface not up" [18:13] or between cloud-init takign it down and then back up, the OS could bring it up. [18:13] smoser, ifdown failing does not seem to be a real issue to me [18:13] and the cloud-init's "ifup" would fail [18:14] r-daneel, it may not seem to be an issue. [18:14] but you can't blindly ignore it. [18:14] maybe try/catch that call and pass in case of failure 6 [18:14] ? [18:15] failure 6 ? [18:16] basically you have a fairly straigh tforward failure path, with a fairly straight forward work around. [18:16] simply remove non 'eth0' (or all) interfaces before you "capture" and snapshot. [18:16] (sorry '6' is the lower case for '?' on my keyboard :p) [18:16] but fixing it by just going willy nilly with 'ifdown && ifup' seems to be racy [18:17] and i'd rather have a guaranteed failure with striaght forward work around [18:17] smoser, this is a volume clone, the OS is not aware of being 'freezed' [18:17] than sometimes-it-doesnt-work situation [18:17] r-daneel, understood. [18:17] but you could easily "prep" before "capture". [18:18] generally, cloud-init has made you not have to "prep" (clean). and i've wanted to make that always "just work" [18:18] but there are some wierd cases, where I don't knwo what the right behavior is. [18:19] well, I understand that proper 'prepping' would be the right thing to do [18:20] for instance debian/ubuntu have that udev file you'd need to cleanup [18:21] debian/ubuntu should not have udev files [18:21] unless you're using an odd MAC range [18:21] but obviously, when we boot on a clone, the only issue we get is with IP configuration [18:22] yeah. i do understand this is an issue. and i'd like to have it fixed properly. [18:23] if we try to do that very cleanly, we should check if there is a pre-existing setup or at least check if the network is setup as exepcted by our freshly installed config [18:23] its really hard in ubuntu, and i suspect it might be in centos too (if not now, then it might be later with move to systemd) [18:23] we could then only ifdown if we really already have a wrong setup [18:24] the ordering of boot is just very much not guaranteed [18:24] when cloud-init does ifup it already assumes an ordering [18:25] it assumes no interface is set, and that noone will fiddle with it [18:25] well, sort of. [18:25] even worse, on centos it adds the IP to any existing config [18:25] not enforcing the setup [18:25] if there was no interface configuration, for ethX, and cloud-init writes an interface configuration for ethX , at least in current ubuntu (and i think centos) nothing is magically going to bring it up [18:25] so that case is safe to assert "it was not up" [18:26] ubuntu/debian 'ifdown' is terribly annoying. [18:27] but cloud-init happily overwrites the existing config files [18:27] if you remove ethX from /etc/network/interfaces and then ifdown an interface that was already up, it says "not configured" [18:27] r-daneel, yeah, agreed. its not perfect now. [18:27] if interface is non-existent, not being able to ifdown it has no effect at worse [18:28] and in ubuntu/debian the call is ifup ALL, not event per interface [18:28] s/event/even/ [18:29] the sanest thing to me seems to be to block any network events from occurring while you're going looking for "local" data sources [18:30] again, ifdown on a non-setup interface or one that has wrong info wouldn't bother me, ... if I do changes by hand then reboot, ifdown will fail on shutdown and OS doesn't care [18:30] then, correctly reading "existing config" and merging it with config from config drive. [18:30] merging is ok, but you're likely to conflict with what is set [18:30] but ignoring things that might fail sometimes is not helpful to anyone. [18:31] well, if you conflict and you're blocking all networking coming up, thne you set it right. [18:31] ie, config-drive would "win". [18:31] (possibly allowing for cloud.cfg configuration that modifies that behavior) [18:32] do you know if you could block all networking from coming up on centos ? [18:32] but the cloud-init service in the OS comes after the OS own's script for network setup, as it seems [18:32] i suspect i can do it on ubuntu, pretty sure you can do it fairly easily on sysvinit. [18:32] so how will you prevent the OS from setting the network info ? [18:33] there are 2 cloud-init services [18:33] local and 'init'. [18:33] the local can read only local datasources [18:33] ok, let me check ordering ... [18:33] and cannot presume netowrking, but can set up networking. [18:33] then... there is the other thing that adds a twist here. [18:34] in reality, i suspect that ocnfig drive is not long for this world. [18:34] hmm ? configdrive will be removed 6 [18:34] ? [18:34] its static nature is just too limiting. i suspect in time to come, config-drive will disappear as the metadata service is able to provide dynamic data. [18:35] are you familiar with how hot-plug of network interfaces works on amazon ? [18:35] its really nice. [18:35] interface added, causes udev rules to fire that create and name the interface. [18:35] those same rules say "oh, look, i'm on EC2, and that means the metadata service might tell me what IP address I should get". [18:36] (this doesn't work on ubuntu but on Amazon Linux AMI it does) [18:36] ok, I see [18:36] https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1153626 [18:37] that is a much more sane way of doing things [18:37] and going that rougte would still mean we potentially have the issue that you were seeing (already existing config) === praneshp_ is now known as praneshp [18:38] r-daneel, i'm not opposed to getting this working better. [18:38] and don't mean to sound stand-offish [18:38] its just not as easy as it might first appear. [18:39] I see your point, we use configdrive because of inherent reduction of complexity and security [18:40] i don't really know that anything is more secure. [18:41] if your host network is compromised, i think you have significant issues. [18:41] and as for complexity, i think that openstack networking generally being difficult to get right is what lead to pepole wanting config drive and its initial popularity), but at least in my recent experience, that is much better sorted now. [18:42] ie, you dont have "no route to 169.254.169.254" issues so much. [18:45] exposing a common service to all tenants seems much more risky than giving access to a file on the host. Someone escaping his VM is a much bigger problem but less likely to happen [18:46] smoser: hi there [18:47] r-daneel, but you've already exposed dozens of common services to your guests ;) [18:47] smoser, such as ? [18:47] nuetron-api, nova-api, dhcp, dns [18:48] smoser, these are control planes not the VM infrastrucutre [18:48] dhcp and dns are on vm infrastructure [18:48] we have no dhcp and dns is external [18:49] i dont know. if you can't securely route traffic from one vm to an endpoint specific to that vm, then you cant actually do networking securely between 2 vms of a single tenant. [18:50] so yes, i agree, it is mroe complex, but its not complexity that you can actualy do without i think in the end. [18:50] alexpilotti, whats up? [18:51] smoser: waiting for an answer on which is the minimum / recommended cloud-init version with MaaS metadata support :-) [18:52] oh. sorry. [18:53] our 12.04 images use 0.7.0-0ubuntu2 [18:53] so thats surely known-working [18:53] smoser: great, so with 0.7.4 we are good [18:55] smoser, when trying to keep things as secure and non-complex as possible, we found it useful to use configdrive. I agree that at some point in time we may need more flexibility and my walk the metadata-server way. For now I find it useful to have the choice between statically set information in configdrive and dynamic setu through metadata-server. [18:56] r-daneel, and you're certainly not alone in that decision :) [18:57] smoser: tx, doing some tests [19:01] smoser, so back to our initial topic ;) as far as I remember, the 'local' and 'init' phases both ran after the OS had finished setting the IPs. Am I wrong ? [19:04] r-daneel, on ubuntu, local happens [possibly] in parallel with any 'auto' interfaces. [19:04] '[possibly]' is very complex. [19:05] but for almost all cases i can think of they're in parallel, and nothing forces them to be serialized. [19:05] i do not know about centos. [19:05] sysvinit iseasy to do these sorts of things :) [19:05] centos service ordering is S10network, S50cloud-init-local, S51cloud-init, S52cloud-config, S53cloud-final [19:11] for ubuntu, I did not fully check. experience showed (in the logs) that we were always doing ifup on an already up interface and ifup refused to override [19:11] r-daneel, yeah, so on centos, it should be possible to just put cloud-init-local before S10 [19:12] the one thing that that breaks, which i dont think is a real issue is network mounted filesystems (ie, /usr/ on nfs) [19:13] if you have the wrong IP, our setup prevent you from communicating (anti spoofing) if it could, we'd mess up things because of IP collision [19:16] smoser, then we still have no better solution for ubuntu [19:17] smoser, would it be more acceptable to do the ifdown/ifup cycle only on failure of the initial ifup ? [19:18] maybe, yeah. [19:19] i'm guessing one way or another we can force cloud-init local to run before and block networking coming up [19:19] but it will probably be tricky [19:20] (since as it is, netowrking comes up on udev events) [19:20] (network-intreace-added) [19:21] sorry.. net-device-added [19:22] so for those relying on udev, cloud-init should already be hooked-in to 'know' what to do [19:24] yeah. is complex though... elcoud-init explicitly actually emits the net-device-added when its inside a container [19:24] (as lxc instances don't get those events) [19:32] smoser, would it help to implement that ifdown/ifup in the platform specific files ? maybe only on ifup failure ? I understand that we're trying to march toward a future-proof solution but this will require a lot more code-diving on my part :) [19:33] i dont mind if ifup/down is in 'distro'. [19:33] err.. in per-distro code. [19:39] ok, I'll try to come up with distro-specific code. Will get back to you for a review once done :) [19:40] smoser, thank you for your help === gondoi is now known as zz_gondoi === oobx_ is now known as oobx === zz_gondoi is now known as gondoi === gondoi is now known as zz_gondoi