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

=== jroll is now known as Guest54515
=== rangerpb is now known as rangerpbzzzz
erick3kcan someone help me with a problem01:53
=== Guest54515 is now known as jroll
jgrimmrharper, https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/164564414:52
rharperjgrimm: hrm, so pre-existing ntp.conf .. when dpkg installs, it will divert the package conf to a new file (where as cloud-init moves the original out of the way and replaces).   Do you suppose we should do the same here?15:14
jgrimmnot sure, i just wasn't sure if you'd noticed that bug yet15:15
rharperI had not15:15
rharperso, they're clearly adding 'ntp' key to trigger the install15:15
rharperbut not using the existing pool or server list15:15
rharperso, not quite sure why;  though possible that they want to tweak things...15:16
jgrimmindeed15:16
=== rangerpbzzzz is now known as rangerpb
powersjmagicalChicken: what was the decision re: to many files open?18:11
magicalChickenpowersj: It was caused by polling for the system to be up using lots of calls to execute()18:21
magicalChickenit went away once i switched back to polling in the instance18:21
powersjah ok so you are going to go the route of updating your code18:22
magicalChickenthere's a new bug in centos with setting hostname, but it looks like its a cloud-inti issue18:22
magicalChickenpowersj: yeah, it is a bug in pylxd most likely, but the fix in the test suite is simple, so no sense in waiting until it can be fixed in pylxd18:22
powersjok!18:22
magicalChickenI've pushed the fix18:23
powersjis the fix committed such that I can keep testing?18:23
powersjah :)18:23
powersjthank you!18:23
magicalChickenThe centos tests will still fail due to hostnamectl timing out when cloud-init tries to run cc_set_hostname thought18:23
vans163hello. Is there a general way to disable cloud-init after first init?19:08
vans163Im having a problem where if I take a snapshot of a cloud disk, boot up another Vm with it, it freezes upon boot because cloud init is looking for things again19:08
=== X-Istence is now known as x58
rharperif you're booting a snapshot with the same UUID/instance-id, then it won't attempt to re-init; but if you change the instance-id then it will try to run again.  That's by design as you don't want the same ssh keys and other generated data to be the same between different instances.19:36
rharperif you want, you can append cloud-init=disabled to the kernel command line,  or if you modify your image, you can touch /etc/cloud/cloud-init.disabled which will prevent cloud-init from running19:38
vans163rharper: is there something without touchng the system much.  If i understood correct I can add  touch /etc/cloud/cloud-init.disabled  to the end of my cloud-init script?20:06
vans163i saw tutorials that say to uninstall cloud-init, but for different distros the command will be different so this is not as portable20:06
vans163rharper: im booting the snapshot WITHOUT attaching the ISO again20:07
vans163im using the ISO method to use cloud init20:07
vans163so I launch the fedora_24_cloud.raw disk image with a cloud-init.iso attached.  Everythings fine.  now I snapshot the .raw disk, and spin up a new VM with it.  WITHOUT the cloud-init.iso20:08
vans163and now it hangs indefinetaly20:08
rharperand if you boot your image without a cdrom in the first place, it will likely do the same (it's looking for a datasource) and takes quite a while to timeout;  I suspect, somehow the instance_id in your second boot is different than the first;  the cloud-init.log in the second boot will confirm;  you should be able to just wait it out (like 10 or so minutes) or even just boot the snapshot image with the cdrom20:33
rharperbbiab20:33
vans163rharper: no cdrom attached yea.  Hum.. okay i need to try touching the cloud-init.disabled20:51
vans163yea no go21:19
vans163touching that does nothing21:20
vans163its hanging at boot21:20
vans163this is fedora24 cloud image21:20
rharperdo you see any boot messages to serial console ?21:32
rharperI usually do a  "-serial telnet:localhost:2446:,nowait,server"  to my qemu command, then when you launch it, you can telnet localhost 2446 and see boot messages and interact with serial console of the guest21:33
vans163rharper: humm i had VNC opened and I see nothing except the first line of the boot21:37
rharperif the image isn't booting properly, maybe its not cloud-init related21:38
vans163image boots fine if I attach the cloud-init.iso to it21:44
vans163i think its just looking for the iso/trying to connect to EC2 ip21:45
vans163i need to find how to tell it to not do that21:45
vans163(once its booted the first time in its life)21:45
vans163yum erase cloud-init at the end of the config script seems to be the solution but this is not portable21:45
vans163(havent tried it, just read blog about it)21:46
rharperwell, it will eventually timeout trying to reach EC2; having the cloud-init.log of the second boot can help understand what's going on;21:46
vans163hum let me get that then sec21:47
vans163well not sec.. 10 min :po21:47
rharperhehe21:48
rharperyeah, it's a long timeout21:48
vans163brb going to store21:48
vans163not so slow actually21:54
vans163got dressed and its done21:54
vans163it spent 2 minutes trying to reach /latest/meta-data/instance-id on the gateway IP DHCP gave it21:54
vans163maybe more21:55
vans163DataSourceEc2.py[CRITICAL]: Giving up on md from ['http://169.254.169.254/2009-04-04/meta-data/instance-id'] after 21630 seconds21:55
vans163first that, then trying to reach the gateway ip 2 minutes, then it booted21:55
rharperyeah, I was interested in /var/log/cloud-init.log   and /var/lib/cloud/instances/21:55
rharpertrying to recreate here21:56
vans163cloud-init.log is empty21:56
rharperthat seems very wrong21:56
vans163(i added the touch .../.disabled21:56
rharperoh21:56
rharperthough the first boot one should have run though21:56
rharperand it wouldn;'t have tried ec2 if it was disabled21:57
vans163instances has 1 UUID folder, and iid-datasource-none21:57
rharperit's like it never ran at all21:57
rharperyour cdrom image would have included a meta-data file with an instance-id in it21:57
rharperthat should be in /var/lib/cloud/instances/<instance id>21:57
rharperfrom the first boot21:57
vans163df -h shows me  /dev/vda1        50G  446M   47G  so the drive was expanded21:57
rharperif that's not there, then your snapshot isn't getting captured21:57
vans163or..21:58
rharperyeah, cloud-init does that21:58
vans163yea it ran right the first time, because the SSHkeys i set are there21:58
vans163then i powerdown the instance + snapshot the disk21:58
rharpermaybe I don't know what the fedora cloud-init is doing but the instance dir should be persistent21:58
vans163so basically the same thing as booting the instance again without the cloud-init.iso cdrom attached21:58
rharperright but it's not recording the instance data where cloud-init looks (at least on ubuntu)21:59
rharperinside the instance dir, includes a pickled datasource object that it re-uses on subsequent boots21:59
vans163obj.pkl is there i see it21:59
rharper then you have to have a /var/lib/cloud/instances/  ...22:00
vans163yes isntances folder has 2 folders in it22:00
vans1631 is a UUID folder, the other is iid-datasource-none22:00
rharperok, that makes sense22:00
rharperwhat I suspect is that without a way to specify the instance-id to cloud-init, it won;t know to use the previous uuid as a datasource22:01
rharperI'll confirm locally22:01
vans163somethign strange I see my cloud-config is truncated22:01
vans163cloud-config.txt in that uuid folder is missing a few things22:01
vans163... it shows at the end22:01
vans163let me show you sec in gist22:02
rharperso unless we have a way to persist the instance-id (via a permanent datasource) I don't think cloud-init can know that it should use it;22:03
rharperyou may want to look at using the nocloud seed (write out your user-data/metadata to /var/lib/cloud/seed/nocloud-net dir in the image itself22:03
vans163well upon the snapshot boot, it should ignore cloud init22:04
vans163as the instance is already configured22:04
rharperthat;s not how cloud-init works22:04
vans163ah22:04
rharperit only knows it's configured if it finds that it's the same instance22:04
rharperin real clouds, the meta-data provides the instance-id;  that's ephemeral , each time you launch a new vm, it's a new instance22:04
vans163and the ISO or webserver it tries to query tells it the id22:04
rharperit had a meta-data file22:04
rharperyou can embed the same config from the iso in a dir inside the image22:05
rharperthat will achieve what you want22:05
vans163i think that is exactly what I need22:05
vans163thanks for explaining22:05
rharperhttp://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html22:05
rharpersure22:05
vans163but I have this 1 wierd thing22:05
rharperthat link shows it via iso, but if you just put the contents of the iso at /var/lib/cloud/seed/nocloud-net/{user-data,meta-data}22:06
vans163that solves alot of problems yea22:07
vans163https://gist.github.com/anonymous/5e47847afa56cdd01f88ef0d27aa62a4  this gist, the top is the cloud-config i passed the ISO,  the bottom is what was in the instances  /var/lib/cloud/instances/d2ffab6d-7ac9-423a-bc8a-023402a2d7a0/cloud-config.txt22:08
vans163why is there so many spaces in the root password, guessing its fine tho?22:08
vans163brb22:09
rharpernot sure; possible your original cloud-config has trailing white space ?22:17
=== rangerpb is now known as rangerpbzzzz

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