OpenVZ Forum


Home » General » Support » *SOLVED* Is there a way to "suspend" a VE?
*SOLVED* Is there a way to "suspend" a VE? [message #13553] Tue, 29 May 2007 23:11 Go to next message
kingneutron is currently offline  kingneutron
Messages: 30
Registered: May 2007
Location: NE IL, USA
Member
--I'm pretty sure I can duplicate .vmdk disk functionality by mounting things in a loopback file if $client requires that level of security/portability.

--However: Can a VE be "suspended" temporarily? This is useful for:

o Backups
o Quick resume of VE functionality
o VE is using too much CPU or is out of control

--I'm talking about sending a VE the equivalent of SIGSTOP and SIGCONT, and/or a full suspend-state-to-disk like vmware does. Confused (This can survive host reboots.)

TIA

[Updated on: Mon, 04 June 2007 07:11] by Moderator

Report message to a moderator

Re: Is there a way to "suspend" a VE? [message #13554 is a reply to message #13553] Tue, 29 May 2007 23:13 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
Quote:

--disabled yes|no
Disable VE start. To force the start of a disabled VE, use vzctl start with -force option.



from the vzctl man page. I believe this is what you are looking for.


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Is there a way to "suspend" a VE? [message #13555 is a reply to message #13554] Tue, 29 May 2007 23:27 Go to previous messageGo to next message
kingneutron is currently offline  kingneutron
Messages: 30
Registered: May 2007
Location: NE IL, USA
Member
Ah, yes - thank you. Smile Smile

That entry in the man page is pretty cryptic tho; what exactly does "Disable VE start" actually MEAN / entail? Rolling Eyes

--Also from the man page, it looks like checkpoint/restore is available, so suspend/resume looks doable:

[[
   Checkpointing and restore
       Checkpointing is a feature of OpenVZ kernel which allows to save a complete state of a running VE, and to restore it later.

       chkpnt veid [--dumpfile name]
              This command saves a complete state of a running VE to a dump file, and  stops the  VE.  If  an  option  --dumpfile  is  not  set,  default  dump  file  name
 /vz/dump/Dump.veid is used.

       restore veid [--dumpfile name]
              This command restores a VE from dump file created by the chkpnt command.
]]
Re: Is there a way to "suspend" a VE? [message #13556 is a reply to message #13555] Tue, 29 May 2007 23:34 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
when you say suspend, do you mean on a technical or business level?

ie, suspend could mean disable/"turn off temporarily" or freeze the running processes so that the environment can be moved or otherwise started later in the same state.

I saw your point, "o VE is using too much CPU or is out of control" and I assumed you were looking for the first option.


VZ architecture terms
---------------------

disabled: VE will not start/autostart. its like unplugging the power cable.

checkpoint: snapshot data and kernel memory so that environment can be started on another or the same server later with an identical state. upon doing this, the VE is not stopped nor disallowed from starting.





-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters

[Updated on: Tue, 29 May 2007 23:50]

Report message to a moderator

Re: Is there a way to "suspend" a VE? [message #13558 is a reply to message #13556] Wed, 30 May 2007 00:04 Go to previous messageGo to next message
kingneutron is currently offline  kingneutron
Messages: 30
Registered: May 2007
Location: NE IL, USA
Member
> freeze the running processes

...Can come in handy in some cases... But mostly I was looking for checkpoint/restore.

--If you can send a SIGSTOP equivalent to a running VE, and not have it crash due to I/O waits, this could be useful. i.e.:

o It stops processing events RIGHTNOW,
o Outstanding writes are SYNCed,
o Its filesystem is still mounted,
o It shows up in vzlist as "run-suspended", and
o What it was doing can be resumed immediately.

--This would be faster than a full suspend(checkpoint) and resume(restore).

--Equivalent to hitting ^Z (SIGSTOP) at the Bash prompt, so you can list jobs, issue "fg" and "bg" (could also resume with reduced-priority), etc. With a debugger attached to the VE, you could also look at what's it's doing at a deeper level (/proc and such like ' vzctl exec ' should still respond); but that's beyond my scope.

[Updated on: Wed, 30 May 2007 00:07]

Report message to a moderator

Re: Is there a way to "suspend" a VE? [message #13577 is a reply to message #13558] Wed, 30 May 2007 10:47 Go to previous messageGo to next message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
kingneutron wrote on Tue, 29 May 2007 20:04


--If you can send a SIGSTOP equivalent to a running VE, and not have it crash due to I/O waits, this could be useful. i.e.:

o It stops processing events RIGHTNOW,
o Outstanding writes are SYNCed,
o Its filesystem is still mounted,
o It shows up in vzlist as "run-suspended", and
o What it was doing can be resumed immediately.


It is possible just to freeze processes without writing their state to image file:
vzctl chkpnt VEID --suspend

and resume it later:
vzctl chkpnt VEID --resume


After suspend you can take snapshot of processes state:
vzctl chkpnt VEID --dump --dumpfile=PATH

Also after suspend you can just kill your VE:
vzctl chkpnt VEID --kill


As you can see "chkpnt" command is equal to sequential execution of 3 subcommands: --suspend, --dump and --kill.

Quote:


--Equivalent to hitting ^Z (SIGSTOP) at the Bash prompt, so you can list jobs, issue "fg" and "bg" (could also resume with reduced-priority), etc. With a debugger attached to the VE, you could also look at what's it's doing at a deeper level (/proc and such like ' vzctl exec ' should still respond); but that's beyond my scope.


You will be able to see list of processes after you did "vzctl chkpnt VEID --suspend", but you won't be able to debug them, as all VE processes will be in the same state - they will be in kernel's refrigerator() function.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Is there a way to "suspend" a VE? [message #13602 is a reply to message #13553] Wed, 30 May 2007 17:26 Go to previous message
kingneutron is currently offline  kingneutron
Messages: 30
Registered: May 2007
Location: NE IL, USA
Member
+1 Spiffy Cool

Thanks!!
Very Happy
Previous Topic: TEST IDEA - Scaling with openvz
Next Topic: OpenVZ and Virtuozzo
Goto Forum:
  


Current Time: Tue Aug 13 20:08:54 GMT 2024

Total time taken to generate the page: 0.02949 seconds