Skip to content

Test scale_vm_vm needs fixing for XenServer/XCP-ng #4237

Closed

Description

@andrijapanicsb

Running Marvin test test_scale_vm (test_01_scale_vm) on any version of XenServer/XCP-ng fails due to:

2020-07-24 21:17:10,550 ERROR [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-137:ctx-a555852b job-1829/job-1830 ctx-ac21684e) (logid:59af6655) Unable to scale vm due to Catch exception com.cloud.utils.exception.CloudRuntimeException when scaling VM:i-160-204-VM due to com.cloud.utils.exception.CloudRuntimeException: Cannot scale up the vm because of memory constraint violation: 0 <= memory-static-min(268435456) <= memory-dynamic-min(536870912) <= memory-dynamic-max(536870912) <= memory-static-max(268435456)
For more log information, see any of the failed tests from PR #4068

Activity

  1. added this to the 4.15.0.0 milestone on Jul 31, 2020
  2. andrijapanicsb commented on Jul 31, 2020

    @andrijapanicsb
    ContributorAuthor

    cc @DaanHoogland @Spaceman1984

    (reminds of the similar issue in VMware where the calculated target RAM size was 0, so a divide by 0 failed etc...)

  3. yadvr commented on Aug 4, 2020

    @yadvr
    Member
  4. DaanHoogland commented on Aug 4, 2020

    @DaanHoogland
    Contributor

    cc @DaanHoogland @Spaceman1984

    (reminds of the similar issue in VMware where the calculated target RAM size was 0, so a divide by 0 failed etc...)

    It rings no bell @andrijapanicsb . also ram being 0 w/should not lead to devide by zero as deviding something by the amount of ram makes no sense to me. Any more hints? @rhtyd are you familiar with the issue?

  5. yadvr commented on Aug 12, 2020

    @yadvr
    Member

    Nope I'm not that's why I pinged @shwstppr

  6. yadvr commented on Aug 13, 2020

    @yadvr
    Member

    cc @Spaceman1984 can you look into this after the cluster/deploying planning investigation, thnx

  7. shwstppr commented on Aug 14, 2020

    @shwstppr
    Contributor

    @rhtyd @DaanHoogland @Spaceman1984
    Dynamic scaling for running VM is failing here,
    https://github.com/apache/cloudstack/blob/master/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java#L4606

    I checked with xcp-ng and tried to change compute offering for a Macchinina VM (memory 512mb to 768mb).
    memory-static-min and memory-static-max for VM remains the same as initial offering value (512mb in my case) and hence the check fails. I checked with hypervisor itself.

    [12:50 xcp-ng-monkeybox ~]# xe vm-param-get param-name=memory-static-min uuid=4af04114-a83b-c8ba-1002-005bb11c4b35
    536870912
    [12:51 xcp-ng-monkeybox ~]# xe vm-param-get param-name=memory-static-max uuid=4af04114-a83b-c8ba-1002-005bb11c4b35
    536870912
    

    When I update these values to some appropriate range (512-1024 as I wanted to scale my VM's memory from 512 to 768mb) dynamic scaling works fine.

    [12:51 xcp-ng-monkeybox ~]# xe vm-shutdown uuid=4af04114-a83b-c8ba-1002-005bb11c4b35
    [12:51 xcp-ng-monkeybox ~]# xe vm-memory-static-range-set uuid=4af04114-a83b-c8ba-1002-005bb11c4b35 min=536870912 max=1073741824
    [12:51 xcp-ng-monkeybox ~]# xe vm-start uuid=4af04114-a83b-c8ba-1002-005bb11c4b35
    [12:51 xcp-ng-monkeybox ~]# xe vm-param-get param-name=memory-static-min uuid=4af04114-a83b-c8ba-1002-005bb11c4b35
    536870912
    [12:51 xcp-ng-monkeybox ~]# xe vm-param-get param-name=memory-static-max uuid=4af04114-a83b-c8ba-1002-005bb11c4b35
    1073741824
    

    So, should we be setting this memory-static range for the VM during deployment or before actual scaling? I also checked with a CentOS7 VM so this doesn't seem to a problem with guest OS.
    https://docs.citrix.com/en-us/citrix-hypervisor/vms/vm-memory.html#memory-constraints

  8. yadvr commented on Aug 14, 2020

    @yadvr
    Member

    @shwstppr can you discuss this with @andrijapanicsb if it's a hypervisor limitation to scale for a running VM then there's hardly anything we can do

  9. andrijapanicsb commented on Aug 14, 2020

    @andrijapanicsb
    ContributorAuthor

    static min/max is set in a silly way when a VM is created - and that is done by ACS as far as I can remember.
    Static min needs to be set to i.e. 1MB or 16 MB or some very low value that we will never reach, and same goes for the static max value. Beside that, the template should be marked as Dynamically Scallable, otherwise it won't work.

    i.e. the"dynamic values" (min/max) can be changed in the range defined by statix min/max.

  10. self-assigned this
    on Oct 22, 2020
  11. modified the milestones: 4.16.0.0, 4.15.1.0 on Apr 27, 2021
  12. yadvr commented on Apr 27, 2021

    @yadvr
    Member

    Fixed in #4929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions