OpenVZ Forum


Home » General » Support » [Solved] MIgrated Ubuntu VPS take 2 minutes to shut down
[Solved] MIgrated Ubuntu VPS take 2 minutes to shut down [message #34036] Wed, 26 November 2008 17:07 Go to next message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
I am migrating a lot of Ubuntu VE from Vserver to OpenVZ. I could solve all problems except one: the machines wont shut down. A vzctl VEID stop kills all daemons except the init process - after 2 Minutes it seemes the init will recieve a kill -9. A reboot inside the VE in not successful, init hangs forever.

In this forum I found, that it is likely that this behavior has to do with udev. Does someone know the difference to the templates, wich work fine? What changes do I have to make to shut down clean the init process of the VE?

Thx

[Updated on: Wed, 10 December 2008 15:37]

Report message to a moderator

Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34089 is a reply to message #34036] Mon, 01 December 2008 12:27 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

what kernel do you use? What vzctl version do you use? What ostemplate (the exact version) your VE is based on? Do you have any special settings inside problem VE (anything is mounted inside VE or something ...)?

Is it possible to reproduce the problem with ostemplates from http://download.openvz.org/ ?
Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34090 is a reply to message #34089] Mon, 01 December 2008 13:24 Go to previous messageGo to next message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
Thank you for the reply. I do not use a template. The templates are working. I draged a VE from vserver to openzv. Because they are about 300 servers I have no other chance. vzctl is able to shutdown the init process in the template VE's, so there must have been modifications made in the guest OS, which I was not able to find.

The versions:
Linux openvz01 2.6.24-21-openvz #1 SMP Wed Oct 22 02:50:53 UTC 2008 i686 GNU/Linux
root@openvz01:~# dpkg -l | grep vzctl
ii  vzctl                                     3.0.22-5ubuntu1             server virtualization solution - control too
root@openvz01:~#

[Updated on: Mon, 01 December 2008 13:46]

Report message to a moderator

Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34093 is a reply to message #34090] Mon, 01 December 2008 15:27 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
And what about special settings? Any mounted filesystems inside VE?
If you have a suspicion that udev may cause this issue it's worth to increase udev loglevel (udevcontrol utility can do it).

What state does init process have? Are you able to "strace" init process?
Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34097 is a reply to message #34093] Mon, 01 December 2008 17:54 Go to previous messageGo to next message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
This is what the mounts look like:
root@ppdev:/# mount
simfs on / type simfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /var/run type tmpfs (rw,relatime)
tmpfs on /var/lock type tmpfs (rw,relatime)


I try to stop inside the VE ppdev:

root@ppdev:/# udevcontrol log_priority=debug
root@ppdev:/# halt
root@ppdev:/# got signal 15
                           exited from VE 103


All processes seem to be killed quick. From now on only one process ist running for ever:

~root@openvz01:~#vzlist 103
      VEID      NPROC STATUS  IP_ADDR         HOSTNAME
       103          1 running 193.80.225.57   ppdev
root@openvz01:~# 


It's the init process:
root     15617  0.0  0.0   1568   536 ?        Ss   Nov27   0:01 init [0]


Trying to kill:
root@openvz01:~# kill -9 15617



Now the VE is still running without any procs =8-|
root@openvz01:~# vzlist 103
      VEID      NPROC STATUS  IP_ADDR         HOSTNAME
       103          - mounted 193.80.225.57   ppdev

Trying to stop from outside:
root@openvz01:~# vzctl stop 103
Unable to stop: VE is not running


There was no output in the syslog until I startet again
Dec  1 18:07:20 ppdev shutdown[11782]: shutting down for system halt
Dec  1 18:07:21 ppdev init: Switching to runlevel: 0
Dec  1 18:07:26 ppdev exiting on signal 15
Dec  1 18:19:44 ppdev syslogd 1.4.1#17ubuntu7.1: restart.
Dec  1 18:19:45 ppdev init: no more processes left in this runlevel


I also tried to unmount all bevor stopping the VE - no success Sad

How can I trace when nothing ist running? I am not sure, if there is a possibility to trace init, because its the first porcess.

[Updated on: Mon, 01 December 2008 17:57]

Report message to a moderator

Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34098 is a reply to message #34097] Mon, 01 December 2008 18:32 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

Quote:


I try to stop inside the VE ppdev:

root@ppdev:/# udevcontrol log_priority=debug
root@ppdev:/# halt
root@ppdev:/# got signal 15
                           exited from VE 103




And does "vzctl stop 103" command work from HN? Could you possibly try it?
Actually "reboot" inside VE is a little bit tricky operation,
Read http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf "Rebooting Virtual Private Server, page 71"


Quote:


It's the init process:
root     15617  0.0  0.0   1568   536 ?        Ss   Nov27   0:01 init [0]




Ok, it's in a sleeping state. Seems nobody "sends" init a signal.
As far as I understand reboot (sys_reboot) syscall must be invoked (not "kill" from inside the VE because it's impossible to kill init from inside the VE moreover it's impossible to do it on a common Linux machine).
Does "reboot" command from inside the VE kills init properly?

Quote:


Now the VE is still running without any procs =8-|



No, nothing of the kind, this VE is not in running state it is in "mounted" state.

Quote:


Trying to stop from outside:
root@openvz01:~# vzctl stop 103
Unable to stop: VE is not running




As VE is not running but in mounted state you should invoke "vzctl umount 103" command.


So, I have a suspicion that init scripts inside VE cause such behavior but it's still unproven.
How long did you wait until manually killed init process? Are there anything in dmesg/logs on the HN?
Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34103 is a reply to message #34098] Tue, 02 December 2008 08:11 Go to previous messageGo to next message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
  • Stopping the VE from the HE works, but the init process hangs for 2 minutes, then it is for some reason killed. The VE is unmountet as well then.
  • A reboot command results in an hanging init process as well
  • I waited 12 mintutes before I killed the init process manually
  • No output from dmesg in the HE
    [48496.766025] CT: 103: started
    [419258.414523] CT: 103: stopped
    [419523.494158] CT: 103: started
    [420068.767340] CT: 103: stopped
    [420070.952626] CT: 103: started
Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34113 is a reply to message #34103] Wed, 03 December 2008 09:16 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

could I get that VE from somewhere, i.e. is there a chance to make a tarball and provide a link to get it?
Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34117 is a reply to message #34113] Thu, 04 December 2008 09:28 Go to previous messageGo to next message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
I set up a box for you, but email is disabled, so I can't send you a login. I copied a tarball of the box itself at http://193.80.225.68/vetest.tgz, its 146MB.

[Updated on: Thu, 04 December 2008 09:29]

Report message to a moderator

Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34125 is a reply to message #34117] Fri, 05 December 2008 08:36 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,


you should create appropriate symlink:

ln -s /etc/init.d/halt  /etc/rc0.d/S90halt
Re: MIgrated Ubuntu VPS take 2 minutes to shut down [message #34167 is a reply to message #34125] Wed, 10 December 2008 15:37 Go to previous message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
Thanks a lot, it works!
Previous Topic: How to change VPS network card to eth0??
Next Topic: delete
Goto Forum:
  


Current Time: Thu Jul 18 02:31:25 GMT 2024

Total time taken to generate the page: 0.02664 seconds