<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    I have a strange error on one of our servers when I use vzctl.
    There's a running host with a few VE-s and if I type <i>vzctl enter
      "CTID"</i> then I receive <i>enter into CT "CTID" failed</i> and
    no further messages. After a lot of debugging I realized that it
    works if I directly connect via the server's console, but if I login
    via ssh it gives the error.<br>
    The system parameters:<br>
    OS: CentOS release 6.4<br>
    Kernel: Linux vm4 2.6.32-042stab078.10 #1 SMP Wed May 8 19:45:03 MSK
    2013 x86_64 x86_64 x86_64 GNU/Linux  <br>
    vzctl: vzctl-core-4.2-1.el6.x86_64<br>
             vzctl-4.2-1.el6.x86_64<br>
    <br>
    I've tried to reboot the system with different kernels, but the same
    error. There's another strange thing: we have another machine with
    the same kernel but I cannot reproduce the error there.<br>
    I've also tried to run vzctl with gdb and search in the source code,
    and there seems to be a problem around setting up the environment:<br>
    In src/lib/hooks_vz.c there's a function:<br>
    <br>
    <i>static int vz_env_create_ioctl(vps_handler *h, envid_t veid, int
      flags)</i><i><br>
    </i><i>{</i><i><br>
    </i><i>        struct vzctl_env_create env_create;</i><i><br>
    </i><i>        int errcode;</i><i><br>
    </i><i>        int retry = 0;</i><i><br>
    </i><i><br>
    </i><i>        memset(&amp;env_create, 0, sizeof(env_create));</i><i><br>
    </i><i>        env_create.veid = veid;</i><i><br>
    </i><i>        env_create.flags = flags;</i><i><br>
    </i><i>        do {</i><i><br>
    </i><i>                if (retry)</i><i><br>
    </i><i>                        sleep(1);</i><i><br>
    </i><i>                errcode = ioctl(h-&gt;vzfd, VZCTL_ENV_CREATE,
      &amp;env_create);</i><i><br>
    </i><i>                fprintf(stderr,"error code: %d\n",errcode);</i><i><br>
    </i><i>        } while (errcode &lt; 0 &amp;&amp; errno == EBUSY
      &amp;&amp; retry++ &lt; ENVRETRY);</i><i><br>
    </i><i>        if (errcode &gt;= 0 &amp;&amp; (flags &amp;
      VE_ENTER)) {</i><i><br>
    </i><i>                /* Clear supplementary group IDs */</i><i><br>
    </i><i>                setgroups(0, NULL);</i><i><br>
    </i><i>                /* Set personality PER_LINUX32 for i386 based
      CTs */</i><i><br>
    </i><i>                set_personality32();</i><i><br>
    </i><i>        }</i><i><br>
    </i><i>        else{</i><i><br>
    </i><i>            fprintf(stderr,"%s,%d\n",strerror(errno),errno);</i><i><br>
    </i><i>        }</i><i><br>
    </i><i>        return errcode;</i><i><br>
    </i><i>}</i><br>
    <br>
    The ioctl returns with an error: INVALID ARG. Also the vzct
    start/stop don't work.<br>
    I compared the two host's environment variables, but no difference.<br>
    <br>
    Thank you for your help in advance!<br>
    <br>
    Regards,<br>
    Tamas<br>
    <br>
    <br>
  </body>
</html>