Scheduling, migration, and quotas

Hello,

recently I ran into various problems related to user quotas. Usually when the quota is exceeded, neither user nor oneadmin receives a feedback indicating which quota is exceeded and by whom, only scheduling a VM fails:

  • after running “onehost flush” some VMs on a given host are marked for migration, but migration fails afterwards, because the owner of these VMs is over his own quota. I think rescheduling a running VM which is over a particular quota should not fail, because by rescheduling the situation with resource usage does not change. The particular problem I ran into was caused by a VM created by oneadmin and later given to an ordinary user (onevm chown). Even at that time no warning that the target user is over his quota was given.

  • when an user has RAM quota 8 GB, it is not possible to create a single VM with 8 GB RAM - the VM gets created, but it is in PENDING state indefinitely, and only “onevm resize VMID --memory=6000” helps (--memory=7000 does not), Why such a big difference?

    oneuser show someuser

    USER 1234 INFORMATION
    […]
    RESOURCE USAGE & QUOTAS

      NUMBER OF VMS               MEMORY                  CPU     SYSTEM_DISK_SIZE
        1 /       8        8G /       8G      0.20 /     1.50        2G /       8G
    

    onevm show 1875

    VIRTUAL MACHINE 1875 INFORMATION
    […]
    STATE : PENDING
    LCM_STATE : LCM_INIT
    RESCHED : No
    START TIME : 05/22 09:31:41
    […]
    SCHED_MESSAGE=“Tue May 22 10:17:18 2018 : Cannot dispatch VM to any Host. Possible reasons: Not enough capacity in Host or System DS, or dispatch limit reached”

    VIRTUAL MACHINE TEMPLATE
    […]
    MEMORY=“8192”

I think the VM in question should not be created at all, if ONe thinks it is over quota. And after it is created, its migration should work regardless of the quota.

Thanks!

-Yenya

OK, I have discovered the reason for the second problem (onevm create fails with RAM=user quota): it was the VDC to which that VM got assigned having only hosts with 6 GiB RAM free. Unfortunately, it was not visible anywhere in the log file nor in the infrastructure view (it displays hosts only, not their VDCs). I have decided to scrap the concept of VDCs and assigned all hosts into the same VDC, and now it works as expected. Sorry for the noise.

-Yenya