/srv/irclogs.ubuntu.com/2017/05/18/#cloud-init.txt

=== sambetts|afk is now known as sambetts
blackboxswsmoser: rharper : does cloud init always go through all cc_* modules  when trying to process a config or does it attempt to filter to only those cc_* modules for which a section key is present.16:46
blackboxswerr that was a ?16:46
rharperblackboxsw: no16:46
rharperthere are several controlling factors16:46
rharperI think we've documented this; lemme find it16:46
rharpernot that I can find easliy16:47
rharper=(16:47
rharperblackboxsw: so, in the system_info configuration (defined in /etc/cloud/cloud.cfg) there are lists of modules to run at various stages16:47
blackboxswcool yeah I just missed the docs/comments explaining why as i was wondering why cc/handle needs to check for key and log a "skip"16:47
rharperthose are considered the default list of modules that run16:47
blackboxswso, for example,  chef is defined in the final module stage, but if there is no chef config defined why would we attempt to run the module's handle()16:51
blackboxswdo some modules actually perform work if no section key is present?16:52
blackboxswI know ntp performs work if both pools and server lists are empty.(creating default pools). But that at least requires an ntp  key in your cloud-config16:53
farcallersmoser: hi16:54
rharperblackboxsw: so, typically if you provide top-level config for a module, it will run; some modules (if in the default list) will run whether config is provided or not;16:54
rharperntp, for example, is in the default list in /etc/cloud/cloud.cfg16:54
rharperchef, however, is not16:54
blackboxswI misunderstood, I thought cloud_final_modules list containing chef & puppet in /etc/cloud/cloud.cfg means chef will be run by default. Is that cloud_final_modules treated differently than cloud_config_modules in the cloud.cfg?16:58
rharpersorry, I didn't realize what was in the list16:58
blackboxswoh ok. good good16:58
rharperyes, it will run if in the list;  typically the modules should have a check to see if they have config or not and quickly exit16:58
blackboxswyeah I was wondering about shortcutting that last part "e if they have config or not and quickly exit" so that they don't even get called if no config16:59
blackboxswso that the handlers get a little simpler (knowing that they aren't called if their schema-defined keys are not present).17:00
blackboxswbut not something for this branch I'm working currently. Just thoughts bouncing around in my head17:00
blackboxsw... as there's a lot of empty space in there (my head17:01
=== sambetts is now known as sambetts|afk
smoserfarcaller, hey.17:05
smoserwhats up, farcaller ?17:05
farcallersmoser: sorry, got afk for a moment17:47
farcallersmoser: I got you a simple implementation of NoCloud via dmi: https://bugs.launchpad.net/cloud-init/+bug/169177217:48
ubot5Ubuntu bug 1691772 in cloud-init "provide a way to seed NoCloud from network without image modification." [Medium,Confirmed]17:48
farcallerI think it's safe enough in that you need to have nocloud magic string for it to work, and it's very simple to pass through via qemu / libvirt / whatever.17:48
smoserfarcaller, that looks nice.17:56
smosera few thoughts17:56
smosera.) can you give an eexample of qemu cmdline that you use. (i'im guessing its like the kernel command line... you're puttting ds=nocloud;seedfrom=http://)17:56
farcalleryep, I use exactly that17:57
smoserb.) not sure if serial number seems right or not here (admittedly we'll be abusing something)17:57
farcallerand yes, it's definitely quite an abuse, I guess other fields could work better, but I'm not sure. It's up to "cloud" owners to see what they are willing to sacrifice, I guess?17:58
smoserwell, if you're passing 'seed' in that way, your'e not really a "cloud" owner i dont think. right?17:58
farcalleryep17:58
smoserie, if you've *acutally* got a cloud, lets take a similar path to what brightbox did17:58
farcallerthat's what I think too17:59
farcallerit's more useful for small scale / hobby stuff17:59
smoserits really good idea. and somethign iv'e wanted to do before. thanks for raising it.17:59
smoser (unfortunate that smbios is only x86... arm64 has it, but qemu bugs prevent using)18:00
farcalleryep18:00
farcallerit's just that ec2-like md server is still the simplest way to bootstrap18:01
smoserfarcaller, you can also fairly easily modify your smbios to look like ec218:03
farcallernot really, I tried that :)18:04
farcallercloud-init seems to look into sysfs for ec2-like uuid18:04
smoserwell... thats because it was broken18:04
farcallerI couldn't find a way to fake that18:04
smoserits fixed now i'm pretty sure (in trunk)18:04
farcallerI see. I was experimenting with 16.10 image, I believe18:05
smoseryou ahve to set product serial and uuid to the same value and they ahve to start with ec2 (case insensitive)18:05
farcallerdidn't work for me there18:05
farcalleryep, I definitely tried doing that18:05
smosercommit was at 370a04e8d7b530c1ef8280e15eb628ff6880c73618:06
smoserit went in last week, not in an image yet.18:06
farcallerack18:06
smoserfarcaller, do you know how big that can be ?18:07
smoserhow long the fied18:07
smoserfield18:07
farcallernope. I didn't check tbh. I verified that it fits seedfrom with ip address, and that's it18:08
larskssmoser: I'm seeing unit test failures on fedora because DataSourceCloudStack is trying to access /var/lib/NetworkManager, which requires root access.18:37
smoserselinux=off18:38
smoser;)18:38
larskssmoser: nope.18:38
larsksdrwx------. 2 root root 4096 May 17 10:53 /var/lib/NetworkManager18:39
larsksUnit tests shouldn't be trying to access anything outside of the current directory in any case.18:39
larsksOr current directory + any tmpdir for the test.18:39
smoseragreed.18:39
smoser(i was just joking about selinux)18:39
larsksIs there any chance we can get automated ci running on a centos system?18:39
smoserlarsks, there sure is!18:39
larsksIs there anything I can do to help?18:40
smoserhttps://jenkins.ubuntu.com/server/view/Cloud-init/18:40
smoserthe centos-6 and centos-7 are running now (and passing)18:40
smoserpowersj just got that up a few days ago.18:40
larskssmoser: I am confused as to why they are passing, given the errors I am seeing locally.18:41
smoserthey dont run on MP but on trunk nightly18:41
larsksMy centos7 box has the same permissions on /var/lib/NetworkManager as the  fedora system on which I'm working.18:41
smoserprobably becausae they run in an lxd image that doesn't have networtk manager18:41
powersjyeah I'm cheating by using lxd, don't have hardware for dedicated centos system yet18:41
larskspowersj: just installing the NM package into the LXD container should trigger this problem, right?18:42
larsksBut I guess the real solution is to fix the unit tests.18:42
smoserii suspect it should trigger it, and yeah, we can fix the unit tests. i'll give it a try here.18:42
smoseri suspect i can just mkdir -p /var/lib/NetworkManager && chmod 70018:43
rharperyou need to touch a file in there18:43
larskssmoser: awesome, thanks.18:43
rharperif os.path.exists(d) and len(os.listdir(d)) > 0:18:43
rharperthen it'll try to parse it18:43
larskssmoser: I would vote for just installing the package, rather than trying faking it.  Because who knows what other permissions we might be missing?18:44
smoserhm.. well it wasnt that easy18:45
smoser sudo chmod go-rX /var/lib/NetworkManager/18:45
smoserand18:45
smosertox-venv py3 python3 -m nose tests/unittests/test_datasource/test_cloudstack.py18:45
smoserstill works for me.18:45
larsksIiiinteresting.  I bet that https://github.com/cloud-init/cloud-init/blob/master/cloudinit/sources/DataSourceCloudStack.py#L179 is finding one of the other directories in that list.18:47
smoseroh. because i have a /var/lib/dhclient probably18:47
larsksYeah.18:47
smoseryeah18:47
larsks:)18:48
larsksWhat if we just mocked out get_dhclient_d?18:50
smoserlarsks, i think just mock get_vr_address18:52
raspadohi all, I tried to disable autmount of ephemeral storage to /dev/vdb via cloud.cfg but our instance is still creating ephemeral -> /dev/vdb, here is my example https://pastebin.com/8HkNbbEd , any other method I can take to preventing epehemeral storage from auto mounting to vdb?18:53
larskssmoser: or that.18:53
smoserbut get_client_d would work to, and then you could even populate it18:53
smoserwith a file that shoudl get correctly parsed.18:53
larsksRight, that was my thought.18:54
larskssmoser: https://code.launchpad.net/~larsks/cloud-init/+git/cloud-init/+merge/32427719:11
larsksthat mocks out get_latest_lease (which was simpler than mocking out get_vr_address, since we can just return None)19:12
smoserthat'll do.t hanks.19:20
raspadohi all, anyway to disable mounting of ephemeral0 -> /dev/vdb?19:24
larsksraspado: that's not a "mount"; that's just the name of the block device.  I don't think it gets mounted anywhere automatically.19:32
raspadocloud.cfg doesnt manage that?19:37
larsksNo, the linux kernel automatically creates block devices entries for any devices it discovers.19:38
larsksThat's just normal kernel behavior.19:38
raspadoso if ephemeral storage is available, the kernel will auto discover and allocate it to a device id? hmm is that just cloud-aware os's?19:39
larsksNo, that's just normal Linux.  IF there is a block device attached, THEN you get an entry in /dev.19:39
raspadohmm so in my case when i build an instance that has ephemeral storage, it automounts to /dev/vdb, I was hoping I can manipulate that via cloud.cfg somehow19:40
raspadoah well..19:40
raspadohttp://cloudinit.readthedocs.io/en/latest/topics/examples.html#adjust-mount-points-mounted19:43
raspadofs_setup: may be able to disable this?19:43
=== rangerpb is now known as rangerpbzzzz
=== powersj is now known as powersj_
=== powersj_ is now known as powersj
blackboxswpowersj: rharper smoser ok here's the start of the schema validation tool for ntp with sample failures (poor formatting from by for loop) http://pastebin.ubuntu.com/24601457/22:25
blackboxswfrom *my* for loop22:25
* rharper looks22:41
rharperblackboxsw: super interesting ... so, looking at the valid ones; and I'm not sure we can do much about it;  the strings for hosts or ips...23:20
rharperthose could be valid in the schema since we're only specifying the encoded type as string or list or dict;23:21

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