{"action":"closed","issue":{"url":"https://api.github.com/repos/openSUSE/open-build-service/issues/1831","repository_url":"https://api.github.com/repos/openSUSE/open-build-service","labels_url":"https://api.github.com/repos/openSUSE/open-build-service/issues/1831/labels{/name}","comments_url":"https://api.github.com/repos/openSUSE/open-build-service/issues/1831/comments","events_url":"https://api.github.com/repos/openSUSE/open-build-service/issues/1831/events","html_url":"https://github.com/openSUSE/open-build-service/issues/1831","id":156951028,"number":1831,"title":"KVM workers expose host processor count, constraints not obeyed","user":{"login":"tuminoid","id":853790,"avatar_url":"https://avatars.githubusercontent.com/u/853790?v=3","gravatar_id":"","url":"https://api.github.com/users/tuminoid","html_url":"https://github.com/tuminoid","followers_url":"https://api.github.com/users/tuminoid/followers","following_url":"https://api.github.com/users/tuminoid/following{/other_user}","gists_url":"https://api.github.com/users/tuminoid/gists{/gist_id}","starred_url":"https://api.github.com/users/tuminoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuminoid/subscriptions","organizations_url":"https://api.github.com/users/tuminoid/orgs","repos_url":"https://api.github.com/users/tuminoid/repos","events_url":"https://api.github.com/users/tuminoid/events{/privacy}","received_events_url":"https://api.github.com/users/tuminoid/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-26T10:18:05Z","updated_at":"2016-06-07T07:10:04Z","closed_at":"2016-06-07T07:10:04Z","body":"When a KVM based worker is limited to 1 CPU by `OBS_WORKER_JOBS=1`, it still exposes processor count of the host system:\r\n```\r\n$ cat /srv/obs/workers/idle/x86_64:obsworker-small:1\r\n...\r\n      <flag>xsaveopt</flag>\r\n    </cpu>\r\n    <processors>48</processors>\r\n    <memory>3072</memory>\r\n    <disk>6144</disk>\r\n  </hardware>\r\n```\r\n\r\nThis processors value is used to enforce constraints, and thus the constraint of 12 cpus will not prevent job from building on a such worker, even it is limited to 1 CPU on the KVM instance.\r\n\r\nNotably the `memory` and `disk` attributes are coming from the KVM, and not from the host, which is the right behaviour.\r\n\r\nWorker cmdline for reference:\r\n```\r\nusr/bin/perl -w ./bs_worker --hardstatus --kvm --root /mnt/workerdisk/srv/obs-worker/tmp/d-small/root_1 --statedir /mnt/workerdisk/srv/obs/run/d-small/worker/1 --id obsworker-small:1 --reposerver XXX:5252 --jobs 1 --cachedir /mnt/workerdisk/srv/obs/worker-small/cache/d-small --cachesize 100000 --vm-kernel /usr/lib/obs/worker/kernel.kvm --vm-initrd /usr/lib/obs/worker/initrd.kvm --vmdisk-rootsize 6144 --vmdisk-filesystem ext3 --vmdisk-clean --tmpfs --device /mnt/workerdisk/srv/obs-worker/tmp/d-small/root_1/root --vm-memory 3072 --cleanup-chroot\r\n```\r\n"}}
{"actor":{"display_login":"adrianschroeter"}}