/srv/irclogs.ubuntu.com/2015/10/21/#cloud-init.txt

=== cpaelzer_ is now known as cpaelzer
Odd_Blokesmoser: So I'm looking at /sys, and I can't see how to find the logical sector size of a block device.09:36
ndoneganIs it possible to make cloud-init run an abitrary script after it has gone through it's other sources?10:26
larsksOdd_Bloke: I don't know about /sys, but this works, I think: blockdev --getbsz /dev/sda13:11
Odd_Blokelarsks: Yep, blockdev would do it; we're trying to avoid forking if we can.13:16
larsksIt's just calling the BLKBSZGET ioctl.  I guess you could do that natively in python w/ the 'fcntl' module...13:17
smoserOdd_Bloke, i put iot in my comments.13:19
smoseroh carp. looks like i didn't hit 'submit' on some comments.13:20
smoserbut anyway, its /sys/class/block/<devname>/qeueu/logical_block_size13:21
smoserand physical_block_size13:21
smoserndonegan, yes. just send script as user-data . if it starts with '#!' it gets executed.13:22
smosersucks that i lost that comment.13:22
smoserOdd_Bloke, i had also rquessted that we round reasonably well (to 1MB or 4MB) increments so we land on fs alignment. and also start at 1MB in.13:22
ndonegansmoser: Having issues with a certain meta data provider, hence why I want to be able to run a script after which verifies stuff happened.13:23
Odd_Blokesmoser: If {logical,physical}_block_size are actually sector sizes, why is there also hw_sector_size?13:23
smoserwell, i dont know. in my tests, logical and physical match up with what i fed through qemu-system-x8613:24
smoserand qemu calls them 'logical_block_size' and 'physical_block_size'13:25
smoserso i'm justified in my assumption (as those names line up). but i admittedly did make an assumption :)13:26
smoserndonegan, i dont really follow.13:26
ndonegansmoser: Having great fun with metadata proxy where it occasionally sends back crap.13:27
ndoneganAs an example, the request it should be sending to nova-metadata-api gets sent as the resonse to the client.13:28
ndoneganSo looking for some way to try and very that some valid data was sent back13:28
ndonegan*verify13:29
Odd_Blokendonegan: You're looking to change the image in order to do this, or configure cloud-init to do it from outside the instance?13:30
ndoneganOdd_Bloke: Exploring any option, including edits to the image, to see if there's some way to verify that what comes back from the metadata service is correct.13:31
smoserndonegan, as in openstack ?13:31
smoseryeah.13:31
ndoneganIt would actually be better if the proxy just failed entirely and timed out. That way I can have the "None" data source as a fallback, and let it write a raw userdata13:32
ndoneganHowever, it sends back just enough before screwing up that the Ec2 source doesn't fail outright.13:32
ndonegansmoser: Openstack with Contrail.13:32
smoserright.13:32
ndoneganAnd it's Contrail that's the issue.13:32
smoser2 things you could try13:32
smosera.) cirros13:32
smoserb.) if you can enable config drive in launching... then you can probably avoid cloud-init hitting the md so you can get in and debug from there.13:33
smoserie, launch with 'config_drive=1'.13:34
smoseri suggest cirros because it will time out faster and you can log in with password : cirros/cubswin:)13:34
Odd_Blokesmoser: So, looking at the kernel source, hw_sector_size is the same value as... logical_block_size.13:44
ndoneganWe already have a base image we use everywhere (mini Centos setup for our environment).13:45
ndoneganConfigDrive might be a good option.13:45
smoserOdd_Bloke, i would not have thoguth that :)13:45
mwaksmoser: I updated the PR to ensure we're on Scaleway when using the datasource, let me know if it's ok for you. I'll add unit test asap13:53
smosermwak, and sign cla ?13:54
smosermwak, the tewst there is fine, and does help some.13:55
smoserbut.. we'd like to avoid hitting a network service if we can13:55
smoseras any connection to a network service might hang indefinitely13:56
Odd_Blokesmoser: OK, the BLKSSZGET ioctl calls bdev_logical_block_size, which calls queue_logical_block_size which is also called for the logical_block_size sysfs entry.13:56
smoserie, in many environments a 'wget http://169.254.169.254/' will just block due to firewall rules and the like.13:56
Odd_Blokesmoser: So it looks like we can use /sys/.../logical_block_size. :)13:56
smoserOdd_Bloke, i'd like to fall back if that file isnt present. you plan on that , right ?13:57
Odd_Blokesmoser: Yeah, that was the plan.13:57
smoserok. the other thing i didnt' say, that got lost in my browser.13:58
smoserif we can start first partition at 1MB and only use 1MB units in sizes, that'd be good.13:59
smoseri'm tempted to use 4MB units.13:59
smoserhttps://bugs.launchpad.net/maas/+bug/150225913:59
smoserlvm uses 4MB extents by default.14:00
natoriousmorning14:01
mwaksmoser: yep sign the cla too14:03
smoserhey14:04
smosermwak, so does that make sense above ^14:05
smoseris there any way that we can determine "am i on scaleway" without hitting a network resource ?14:05
smoserhey. it is time for cloud-inti 2.0 meeting14:05
mwaksmoser: not really14:05
jgrimmo/14:05
* Odd_Bloke is in a partner meeting, so is MIA.14:05
natoriouschannel topic links need to be updated w/ new gerrit paths14:06
natoriousie - https://review.openstack.org/#/q/project:openstack/cloud-init+status:open,n,z14:06
smoserah. yeah, i'll do that natorious14:06
smoserok. so looking at that fine url that natiorisou added.14:07
natoriouslol14:08
smosera couple that i shoudl grab quickly14:08
smoseras they address the namespace change.14:08
smosernatorious, had you made any more progress on yours?14:08
natoriouswas just looking over harlowja's comments14:09
smoserk14:09
natoriousideally it would be nice if we had a utils.execute or similar shared subprocess call for exec14:10
smosernatorious, yeah.  there is a fairly good one in cluod-init14:11
smoserutils.subp14:11
smoserin 0.714:12
smoserthat i'd suggest we pull forward14:12
natoriousk14:14
natoriousassuming it is compatible with windows and all14:14
smoserah. yeah, it would need some windows work likely.14:15
smoserit wrapps subprocess.14:15
smosersubprocess.popen14:15
smoserbut i'd guess we could address anything non windows specific there14:15
niluje@smoser | ie, in many environments a 'wget http://169.254.169.254/' will just block due to firewall rules and the like. >> do you think we should add a timeout for the test?14:15
nilujethat can easily be done with requests14:16
smoserniluje, for tests ?14:16
nilujeto check the server's is on scaleway14:16
niluje(I'm working with mwak there)14:16
smoseryes, for sure.14:17
smosertimeouts suck14:17
nilujewe thought about it for a while, and doing something else than a network test didn't seem straightforward14:17
smoserbecause you're either safe (meaning unnecessary long wait) or aggressive (meaning your endpoint might not return in time)14:17
nilujeyes, I agree14:18
smoserniluje, are you in a place wehere you could feed some dmi data to the guest ?14:18
smoserit seems like generally good practice to identify your platform in such a way14:18
smoserwrt timeouts... i dont want to enable a datasource by default that could block boot as it waits.  I'd *like* to change EC2 to not do that.14:19
smoserbut EC2 was "first" so i'm ok giving them a legacy grandfather-in.14:19
nilujeI totally understand your point of view :)14:20
=== jgrimm is now known as jgrimm-brb
nilujeunfortunately, at the moment, we can't really rely on something else than network resource and if we do, we won't be sure the test will still work in a few months/years14:21
nilujewe prefered to add this not-so-good-test rather than a better test that might not work in a while14:22
nilujehowever if that's a blocker, we'll think about another solution14:22
=== jgrimm-brb is now known as jgrimm
natorioussmoser: any ideas on windows configdrive detection?14:25
smosernatorious, i might look at how cloudbase has done it.14:26
smoseri think they read the device with bsd tar14:26
smoser!14:26
smoseryou cant make that stuff up :)14:26
smoserbut at least at one point that was what alexpilloti settled on.14:27
smoser(honestly, i wuldnt mind having a vfat and iso9660 filesystem reader in pure python)14:27
natoriousoh wow, lol14:27
natoriousyeah, looked at ctypes methods a bit14:27
natoriousshould be universal but alot less readable14:28
smoseri suspect also faster than 'mount ... read ... unmont' for the amount of data we're pulling.14:28
natoriousuni to windows that is14:28
natoriousk, I'll see how their doing it and go from there14:30
=== cliles_ is now known as cliles
=== shardy is now known as shardy_afk
=== pratikma_ is now known as pratikmallya
=== gondoi is now known as zz_gondoi
=== shardy_afk is now known as shardy
=== jgrimm is now known as jgrimm-afk
=== jgrimm-afk is now known as jgrimm

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