OpenVZ-legacy
  1. OpenVZ-legacy

vzctl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
bf23eb8959dReleased vzctl 4.1.1Changes: see http://wiki.openvz.org/Download/vzctl/4.1.1/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Glauber CostaKir KolyshkinGlauber Costa
219a0c6c571configure: fix 'arch support openvz kernel' test caseThe file vzsyscalls.h has its constant definitions enclosed within VZ_KERNEL_SUPPORTED. This has the desired effect of not including any of those definitions - including the #error condition on non-suported arches - during normal compilation. When we compile test vzsyscalls.h, however, that constant is not yet defined and we'll skip it all. As a side effect, the test will always succeed. This...
Kir KolyshkinKir Kolyshkin
71f364c72f0etc/init.d/vz*: clean up VZREBOOTDIRFirst, it makes sense to clean up VZREBOOTDIR just before saving the list of now-running CTs in stop_ve() Second, since the previous commit we are not starting CTs having ONBOOT=no, so they are not cleared up from VZREBOOTDIR. So, clean up VZREBOOTDIR right after getting the list. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 74cdb9b546fc96ee5fe4dfbdcc4c8b1225666f6d)
Kir KolyshkinKir Kolyshkin
5884934b926init.d/vz*: do not auto-restart CTs with ONBOOT=noSince vzctl 4.1 we have a feature to save the list of running containers on init.d/vz stop, and then start those containers on init.d/vz start (in addition to ones having explicit ONBOOT=yes). This feature, while being great per se, creates a controversial behavior: if a container is specifically marked with ONBOOT=no but it was running before a reboot, it is started nevertheless. The solutio...
Kir KolyshkinKir Kolyshkin
d7404c4ccc1vzlist: show if onboot field is unsetField onboot was just yes/no (or true/false in json output), but internally it can be in one of three states: 0 NONE (i.e. unset) 1 YES 2 NO This patchs adds vzlist support to display the 'unset' state, as either '-' (in conventional output) or 'null' (in json output). This functionality is needed by the following patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from c...
Glauber CostaKir KolyshkinGlauber Costa
9c6936b79d9allow vzsyscalls.h to always be called.To avoid spreading ifdefs all over, we would like to keep the include of vzsyscalls.h unconditional. So after we already defined VZ_KERNEL_SUPPORTED, we can test for that. We also tweak the message a bit to make it more descriptive. Signed-off-by: Glauber Costa <glommer@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 8fec4357ce55bf1b60d90499eacc7242aa44...
Glauber CostaKir KolyshkinGlauber Costa
1533ed492b7don't compile hooks_vz.c if vz-kernel support is not enabled.Signed-off-by: Glauber Costa <glommer@parallels.com> (cherry picked from commit 9c9c0658ecc49516a649af5151227c7e42bb8838)
Glauber CostaKir KolyshkinGlauber Costa
d5417971a08don't support vz-specific cpu functions if vz kernel is not presentWe can't call any of the vz ioctls if we are not running in a vz-compatible kernel. So if it is compile-time disabled, don't compile them in. We could do it in headers, but those functions will have upstream similars, so we need them to be callable function objects, that will just return a meaningful error in this case. [kir@openvz.org: add comments to #else/#endif] Signed-off-by: Glauber Co...
Glauber CostaKir KolyshkinGlauber Costa
cdb77eaa6cbprovide a upstream alternative for ub functionsThe ub functions will not be ever supported in upstream kernel. Still, they are called in a quite widespread fashion throughout the code. One possible course of action for this, is to skip the compilation of ub.c, and at the same time provide an empty set of inline functions in ub.h [kir@openvz.org: remove #error, add comments #else/#endif */ Signed-off-by: Glauber Costa <glommer@parallels.c...
Glauber CostaKir KolyshkinGlauber Costa
40c1b11828cvz_open(): skip vz kernel init if not availableThe vz-kernel is not available in all architectures where mainline Linux can run. If we detect this to be the case, the code won't be compiled. Signed-off-by: Glauber Costa <glommer@parallels.com> (cherry picked from commit 622295b0ec872c0186684ebb38983f9d70a1ec14)
Glauber CostaKir KolyshkinGlauber Costa
82e9d7a7e05configure: test for vz-kernel support in the target architectureThe include file "vzsyscalls.h" have a comprehensive list of vz-syscalls and which architectures support them. If that file is included in a not supported architecture, it will trigger an #error, which is a very reliable way to determine that vz-specific code should not be compiled in at all. Since this places some new infrastructure in place for presence of OpenVZ kernel support, this comes w...
Kir KolyshkinKir Kolyshkin
a464f6bc0d9etc/init.d/vz-gentoo: add VE_STOP_MODE handlingThis is an addition to previous commit ab3da01 http://bugzilla.openvz.org/2432 Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit d60393a2cc22fffef36d54adb5e1323dfb21aea2)
Kir KolyshkinKir Kolyshkin
998256ff051Implement VE_STOP_MODE global config parameterIt can be set to either 'suspend' or 'stop', with suspend being the default. Man page modified accordingly. http://bugzilla.openvz.org/2432 Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit ab3da01a91e0a39fb2b2ad4452d201f6e2b2f0b5)
Kir KolyshkinKir Kolyshkin
0939e02ee61etc/init.d/vz*: only apply oom score if file existOOM score adjustment is only available in RHEL6-based kernel. Check that proc file exist before trying to write to it. http://bugzilla.openvz.org/2423 Reported-by: Tom P <tomp@tomp.co.uk> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 8c3a5cf71d7abab2d2d31a7b28005f48bdc10c54)
Kir KolyshkinKir Kolyshkin
b643d1a6c27vzlist --json: skip collecting numcpu info on old kernelNon-RHEL6 kernels do not have /proc/vz/fairsched (or --cpus, for that matter) so we can't collect this information, so let's just skip it. Before this patch, vzlist output was: # vzlist --json > /dev/null Unable to open /proc/vz/fairsched/1193/cpu.nr_cpus: No such file or directory Unable to open /proc/vz/fairsched/1199/cpu.nr_cpus: No such file or directory Reported-by: Aleksandar Ivanis...
Kir KolyshkinKir Kolyshkin
b4acaa5b093vzctl set --devnodes: add /usr/lib/udev/devicesFunction dev_create() tries to create a device file in both /dev (for immediate use) and under udev tree (for device node to appear after a reboot). For udev, there are many different udev versions and thus several directories. There is a change made for vzctl 3.3 in Gentoo vzctl ebuild by Samuli Suominen <ssuominen@gentoo.org>, patching the function to set udevdir path provided by 'pkg-config...
Kir KolyshkinKir Kolyshkin
76c9ca21206etc/init.d/vz*: fix CT (re)startCommit af5bf43 introduced support for restarting containers that were running before reboot. Unfortunately, there is a bug in this code: # List CTs from vzrebootdir plus the ones with ONBOOT=yes velist=$(ls $VZREBOOTDIR; vzlist -aH -octid,onboot | awk '$2 == "yes" {print $1}') # Then sort by bootorder velist=$(vzlist -aH -octid -s-bootorder $velist) If velist is empty after the first st...
Kir KolyshkinKir Kolyshkin
c90c3dc3baeReleased vzctl 4.1Changes: see http://wiki.openvz.org/Download/vzctl/4.1/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0e6293370cfsetver.sh: if rpm install failed, exit with error... and do not remove rpm files. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4794d7e726bsetver.sh: add -o|--oldpackage optionSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
db7900e08d4vzevent-stop: workaround for F17 that doesn't call reboot()The problem is systemd from Fedora 17 doesn't invoke reboot() syscall at all, so kernel doesn't know if CT is rebooted and send us stop event instead of reboot event. The workaround has two parts 1 vzdummy-systemd-f17 package installed inside an F17-based container have /usr/lib/systemd/system/vzreboot.service file (and a symlink to it from /lib/systemd/system/reboot.target.wants/) which ...
Kir KolyshkinKir Kolyshkin
b8a4d959628suse-add_ip.sh: only set default route to venet0 if there is no otherAs per the bug report, only set default route to venet0 if there is no any other default route set. http://bugzilla.openvz.org/2376 Reported-by: Andres Toomsalu <andres@active.ee> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8c287191ce2etc/init.d/vz*: eliminate "Container(s) not found" msgWhen doing vz stop, most probably all CTs will suspend fine during the first stage, so after it vzlist return nothing but do this: ++ vzlist -H -o ctid -sbootorder Container(s) not found To fix, redirect its stderr to /dev/null Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a1dd7167e38setver.sh: do not keep tmp files behindDo move not copy when restoring original configure.ac and vzctl.spec Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
af5bf4303c5etc/init.d/vz*: restore running containers after rebootOn vz stop, save CTIDs of all running containers to /var/lib/vzctl/vzreboot On vz start, start containers with saved IDs (plus the ones marked with ONBOOT=yes) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8fa8a6193c3etc/init.d/vz* stop: add pre-stop stage(1) Before stopping/suspending all CTs, set the same value for their cpuunits for them to have equal abilities to stop. Before this patch, we were setting cpuunits for CTs one by one, and high cpuunits value for some CTs that stop later might cause a slowdown. (2) Unset cpulimit only before stopping CT (doesn't make sense to do before suspending). Signed-off-by: Kir Kolyshkin ...
Kir KolyshkinKir Kolyshkin
8cf2db4a2adetc/init.d/vz*: fix vzlist invocation in stop_ve(s)Option -H was forgotten. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6812ff71787properly propagate /var/lib/vzctl/veip dirOtherwise we could run into a discrepancy then Makefile thinks it's /usr/var and vzctl thinks it's /var. I am not sure why it should be /usr/var and whoever on earth uses this, but it's the same problem as with /etc vs /usr/etc (which is workarounded in ./configure script). While at it, also remove non-relevant comment about iptables from scripts/vps-functions.in Signed-off-by: Kir Kolyshkin...
Kir KolyshkinKir Kolyshkin
0aef01baf4cetc/init.d/vz*: fix printing literal $veidIt was like this: # /etc/init.d/vz stop Suspending CT $veid Suspending CT $veid Suspending CT $veid Suspending CT $veid Suspending CT $veid Suspending CT $veid Suspending CT $veid Suspending CT $veid Fixup after commit 537888a. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f14a6e11980etc/init.d/vz-redhat: add more locals to stop_vesFixup after commit 537888a. For some reason the gentoo script was OK. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b5130d5a094vps-create: fix checking needed disk spaceOh this is quite a story. Sit down and listen, folks. First, since 14 Dec 2002 (coreutils-4.5.4) and up until to 6 Jan 2012 (coreutils-8.15), ls -lk was printing file size in kilobytes. It's man page (as of coreutils-8.15) was still saying that: -k, --kibibytes use 1024-byte blocks although info page is already fixed: `-k' `--kibibytes' Set the default block size...
Kir KolyshkinKir Kolyshkin
c3cb0b21120vzctl restore: print 'container restore failed'If fn is not NULL in vps_start_custom(), it means we're doing restore rather than start. Fix log messages accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e7b64797a88vzctl restore: do not print "Starting container"Move "Starting container..." message from vps_start_custom() to vps_start(),so when doing restore we print "Restoring", and when doing start we print "Starting". Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f95b00bbbedsetver.sh: remove dist tarball and (s)rpmsIf we do install we probably don't need dist tarball and just-installed RPMS. Do clean those. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
70fc6606775setver.sh: do not hardcode vzctl nameSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0efd039fcc8Makefile.am: we only need .bz2 for make rpmsWe use tar.bz2 as a source archive to make rpms, so depend on dist-bzip2 rather than dist (which makes both tar.gz and tar.bz2). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0f02c03f908vzctl start: do not remount fs if we try restore firstWhen vzctl start tries to restore a CT, it mounts it first, then, if restore fails, it unmounts and then tries to start and mounts again. Introduce SKIP_UMOUNT and SKIP_REMOUNT flags and use them to skip unecessary remount. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
aa23dde76a7start(): refactor setting skip flagNeeded for the next patch Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a90feba57ebvzctl start: move checks from try_restore() to start()Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e7ae4d4a094vzctl start: tell we're going to restorePrint "trying to restore" and the dump file name. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ad54db6d215vzctl start: do start if restore failedOtherwise we are leaving CT in a non-startable state. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e916962a0ccsetver.sh: remove -c|--clean option, set it automaticallyWe need clean when we do build. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9e3413f20c7vzctl_resize_image(): initialize ploop_resize_paramSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
cab43d9ae39vzeventd: do process -h optionSomehow it was omitted from getopt() argument. Help was still printed, the only consequences were: 1 error message saying -h is unknown option 2 exit code of 1 instead of 0 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c31afc7e2b9setver.sh: add -c|--cleanTo restore vzctl.spec and configure.ac to originals. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
15e8b70bfcfvzctl snapshot-switch: fix ve.conf restorationYet another stupid mistake. I swear I was not on drugs! Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8f9599793d5vzctl snapshot*: improve --id parameter parsing1. Allow for GUID not in curly brackets {} 2. Validate GUID format. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0519dfbed0fvzctl snapshot: fix copying CT configIt was a very stupid typo of mine that resulted in copying Snapshots.xml instead of CT config file when creating a snapshot. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
bbb68633df6set_userpass.sh: fix bashismUse sed to split user:passwd string. Originally reported to Debian: > possible bashism in ./etc/vz/dists/scripts/set_userpass.sh line 26 > (${parm/?/pat[/str]}): > local user=${userpw/:*/} http://bugzilla.openvz.org/2403 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690713 Reported-by: Raphael Geissert <atomo64@gmail.com> Reported-by: Ola Lundqvist <opal@debian.org> Signed-off-by: ...
Kir KolyshkinKir Kolyshkin
845a257aaafscripts/vps-download: fix bogus warning from checkbashismsIt complains heredocument construct is not closed. Changing -EOF- to =EOF= helps ;) Signed-off-by: Kir Kolyshkin <kir@openvz.org>