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

redcavalierHi, I've updated my cloud-init to 0.7.9 on centos 7 with a centos 7 package I found there : https://buildlogs.centos.org/c7-extras/cloud-init/20170705233059/0.7.9-3.el7.centos.x86_64/01:54
redcavalierI've been testing the new version and I'm getting a strange error regarding utf8 encoding when my test VM starts01:54
redcavalierEssentially I get AttributeError: 'dict' object has no attribute encode . Is that version of cloud-init currently compatible with openstack?01:56
blackboxswredcavalier: could you file a bug, I know we have builds using copr build service https://copr.fedorainfracloud.org/coprs/g/cloud-init/el-testing/builds/02:01
blackboxsw0.7.9.3 per your version feels stale compared to 0.7.9+224.g681baff-1 in our copr build service02:02
blackboxswif you hit this issue again on the newer centos build, I'd be curious to see /var/log/cloud-init.log from the affected system02:04
blackboxswhttps://bugs.launchpad.net/cloud-init/+filebug if needed02:04
redcavalierblackboxsw, thx, I was under the impression that copr only had recent fedora builds. I'll try that build and come back if I still get an error02:05
redcavaliera shame that the official centos repo's versions are downright ancient.02:06
blackboxswper earlier meetingology discussion:   4:12 PM J<•jose> it should stick. we had an issue and I had to kill all the meetingology instances, that's why it got out02:06
blackboxswyeah, though it's hard to get every distro to update on the same schedule :)02:06
redcavalierblackboxsw, still got the error, here's the full trace of it : https://pastebin.com/tmv7asfL02:44
blackboxswhrm I guess what content was in vendordata_raw from your openstack instance. might have to dig into this a bit more, could you file a bug redcavalier (I'm end of day today) include the following if you could http://pastebin.ubuntu.com/25475835/02:48
redcavaliersure no problem02:48
blackboxswI know you are centos && openstack and our latest copr build. but the  rest would be good contxt02:48
blackboxswcheers02:48
redcavalierthx02:49
=== shardy is now known as shardy_afk
=== shardy_afk is now known as shardy
=== shardy_ is now known as shardy
larstobiwebI am trying to get cloud-init to interpolate $local-ipv4, $local_ipv4, $private-ipv4 or $private_ipv4, but none of them work. I am booting CentOS 7 with cloud-init 0.7.9 on CloudStack. "curl -s http://10.30.5.1/latest/meta-data/local-ipv4" from within the VM shows the IP address that I want.10:21
larstobiwebI also couln't locate the place in the docs where this is described.10:21
larstobiwebCan anybody help me find out how I can get cloud-init to interpolate the local ipv4 address in the cloud-config?10:22
blackboxswsmoser:EphemeralIPv4Network does already             self.cleanup_cmds.append(15:44
blackboxsw                ['ip', '-family', 'inet', 'link', 'set', 'dev', self.interface,15:44
blackboxsw                 'down'])15:44
blackboxswthat should be run via subp on __exit__ from EphemeralIPv4Network15:45
blackboxsw                ['ip', '-family', 'inet', 'addr', 'del', cidr, 'dev', self.interface] too15:45
blackboxswIf we are seeing devices left "up" maybe cloud-init saw them up in the first place, and would have logged Skip ephemeral network setup, %s already has address %s15:46
smoserblackboxsw, well, i think i see a few issues.15:52
smosermaybe_perform_dhcp_discovery() sets link up but never sets it down15:52
smoser(and that state would be inherited by EphemeralIPv4Network)15:52
smoserand then i *think* EphemeralIPv4Network unconditionally will take it down15:53
blackboxswahhh right, right on maybe_dhcp_discovery15:54
blackboxswhmm so, in that case I'd expect to see Skip ephemeral network setup, %s already has address %s in our ec2 logs always15:55
blackboxswand ephemeralIPv4 will leave an "up" interface up if it specifically didn't set it up15:56
blackboxswso that logic interaction between maybe_dhcp_discovery and Ephemeral needs a fix15:56
smoserblackboxsw, i just launched an instance. i'll import you to poke around in a minute16:01
blackboxswsame16:02
smoserubuntu@13.58.109.19916:02
blackboxswahh thanks16:02
blackboxsw2017-09-06 16:01:03,490 - util.py[DEBUG]: Running command ['ip', '-family', 'inet', 'link', 'set', 'dev', 'eth0', 'down'] with allowed return codes [0] (shell=False, capture=True)16:03
blackboxswlooks like we tore it down smoser16:03
smoserblackboxsw, wrt this breaking some-old-openstack16:06
smosertheory: non-intel fell down the "fallback to ec2" path because of non-intel16:07
smoserthen we end up trying the new api endpoint16:07
smoserwhich probably doesnt exist (that i can verify)16:07
smoserwe should actually be able to force this failure path on server stack16:07
smoseror  get close16:07
blackboxswahh you mean we somehow die on ec2 inspecting 2016-09-02 version16:08
blackboxswagreed, we can try that route. or I wonder about  our test httpretty regiester_mock_metaserver16:09
blackboxswhmm, server stack would be the easiest route for a real openstack env. I'm looking over DataSourceOpenStack to see what it does w/ network setup16:11
blackboxswsmoser done w/ ubuntu@13.58.109.199 thanks. I'll play w/ other instances16:23
blackboxswshall I shut it down?16:23
smoserblackboxsw, i'll kill it. thanks.16:47
asthasrHi! Just a quick question. I am trying to make custom AMIs using Packer. I would like every machine that I spin up with this custom AMI to execute a cloud-init script once (to pull configuration). What is the most robust way to make this happen?18:28
blackboxswasthasr: when you say once, do you mean once per boot, or once per instance? Maybe you are talking about something like this? https://cloudinit.readthedocs.io/en/latest/topics/modules.html#scripts-per-once18:32
blackboxswyou can install your own scripts in an ami which run every time the machine instance id changes, or per-boot etc.18:33
asthasrOk, cool.18:33
asthasrWhen do "per-instance" scripts run? Is that after the first boot of an instance with a new ID?18:33
asthasri.e. I make the AMI, put something in per-instance, and then if I build a new machine based on that, it'll run?18:34
asthasr(I saw this list before but the difference between per-once and per-instance was not clear to me.)18:35
smoserasthasr, yes.18:35
smoserper-once will run once ever (marker files are written with no specific instance data)18:36
blackboxswcorrect, new intance-id is generated each time the AMI is "built/deployed"18:36
blackboxswcorrect, new instance-id is generated each time the AMI is "built/deployed" for per-instance18:36
smoserper-instance will run once per instance-id (marker files contain instance-id in their path)18:36
smoserper-always will run every boot18:36
smoserinstances are things which are created from images.18:37
smoserami == amazon machine image18:37
* asthasr nods.18:37
smoserso each thing you launch from athis ami that you built is a unique instance18:37
asthasryeah. My desired workflow is: create a "template" server, run packer to make an ami, then use terraform to spin up instances based on that ami, which (upon booting) run ansible to configure themselves18:39
asthasrso per-instance sounds right.18:39
rharperblackboxsw: did you have  a branch which added a subcommand to crawl/dump metadata (like openstack) ?18:42
smoserasthasr, the only thing i'd suggest is not bothering to build your own images.18:49
smoserbut rather to either18:49
smosera.) use unmodified "Official" Ubuntu images18:50
smoserb.) download images from cloud-images.ubuntu.com as a starting point and make your modifications and upload.18:50
asthasrCertainly, I intend to use an official Ubuntu 16.04 and just make some basic configuration changes to it18:50
smoser"packer to make an ami"18:51
smoseri'm saying skip that18:51
asthasrbut why? It seems like if I want to rebuild a machine it's quicker to have an image that has all the prereqs and such on it beforehand18:52
blackboxswrharper: that branch I haven't put together yet (it's a followup to https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/330115 )18:52
blackboxswwanted to land the prerequisite first18:52
rharpercool18:53
blackboxswrharper: shameless plug for a review on that branch :)18:53
rharperI think I've given you one, no ?18:53
blackboxswrefresh says no comments on this branch18:54
rharpernoo! I must have closed the tab before submit18:54
rharperok, I'll re-review18:54
smoseroh. asthasr i guess i didnt understand how packer worked.18:54
smoseri always asumed it built the image "from scratch".18:54
blackboxswbah, hopefully launchpad saved the unsaved comments18:54
rharperblackboxsw: man, I even updated the commit message and had comments; so strange18:56
smoserrharper, how did you get status from systemd-resolved?18:59
asthasrsmoser: No, you just spin up a box and then configure it how you want and then it takes that box and makes a new image from it19:00
asthasrsmoser: So, it can be based on whatever base AMI you want :)19:00
rharpersystmed-resolved --status (but only on artful IIRC)19:00
rharpersystemd-resolved --status19:00
rharpererr, drop the d; systemd-resolve --status19:00
rharpersmoser: ^19:01
smoseryeah. i see. thanks.19:01
dhill_hey guys20:53
dhill_what could make cloud-init truncate /var/log/messages?20:53
dhill_I looked at the code and didn't find anything...20:54
rharpercloud-init doesn't touch /var/log/messages ;  it owns /var/log/cloud-init.log and /var/log/cloud-init-output.log20:54
rharpercloud-init will use syslog;  so maybe a local config that triggered logrotate ?20:55
rharperdo you have messages.1 ?20:55
dhill_rharper, nope... and that's what I was expecting to hear from you :)21:02
dhill_rharper, I looked at the code and nothing mentionned /var/log/messages from close or far21:02
rharperright, and what about possible rotated files?  do you know how (or if) logrotate is configured on your instance ?21:04
blackboxswpowersj: additional comments on https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/32764622:32
powersjblackboxsw: getting the command line for your failures would be very helpful22:34
powersjcommon theme from the reviews I've seen is how the lxd backend returns return codes and kvm does not22:35
powersjthat's the reason for the "0"22:35
blackboxswI'm with you on the 0 being returned from execute() just feels strange from within mount_image_callback22:39

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