/srv/irclogs.ubuntu.com/2016/09/22/#cloud-init.txt

=== smatzek_ is now known as smatzek
smoserharlowja, i can get you one, send an email to me asking for it and i'll forward correctly15:39
apollo13hi, I am trying the centos 7 cloud images on xenserver and was wondering how/which datasource they try to use16:32
apollo13since xenserver obviously does not support cloud-init at all I tried sniffing with tcpdump to see if it tries the EC2 method etc… but nothing16:33
smoserapollo13, it depends on how the image is configured17:09
smoseri woudl have thoguht they'd try the ec2, but they might only try openstack or config drive.17:09
apollo13smoser: I mounted the raw file, can I easily check? there is no datasource config in /etc/cloudinit, so it should fall back to the default list?17:09
smoserprobably something like:17:10
smoser$ lxc exec x1 -- grep -r datasource /etc/cloud/cloud.cfg.d17:10
smoser/etc/cloud/cloud.cfg.d/90_dpkg.cfg:datasource_list: [ NoCloud, ConfigDrive, OpenNebula, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Ec2, CloudStack, None ]17:10
smoserif there is no config, it should actually try all of them.17:10
apollo13mhm, what are the requirements for EC2? I put the VM onto a network with no DHCP in the hopes that it would assign itself a 169.254 ip addr and then try it17:11
smoserapollo13, no. it wont do that. that is to be done... and that is the ultimate goal.17:12
smoserbut right now, it will fallback to dhcp17:12
apollo13ah so I need to serve dhcp with those IPs?17:12
apollo13or rather: is there any easy config mechanism I could use in a network which does not really support cloud-init17:13
smoserapollo13, http://ubuntu-smoser.blogspot.com/2013/02/using-ubuntu-cloud-images-without-cloud.html17:15
apollo13or rather could I use a No Cloud datasource to bootstrap somethng else?17:15
smoserthat works for ubuntu images.17:15
smoserright.17:15
smoseryou can also actually just add the config inside the image if you're willing to do that17:15
apollo13smoser: I would be willing to do that basically I could reconfigure the ec2 source to use an ip on my network, right?17:16
smoseryou could do that probably yeah.17:17
smoseralso this:17:17
smoser doc/examples/cloud-config-datasources.txt17:17
apollo13assuming I could do this, are there any docs on the ec2 format?17:17
smoserso... easiest thing for you to do17:18
smoseris to mount the image and add /etc/cloud/cloud.cfg.d/my-stuff.cfg17:18
smoserwith17:18
smoserhttps://git.launchpad.net/cloud-init/tree/doc/examples/cloud-config-datasources.txt17:18
smosersee lines 28 there... you can put user-data and meta-data right inside the image17:18
smoserits completely static at that point, but that migth be sufficient for you17:18
smoserfor ec2 metadata17:18
smoserhttps://gist.github.com/smoser/1278651/17:18
apollo13oh I could also set seedfrom for the NoCloud source?17:19
apollo13then it wouldn't even be static17:20
apollo13https://git.launchpad.net/cloud-init/tree/cloudinit/sources/DataSourceEc2.py#n42 <-- there we go17:20
apollo13I need instance-data somewhere :D17:20
apollo13and there I can put your server, no?17:21
smoseryeah. you can do that.17:21
smosernocloud can also 'seed_from' a url17:21
apollo13yeah, but then I do not need to remaster the image and can work with everything17:21
apollo13smoser: ok, I can play with that -- thank you so much17:25
apollo13I'll report back later, lets see if I can get that to work17:25
roaksoax817:26
apollo13smoser: that thing is weird, it tries to query 20:30:04.279650 IP 172.22.1.225.50786 > gw01.bap.lan.domain: 54179+ A? does-not-exist.example.com. (44) and what not but not instance-data :D gotta setup a password and see what the log says18:31
harlowjasmoser cool, thx, will send u a offical email18:33
apollo13oh it also tries metadata.google.internal -- that one looks like I could hook into18:33
apollo13the google metadata server looks nicer anyways (looking at the cloudinit source)18:33
apollo13and they actually document it :D18:34
apollo13ah amazon too18:35
smoserapollo13, yeah, you can read the code for does-not-exist18:35
smoserthats trying to work around providers who do dns ...18:36
smoserwhats that called.18:36
apollo13jupp, though I wonder why it checks everything but not ec2, where is the default log?18:36
smoserwhere they give you their web server18:36
apollo13dns redirects probably18:36
smoserso http://does-not-exist.example.com takes you to your service provider18:36
apollo13yeah18:36
apollo13smoser: I feel stupid now, the image seems to be buggy :( unexpected error nonetype object has no attribute status_code for the ec2 source :D18:45
apollo13lets see where that could happen18:45
apollo13does cloud-init also run after starting the machine? it seems that after the machine came up with fallback config it retries to request the config19:05
rharperit's part of init; so it runs every boot (but not everything is re-run each boot, there are different frequencies);  I'm not sure; but if it didn't find a datasource then on next boot, it will attempt to find it again19:20
rharperif it does find a data source, it will cache that along with the instance id, and as long as that data is present, it won't attempt to acquire datasource again.19:21
apollo13rharper: okay, and on the absolute first boot, when I get a login mask -- does cloud-init already have finished at that point?19:24
rharperyes19:24
apollo13so nothing run in parallel or so… weird, cause I am getting requests for the ec2 data quite late19:25
rharpercloud-init runs through roughly 4 stages;  init --local (looks for a local data source, like config drive, etc);  init-network (bring up networking and look for datasources on the network);  at this point if it doesn't find a data source, it goes to fallback, then modules mode=config (this runs the configuration modules); and then a modules mode=final  which runs any configuration and final boot scripts before exiting a19:25
rharpernd letting it finish booting19:25
rharperno, cloud-init is quite serial by design19:26
rharperif you put ssh keys in your user-data, they need to be imported and available before networking comes up and sshd runs, etc...19:26
apollo13okay, I just started a new vm -- lets see, I'll give it five minutes but I think after booting there is another service running requesting metadata19:26
apollo13or still cloud-init periodically requesting data till it gets something19:26
rharperthere's no service running; just cloud-init in 4 distinct phases19:27
rharperno19:27
rharperno background service19:27
apollo13okay, maybe I indeed rebooted the machine, I'll give it a few minutes19:27
apollo1321:27:36.503771 IP 172.22.1.221.60060 > app01.bap.lan.8773: Flags [S], seq 541007663, win 29200, options [mss 1460,sackOK,TS val 4294777761 ecr 0,nop,wscale 5], length 019:27
apollo13ha19:27
apollo13that is a minute after the login prompt is there19:27
apollo13that is a request to instance-data.:877319:28
apollo13and yet another minute later another try, so something is clearly still running19:28
apollo13any ideas where from that would be coming :D19:29
rharperI don't know your image19:29
apollo13the centos generic cloud image19:29
rharperbut cloud-init  doenst' background any service19:29
apollo13mhm, kinda chicken-egg like :D19:30
apollo13I cannot get into the machine till cloud-init is through, but that fails currently :D19:31
apollo13maybe I really modify the image to set a password for testing19:31
rharpercan you get at the image offline?19:31
rharpermount it up and extract the /var/log/cloud-init.log; that'd be very useful19:31
rharpercloud-init also dumps processing to console-log, so having serial console output is informative too19:31
apollo13yeah, let me see if I can kill it without shutting down19:32
rharperI'll be back in a bit, so please continue with questions and I'll reply when I can19:33
=== rtheis_ is now known as rtheis
apollo13rharper: ok, can I shutdown the vm or would really killing be better?19:35
apollo13oh wait, I just snapshot it, shut down and reset19:35
apollo13rharper: http://apolloner.eu/~apollo13/.tmp/cloud-init.log19:41
apollo13that 19:27 where it calls instance-data. is when I said "<apollo13> 21:27:36.503771 IP 172.22.1.221.60060 > app01.bap.lan.8773:" -- at this point I already had a login there19:42
apollo13though the messages log seems to indicate that multi-user target is reached later, which makes sense, lets try a new vm :D19:45
apollo13I tried logging in now, will post auth.log and messages soon19:46
apollo13oh wait, I maybe should have mentioned that I am/was trying to login via the console from xenserver which probably shows the single user mode :D19:48
apollo13jupp that was it, sorry for beeing so stupid19:58
apollo13or not, I learned a lot about cloud-init and audit logs :D19:58
apollo13I'll call it a win19:59
rharperapollo13: looking at the logs, cloud-init finished here: Cloud-init v. 0.7.5 finished at Thu, 22 Sep 2016 19:30:58 +0000. Datasource DataSourceNone.  Up 312.13 seconds;  after this anything that cloud-init blocked during start-up will continue; including reaching multi-user target later;20:00
apollo13rharper: yes and I tried logging in __before__ that on tty1 :(20:00
apollo13I just thought: hey vm is up already, wth didn't cloud-init do something20:00
apollo13little bit embarrasing ^^20:00
rharperno worries; it's rather complicated20:01
rharperat least the interplay between all of the systemd units and services20:01
apollo13so, the next question is on whether to impelment a google metadata service or ec2, any suggestions?20:01
rharpercan you attach disks ?20:02
apollo13are there any nice docs somewhere on which keys my api should return etc?20:02
apollo13jupp I can20:02
rharperthen I'd use a config drive source20:02
apollo13ah no, to lazy20:02
apollo13and I need a sideproject :D20:02
rharperattaching a blob of yaml formatted as an iso seems a lot easier than implementing a metadata service20:02
apollo13but boring20:03
rharpersurely20:03
apollo13google seems to be better documented and from the looks of it it doesn't need more than a few fields20:04
roaksoax/w/win 820:04
apollo13?20:05
apollo13https://dpaste.de/5YWj/raw <-- pretty much al that is needed, then throw that behind a nice django iface and I am done20:05
apollo13that + xenapi and colleagues in the office don't have to get on my nerves for a new vm, sounds like a win win20:06
apollo13mhm, last but not least, can I somehow configure static networking via cloud-init?20:10
rharperyes20:11
rharperbut for centos you'll need 0.7.720:11
apollo13mhm, any docs :D20:11
rharperyes, one sec20:12
apollo13(I apparently searched with the wrong terms)20:12
harlowjaok smoser sent a formal request to yourubuntu email20:12
smoserharlowja, k20:12
rharperapollo13: doesn't look like it's quite made it into the 0.7.7 docs; but the format is yaml and looks like this: http://curtin.readthedocs.io/en/latest/topics/networking.html20:13
smoserits tricky though... that has to exist inside the image (which kind of defeats its purpose)20:14
smoseror be read from a static datasource.20:14
smoseror, the kernel command line.20:14
rharperno, network_data.json20:14
rharperfrom metadata service could work20:14
rharperbut that looks different20:14
apollo13:D20:14
smoserno. doesnt work.20:14
smoserrharper, because networking is only applied by local datasources.20:14
rharperbleh20:15
apollo13which kinda makes sense, but reconfig would be nice20:15
rharperapollo13: cloud-init has to work with all sorts of cloudes20:15
rharperclouds20:15
rharperreconfig is on the roadmap , way down at the end20:15
rharperbut, that's the idea20:15
rharperuser modifies the instance (hotplug), cloud-init could ask the cloud for new metadata and update config20:16
rharperhttps://specs.openstack.org/openstack/nova-specs/specs/liberty/implemented/metadata-service-network-info.html20:16
rharperthat's the network_data.json format, cloud-init will read that from a ConfigDrive; but as smoser said, it has to be attached (i.e. a local datasource)20:16
apollo13crazy crazy :D20:16
apollo13I guess I could just pull in networkd files and restart via that…20:17
apollo13ah damn, not in centos7 yet, well dhcp it is then20:17
apollo13oh, it is there, they rolled in 21920:17
smoserthe way to do this... getting network configuration data from a network datasource is as it is being proposed at20:20
smoser https://code.launchpad.net/~utlemming/cloud-init/+git/cloud-init/+merge/30347120:20
harlowjaapollo13 perhaps nrezinorn can share a cent7 package with u at some point20:21
smoserapollo13 could add a datasource that brings up ipv4 link local networking, finds information about its config, and then reads data and metadata.20:21
harlowjahe's been rolling through the cent7 changes and adjustments recently20:21
harlowjarolling through/into/over20:21
harlowjalol20:21
apollo13that sounds nice, but for now I can write a small service, that is enough for now20:23
harlowjak20:25
rharpersmoser: that merge from utlemming looks neat20:26
smoserrharper, yeah. that is what we want to get to.20:27
smoserand can do that on any cloud that clearly identifies itself.20:27
rharperyep, see the DMI bits20:27
smoserright.20:27
apollo13dmi? that will be harder to fake for me I guess :D20:28
rharperapollo13: exposing the cloud provider via SMBIOS data (DMI table on x86)20:28
rharperlinux does a dmidecode (flags to extract a specific field, like BIOS vendor)20:29
apollo13yeah, but /me is no cloud, just hijacking requests to metadata servers^^20:29
rharperwith that, cloud-init can assume it's running on a particular cloud and can use that cloud's datasource code20:29
rharperif you launch VMs, you're a cloud =)20:29
apollo13I am a rocket first and foremost20:29
apollo13or spaceship if you are kind^^20:29
rharperxen also supports supplying/injecting SMBios data  (at least HVM)20:30
rharperhehe20:30
* rharper notes nick of apollo13 checks out 20:30
* rharper relocates, bbiab 20:30
smemshhi, is static network config supposed to work on ubuntu 16.04 ? this has worked fine for me with 14.04 and centos, but 16.04 it seems to just use dhcp and my static config from meta-data is nowhere to be found23:54
smemshthe interface name is ens2, which i changed in meta-data, but that still does not fix it23:54
smemsh(originally i was using eth0)23:54

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