*SOLVED* Is there a way to "suspend" a VE?
--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. (This can survive host reboots.) TIA
Re: Is there a way to "suspend" a VE?
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.
Ah, yes - thank you. That entry in the man page is pretty cryptic tho; what exactly does "Disable VE start" actually MEAN / entail? --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. ]]
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.
> 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.
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.
+1 Spiffy Thanks!!