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

vzlist exit code 1 if no VMs are running

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: OpenVZ-legacy
    • Component/s: Containers::Userspace
    • Security Level: Public
    • Environment:
      Operating System: Other
      Platform: Other

      Description

      Using vzlist from vzctl-3.0.30.2-1.x86_64 whenever I'm trying to get a list of running machines, and there are none, the exit of vzlist is != 0, i.e. 1. This screws up a bit the logic of some monitoring programs, as they report that as a error condition. Is it? I mean, at least in my view it's a totally normal situation, when there are no VMs running.

      For example, libvirt's python wrapper (0.9x) raises an error because of that - when asking for connection.listDomainsID and all VMs are suspended -- which is really unpleasant as a lot of hacks are needed to go around that.

        Activity

        Hide
        kir Kir Kolyshkin added a comment -

        The error message was supposed for the case when you ask for specific CTs. Will fix.

        Show
        kir Kir Kolyshkin added a comment - The error message was supposed for the case when you ask for specific CTs. Will fix.
        Hide
        kir Kir Kolyshkin added a comment -

        Thanks for reporting. Fixed in GIT:
        http://git.openvz.org/?p=vzctl;a=commitdiff;h=fa6d54c0e970cd916b8d02fc87c2c2653470d298

        Will appear in vzctl >= 3.0.31 and possibly in 3.0.30.3

        This is how it works now:

        [kir@kirpad vzctl]$ sudo ./src/vzlist
        Container(s) not found
        [kir@kirpad vzctl]$ echo $?
        0

        [kir@kirpad vzctl]$ sudo ./src/vzlist 101
        CTID NPROC STATUS IP_ADDR HOSTNAME
        101 - suspended 192.168.33.101/ -
        [kir@kirpad vzctl]$ echo $?
        0

        [kir@kirpad vzctl]$ sudo ./src/vzlist 102
        Container(s) not found
        [kir@kirpad vzctl]$ echo $?
        1

        Show
        kir Kir Kolyshkin added a comment - Thanks for reporting. Fixed in GIT: http://git.openvz.org/?p=vzctl;a=commitdiff;h=fa6d54c0e970cd916b8d02fc87c2c2653470d298 Will appear in vzctl >= 3.0.31 and possibly in 3.0.30.3 This is how it works now: [kir@kirpad vzctl] $ sudo ./src/vzlist Container(s) not found [kir@kirpad vzctl] $ echo $? 0 [kir@kirpad vzctl] $ sudo ./src/vzlist 101 CTID NPROC STATUS IP_ADDR HOSTNAME 101 - suspended 192.168.33.101/ - [kir@kirpad vzctl] $ echo $? 0 [kir@kirpad vzctl] $ sudo ./src/vzlist 102 Container(s) not found [kir@kirpad vzctl] $ echo $? 1
        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 treat bug as fixed and close bug.

        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 treat bug as fixed and close bug.

          People

          • Assignee:
            kir Kir Kolyshkin
            Reporter:
            ilja.livenson@gmail.com Ilja Livenson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: