/srv/irclogs.ubuntu.com/2018/06/27/#ubuntu-server.txt

oerheksfind timezone02:44
cpaelzergood morning05:32
lordievaderGood morning06:10
cpaelzerhi lordievader06:21
lordievaderHey cpaelzer , quiet day at the office?06:25
cpaelzerlordievader: well office=home anyway, and it seems it will never be quiet :-)06:28
lordievaderOeh, nice. Perhaps I should have said quiet-er ;)06:29
cpaelzer:-)06:34
rolandw_Apparmor, KVM: I am getting issues showing up in the logs such as audit: type=1400 audit(1530081081.080:109): apparmor="DENIED" operation="mknod" profile="libvirt-91a15215-7b56-437b-8634-48d2760a63ff" name="/kvm/libvirt/qemu/domain-OSX_KVM/monitor.sock" pid=28252 comm="qemu-system-x86" requested_mask="c" denied_mask="c" fsuid=64055 ouid=64055. In order to allow requested_mask "c" what should I be adding in the apparmour prof06:37
cpaelzerrolandw_: cat /etc/apparmor.d/libvirt/libvirt-91a15215-7b56-437b-8634-48d2760a63ff.files should actually have an entry for it06:39
cpaelzerlike06:39
cpaelzer"/var/lib/libvirt/qemu/domain-OSX_KVM/monitor.sock" rw06:39
cpaelzeroh I see06:39
cpaelzeryour base Dir is different06:39
cpaelzeryou are using a non default path /kvm instead of /var/lib/06:40
rolandw_Indeed I am.06:40
rolandw_I ended up with too many KVM instances and had to move libvirt out of /var...06:41
cpaelzerIf libvirt knows about the changed path it would generate different rules, but for some you might need to add extra rules06:41
cpaelzerlet me check what it uses as base dir for the generated rules06:41
rolandw_I can manually edit each libvirt-XX.files but that is a cludge and not a fix...06:41
cpaelzerwould not help06:41
cpaelzerthose are dynamically generated06:41
cpaelzerwe either need to find why virt-aa-helper doesn't follow your new path OR add a few simple rules to the base profile06:42
cpaelzerlet me check for the first option before we try the second06:42
rolandw_In virt-aa-helper I've copied all the /var/lib/libvirt rules and added /kvm/libvirt rules. Doesn't seem to make any difference...06:43
rolandw_Annoyingly, I'm being called for a meeting. Will be back! cpaelzer thanks for looking into this...06:44
cpaelzer%s/lib/libvirt/qemu/domain-%s/monitor.sock with the %s being LOCALSTATEDIR06:44
cpaelzerthat is a config time variable06:45
cpaelzerso you have two options to check after your meeting I'd think06:45
cpaelzer1. consider instead of using /kvm for it to mount your extra disk to /var or /var/lib - that way paths would persist and this error would not occur (nor any other similar one later on)06:46
cpaelzer2. add an exception to allow access there (this will be in the base profile, so no cross guest protection as the generated rules would have)06:46
cpaelzerthe file /etc/apparmor.d/abstractions/libvirt-qemu holds what all of them are allowed to access06:46
cpaelzerrolandw_: I hope that helps, and permission "w" corvers c=create as well06:47
cpaelzerrolandw_: my preference is instead of switching all to /kvm just mount /var/lib/libvirt to your extra disk06:48
cpaelzerthat way just this part of /var will be used for the guests and no other change is needed06:48
cpaelzerotherwsie you also might need to change /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper to allow it to read that06:49
cpaelzerto be able to e.g. find backing device chains and so on06:49
danliiI'm having some trouble with a fresh install of bionic via FAI (don't know if that's related) - it refuses to boot from the disk UUID, I have to specify /dev/vg0/root in grub. The UUID in the grub config is correct though, blkid says so. What could I try?08:05
rolandw_cpaelzer_: sadly it hasn't helped me really understand apparmor which I need to learn! Thanks for your help.09:44
rolandw_cpaelzer_: You might be interested in the SELinux tutorial one of my colleages wrote. I guess I need to do the same for apparmor! https://github.com/jamesfreeman959/selinux-hands-on-labs09:46
cpaelzerwb rolandw_09:47
cpaelzerrolandw_: https://medium.com/information-and-technology/so-what-is-apparmor-64d7ae211ed ?09:48
cpaelzerand for an extra bit of the integration in libvirt/kvm https://wiki.ubuntu.com/LibvirtApparmor09:49
cpaelzeryou are common case #3 on the latter09:49
=== chmurifree is now known as chmuri
l4m8d4Hello there, installed ubuntu 18.04 with the new installer, and I saw that about 1 MiB of space gets left free at the end of the disk, even if I choose to use the full disk. Why is that?12:00
ogra_GPT puts a backup of the partition table at the end of the disk ... whilenot knowing if thats the reason my guess would be it is :)12:01
l4m8d4ogra_: I think your are wrong, according to this (https://superuser.com/questions/663795/small-unallocated-space-left-when-partitioning-harddrive-what-is-is-meant-for)12:09
ogra_as i said, only guessing12:09
l4m8d4There the author of fdisk says that this is not the reason for the free space at the end. I just found that12:09
l4m8d4I guess then the free space is unneeded12:09
ogra_fdisk doesnt handle GPT12:09
l4m8d4ogra_: What do you mean?12:10
ogra_fdisk does not manager GPT partition tables12:10
ogra_*manage12:10
ogra_only msdos type ones12:10
l4m8d4Don't know what you mean with "manage" but I used fdisk without problems on countless GPT-disks and also used fdisk to create GPT tables on empty disks12:11
ogra_interesting ... to my knowledge you need to use gdisk/sgdisk or parted for that12:11
l4m8d4well, your knowledge is wrong then12:11
l4m8d4Probably this applies for some older version of fdisk, but the version with ubuntu 18.04 does GPT just fine12:12
diddledanI was under that impression, too12:12
ogra_well, i'm still on 16.0412:13
ogra_and there it definitely doesnt manager GPT12:13
ogra_*manage12:13
* diddledan removes ogra_'s R key12:13
ogra_thanks :)12:13
l4m8d4You can try it out for yourself, fdisk can handle GPT just fine12:14
ogra_well, i did, i maintain several ubuntu images :)12:14
diddledan"several"12:14
diddledans/several/many/ ??12:14
ogra_and for the GPT variations i have to use sgdisk or parted (and even parted is still flaky with GPT in 16.04)12:14
ogra_diddledan, i didnt want to exaggerate ;)12:15
diddledan:-p12:15
l4m8d4I think I know where your guess came from though: On the wikipedia it states that the original fdisk shipping with MS-DOS could only handle MBR formatted drives12:15
l4m8d4Okay, probably the GPT "extension" of fdisk is kind of new then12:15
blackflowaccording to the manpage, fdisk can do gpt. I've always been using parted, tho', and sgdisk for scripted partitioning12:16
ogra_i think it can do it now, but still in a limited way ... (not managing GUIDs and such)12:16
tomreynhttps://blog.stgolabs.net/2012/09/fdisk-updates-and-gpt-support.html12:18
l4m8d4ogra_: On my system, if I create a GPT table on an empty device and use "blkid" it will show me the device with 'PTUUID="..." PTTYPE="gpt"'12:19
l4m8d4ogra_: Ah you mean the handling of partition types, right? It does that as well.12:21
ogra_it doesnt in the 16.04 version12:23
ogra_neither GUID nor GTYPE12:24
ogra_anyway ... i'm probably wrong about the free space at the end of your disk ... which was the initial question :)12:25
l4m8d4So, a GPT backup is stored at the end of the disk in any case, right? So the last partition needs to end before that?12:26
ogra_yes, though 1MB seems a bit much12:27
ogra_but perhaps thats the smallest possible block size12:27
diddledana partitioning tool won't show the backup block or any space related to it - it will just reduce the size of available space for partitions and tell you that's the size of your disk12:27
ogra_right12:28
l4m8d4Yes, after creating GPT on my disk, the nvme command only shows 50kb or something allocated LBAs12:28
diddledana gap when partitioning automatically is usually a result of alignment conformance12:28
ogra_yeah12:29
l4m8d4Okay, that seems reasonable. So on a modern disk, like an nvme SSD, there should be no reason to leave anything empty right? Since everything is automatically aligned12:29
blackflowpretty much same alignment rules apply. the sector sizes might be different tho12:30
l4m8d4blackflow: My SSD has LBAs of size 512 bytes. Which alignment rules apply then? I would just allocate any LBA the partitioning tool lets me12:31
l4m8d4Or maybe to say it in a better way, the local blocks are 512 bytes, don't know about the length of an address12:33
blackflowl4m8d4: same rules as with hdd. ssds also read/write in blocks, and if your partitions are not aligned in factors of that block size, it's also misaligned.12:35
blackflowto be on the safe side, 1M alignment should be sufficient. I've read somewhere that SSDs actually internally work with block sizes much bigger than the standard 512b or 4k, but I can't find definitive info on that.12:36
l4m8d4blackflow: Okay, but the SSD says it adresses each block 512B size. Now I say the partitioning tool should use all blocks. Now where could misalignment come from? The fact the SSD might internally work with bigger chunks, and then end of the partition could be a block that is "too small"?12:38
blackflowl4m8d4: misalignment could come from having partition sizes that aren't factors of 512 bytes12:39
blackflow(in this case, if 512b is really the actual sector size)12:41
l4m8d4blackflow: I specify to the partition tool the first LBA and last LBA of the partition. Now this is naturally a multple of 512 bytes, since each block is 512 bytes, right?12:41
blackflowI guess so. I'd just partition in units of MiB or even just MB, that's 1M boundary and should be fine12:42
l4m8d4Okay, then. I guess I'm just curious and a little annoyed by that, realistically irrelevant, 1MiB of free space. Which probably is a waste of time^^ Thanks12:44
blackflowbeing what, <0.01% of total drive size? yeah :)12:46
blackflowl4m8d4: on the other hand, I always like to leave a few GB of "just in case" free space at the end of drives. You never know when it'll come handy.12:46
compdocjust a few?13:10
compdocsounds like a full drive to me13:10
l4m8d4Yeah, I don't do that either. Ultimately I don't care much about 1mb more or less, but if it was a gigabyte I had to leave free I would be pissed, since I want to use the system to its full potential if possible13:28
=== tobasco is now known as tobasco_afk
=== oerheks__ is now known as oerheks
dpb1rbasak: do you have that snap somewhere I can test it?18:26
dpb1rbasak: (certbot)18:26
=== tobasco_afk is now known as tobasco
njbairis there an "official" solution for hypervisor management on ubuntu server? I was playing around with Kimchi but it's still rough around the edges (at least on Ubuntu)18:47
njbairi tried xenserver instead of ubuntu once but that brought me nothing but pain18:49
sarnoldlibvirt is the "easy" thing. Openstack is the hard thing.18:52
njbairopenstack probably doesn't make sense for 1-2 hosts i would imagine18:52
dpb1I find virt-manager good for personal needs18:52
dpb1and light work needs18:53
dpb1(libvirt gui, that has remote mgmt built in)18:53
njbairdpb1, that is gui-based, right?18:53
dpb1yes18:54
njbairi'm on ubuntu server, no wm18:54
sarnoldvirt-manager thing can connect to remote libvirts18:55
sarnoldor you can ssh -X18:55
sarnoldor you can use virsh18:55
dpb1right, virsh is the cli version18:55
dpb1it's OK18:55
sarnoldI never got the hang of virsh18:55
dpb1if I'm on a windows/mac, I use ssh -X18:55
njbairi was definitely hoping for something gui-based, but was thinking web18:55
dpb1and get virt-manager18:55
dpb1there are a ton of things: https://www.linux-kvm.org/page/Management_Tools, but I don't have experience with any (other than openstack)18:56
sarnoldheh, after openstack, everything else has to look nice and simple :)18:57
dpb1yes, those were my thoughts too18:57
sarnoldI dislike even libvirt's extreme generalities.18:57
dpb1:)18:57
sarnoldopenstack says "hold my enterprise beverage of choice"18:57
rbasakdpb1: http://people.canonical.com/~rbasak/certbot_0.25.1_amd64.snap20:39
rbasakdpb1: install the snap (--classic --dangerous), and apache2 or nginx, then run "certbot"20:39
dpb1ty20:44
rbasakdpb1: https also works20:44
rbasak:-)20:44
rbasakdpb1: I'm tracking outstanding work in https://github.com/basak/certbot-snap-build/issues20:45

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