Uploaded image for project: 'OpenVZ'
  1. OpenVZ
  2. OVZ-5382

vzctl set --ram and --swap flags not working as expected

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: OpenVZ-legacy
    • Component/s: Containers::Userspace
    • Security Level: Public
    • Environment:
      Operating System: RHEL/CentOS 5
      Platform: x86_64 (AMD64)

      Description

      I read about the --ram and --swap flags that were introduced in vzctl 3.0.30 on http://openvz.livejournal.com/39765.html and decided to use them to upgrade the memory for a container using the following commands:

      ----
      # vzctl set 101 --ram 6G --swap 3G --save
      # vzctl set 101 --kmemsize unlimited --dcachesize unlimited --lockedpages unlimited --save
      # vzctl restart 101
      ----

      After this running top in the container shows it has 8 GB RAM (all of the RAM available on the host node) instead of 6 GB, and 20 GB swap space (all of the swap space available on the host node) instead of 3 GB.
      1. 101.conf
        2 kB
        Nils Breunese

        Activity

        Hide
        nils@lemonbit.com Nils Breunese added a comment -

        Attachment 101.conf has been added with description: The container's configuration file (ORIGIN_SAMPLE, IP_ADDRESS, NAMESERVER and HOSTNAME are censored).

        Show
        nils@lemonbit.com Nils Breunese added a comment - Attachment 101.conf has been added with description: The container's configuration file (ORIGIN_SAMPLE, IP_ADDRESS, NAMESERVER and HOSTNAME are censored).
        Hide
        nils@lemonbit.com Nils Breunese added a comment -

        Installed packages on CentOS 5.8 x86_64:

        ovzkernel-2.6.18-308.el5.028stab099.3.x86_64
        vzctl-3.1-1.x86_64
        vzctl-lib-3.1-1.x86_64
        vzquota-3.0.12-1.x86_64

        Show
        nils@lemonbit.com Nils Breunese added a comment - Installed packages on CentOS 5.8 x86_64: ovzkernel-2.6.18-308.el5.028stab099.3.x86_64 vzctl-3.1-1.x86_64 vzctl-lib-3.1-1.x86_64 vzquota-3.0.12-1.x86_64
        Hide
        kir Kir Kolyshkin added a comment -

        For VSwap, you need RHEL6-based kernel. Please upgrade.

        While at it, we can probably emit some warnings about your kernel not supporting vswap. So leaving the bug opened.

        Show
        kir Kir Kolyshkin added a comment - For VSwap, you need RHEL6-based kernel. Please upgrade. While at it, we can probably emit some warnings about your kernel not supporting vswap. So leaving the bug opened.
        Hide
        kir Kir Kolyshkin added a comment -

        (In reply to comment #0)

        > # vzctl set 101 --kmemsize unlimited --dcachesize unlimited --lockedpages
        > unlimited --save

        Also, you misunderstood this part. Previously for VSwap mode, in addition to ram and swap limits, we needed to set kmemsize, dcachesize and lockedpages. Now we do not, it is in-kernel improvement during the course of enhancing vswap.

        Generally, in order to use vswap, follow this guidelines: http://wiki.openvz.org/VSwap (look under "convert")

        Show
        kir Kir Kolyshkin added a comment - (In reply to comment #0) > # vzctl set 101 --kmemsize unlimited --dcachesize unlimited --lockedpages > unlimited --save Also, you misunderstood this part. Previously for VSwap mode, in addition to ram and swap limits, we needed to set kmemsize, dcachesize and lockedpages. Now we do not, it is in-kernel improvement during the course of enhancing vswap. Generally, in order to use vswap, follow this guidelines: http://wiki.openvz.org/VSwap (look under "convert")
        Hide
        kir Kir Kolyshkin added a comment -

        Added check for vswap-config and non-vswap-capable kernel to git:
        http://git.openvz.org/?p=vzctl;a=commit;h=09c62690241510119a406a0acc80cb64155e0080
        and an auxiliary patch to make the previous one work:
        http://git.openvz.org/?p=vzctl;a=commit;h=3a2be3d999870f4beb7cae6cffa4c6414e92d3ea

        Now vzctl will hint you that kernel does not support vswap, and

        • vzctl start will not start such a container
        • vzctl set will not accept --ram and --swap

        Not sure why I haven't done it before, it was pretty trivial.

        Show
        kir Kir Kolyshkin added a comment - Added check for vswap-config and non-vswap-capable kernel to git: http://git.openvz.org/?p=vzctl;a=commit;h=09c62690241510119a406a0acc80cb64155e0080 and an auxiliary patch to make the previous one work: http://git.openvz.org/?p=vzctl;a=commit;h=3a2be3d999870f4beb7cae6cffa4c6414e92d3ea Now vzctl will hint you that kernel does not support vswap, and vzctl start will not start such a container vzctl set will not accept --ram and --swap Not sure why I haven't done it before, it was pretty trivial.
        Hide
        nils@lemonbit.com Nils Breunese added a comment -

        > For VSwap, you need RHEL6-based kernel. Please upgrade.

        Ah, that was not clear to me from reading that blog post and since vzctl seemed to support the --ram and --swap flags I assumed it would work on the RHEL5-based kernel.

        The RHEL6-based kernel also needs a RHEL6-based OS (CentOS 6 in this case), I guess? Or can the RHEL6-based kernel be used with CentOS 5?

        Show
        nils@lemonbit.com Nils Breunese added a comment - > For VSwap, you need RHEL6-based kernel. Please upgrade. Ah, that was not clear to me from reading that blog post and since vzctl seemed to support the --ram and --swap flags I assumed it would work on the RHEL5-based kernel. The RHEL6-based kernel also needs a RHEL6-based OS (CentOS 6 in this case), I guess? Or can the RHEL6-based kernel be used with CentOS 5?
        Hide
        sergeyb Sergey Bronnikov added a comment -

        Bug was fixed more than one year ago and there were no complains from reporter after fix. We believe bug fix helped and mark bug as closed.

        Show
        sergeyb Sergey Bronnikov added a comment - Bug was fixed more than one year ago and there were no complains from reporter after fix. We believe bug fix helped and mark bug as closed.

          People

          • Assignee:
            kir Kir Kolyshkin
            Reporter:
            nils@lemonbit.com Nils Breunese
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: