OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
37c621d1162Released vzctl 4.8Changes: see https://openvz.org/Download/vzctl/4.8/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
fe528782f9bredhat-set_hostname.sh: fix for F15+/RHEL7New Fedora releases as well as RHEL7 uses systemd, which prefers to take hostname from /etc/hostname (a la Debian), therefore if this file is present, setting hostname in /etc/sysconfig/network no longer works. To fix, check if /etc/hostname exists and set hostname in there, otherwise use old setup. NOTE: hostname(5) says that hostname should not contain dots, i.e. not be FQDN, so we strip th...
Kir KolyshkinKir Kolyshkin
c1baf6c41e1vzlist: fix cpulimit roundingAs pointed out by Kevin, > When setting a cpulimit with vzctl which cannot be divided by /25 > without getting a decimal, vzlist then shows an off value. > > For example: > :~# setgetlim(){ vzctl --quiet set 810 --cpulimit $1; vzlist -Ho cpulimit 810; } > :~# for lim in $(seq 0 800); do if [ $lim == $(setgetlim $lim) ]; then > echo $lim; fi; done > 0 > 25 > 50 > 75 Fix by using double for cal...
Kir KolyshkinKir Kolyshkin
83059f003b2vzlist: fix showing DISABLEDAs pointed out in bug #3029, vzlist showing DISABLED=yes if DISABLED=no is set in CT config. As DISABLED is actually a tri-state value (yes/no/unset), we need to check for YES value explicitly. https://bugzilla.openvz.org/3029 Reported-by: Kevin Holly <root@hallowe.lt> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d4430fe64e7chkpnt(): add FIXME to add CRIU supportWhile vzctl supports CRIU, it does not do it for fine-grained checkpoint/restore (i.e. vzctl suspend --suspend/--dump/--kill etc). Add a comment about that. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4066e7d5081postcreate.sh: fix caps for suexecFix caps for suexec binary, according to what is set in Fedora 18/19/20 and CentOS 7. Old value that was used before this patch is from Fedora 17 which is no longer supported. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
baf4fe5463fsetver.sh: abort if autogen.sh/configure failsSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
51981c812b7vzmigrate: don't exit 1 on successAn explicit exit 0 is required at the end of the script as undo_lock calls undo_ssh_mux that can set $? to 1 due to test statement returning false. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c69a2e533a8vzmigrate: undo_lock if check_cpt_props failedSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6be5c5882d4vzctl snapshot-switch --must-restore: rollback config on errorWith --must-restore, we are rolling back all the changes if restore fails. The only problem is we are not restoring back CT config. Let's do that. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4fd00dc4064vzctl snapshot-switch: improve an error messageSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d38a97e84e4vzctl snapshot-switch: add --must-restoreIt has been pointed out to me that snapshot-switch ignores the failure to restore a CT from a dump file. Also, not every snapshot contains a dump file, so it's not clear whether we will have a running or stopped container after this operation. Introduce --must-restore flag to eliminate such uncertainty -- if it is set, a dump file is required (i.e. its absense is treated as an error rather tha...
Kir KolyshkinKir Kolyshkin
635bd5f2a0cFix PARAM_* values collisionOops, PARAM_SNAPSHOT_SKIP_CONFIG has the same value as PARAM_SKIP_UMOUNT. While not a problem as these can't be used together, better fix it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
897cb790ff4vzmigrate: don't use rsync --delete-excludedOptions "--exclude $TOP_DELTA --delete-excluded" were used for rsync in case of migration with ploop-copy in order to delete the top delta so that ploop copy receive don't stumble (it does not overwrite existing files). Unfortunately, this makes it unable to pass some other arbitrary --exclude options to rsync in case there is a need to say "skip those files, they are already there" to rsync. ...
Kir KolyshkinKir Kolyshkin
2d210bd4883vzctl create --diskinodes: check for max ploop sizeUse the ploop_get_max_size to check if the value of --diskinodes given is too high, and if yes suggest what the maximum value is. Note it requires ploop library 1.12 or greater, but should work with older library, as it checks that the function pointer is non-NULL. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c90b707f961vz.conf: fix a typos/с/c/ This is funny, but somehow a cyrillic 'c' appeared in vz.conf. https://bugzilla.openvz.org/3023 Reported-by: Evgenii Terechkov <evg@altlinux.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f2e8120a765postcreate.sh: add RHEL7/CentOS7 supportSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
190c2746700debian-add_ip.sh: support for Ubuntu 14.04In Ubuntu 14.04, /etc/init.d/networking script was deliberately modified to to work if init if upstart (which is the case), always returning 1 and doing nothing. So, we can't rely on it anymore, therefore adding an IP to ubuntu-14.04-based container was not working as it should. This patch is somewhat reverting commit 826a387, going back to using ifdown and ifup. Now, that commit mentions that...
Kir KolyshkinKir Kolyshkin
4dbc26f39bdvzctl(8): improve --netfilterMake it more clear what various values means. While at it, improve the formatting. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b16c52bcf1dvzctl compact: use built-in PATHIn case /usr/sbin is not in PATH, vzctl compact fails. Fix by using the built-in PATH. https://bugzilla.openvz.org/2990 Reported-by: Pavel Odintsov <pavel.odintsov@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
68440c5a62fvzctl.spec: don't disable conntracks if firewall is usedUnfortunately, conntracks is not only used for NAT/MASQERADE, but also for 'state RELATED,ESTABLISHED' iptables rules, so if those are used, disabling conntracks will lead to non-working networking on host system. Therefore, add one more check (to one in commit f17350f) and do not disable conntracks if state RELATED and/or ESTABLISHED is used in current iptables rules. Signed-off-by: Kir Koly...
Kir KolyshkinKir Kolyshkin
9341df98703vzctl create: improve "no ploop" error messageAs pointed out in bug #2993, the message about absent ploop library is not clear enough. Expland it, telling how to revert to simfs in case a user don't want to or can't use ploop. https://bugzilla.openvz.org/show_bug.cgi?id=2993 Reported-by: Ionut Biru <biru.ionut@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
96292ef5618vzmigrate: fix --ssh-mux descriptionSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ad6993c3091setver.sh: check for ./configure to run autogenCurrent check, for aclocal.m4, is not sufficient, because autogen.sh can fail somewhere in the middle, without creating ./configure. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b9c1ee29540vzmigrate: lock_ct: fix args usageDon't refer to $1 in lock_ct() as we run it without arguments. Use $VEID instead. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d8c0aac9a06vzmigrate: don't run ps if there's no $pidCheck that $pid is not empty before running ps. Otherwise we have this: Error: ERROR: CT already locked by PID error: list of process IDs must follow -p Usage: ps [options] Try 'ps --help <simple|list|output|threads|misc|all>' or 'ps --help <s|l|o|t|m|a>' for additional help text. For more details see ps(1). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
06b70353f60vzmigrate: detect "can't lock CT" errorIn some cases we can't lock container not because it's already locked, but for some other reason (running as non-root, no lock directory). In such cases, there is no lock file, so we can check for this condition print an appropriate error message and exit. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
424c15f00afvzmigrate: don't use "Error" with log 0log 0 already prints "Error:" prefix, so there is no need to do it once more. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3f27f352b1dvzmigrate: use getopt for option parsingThis makes option parsing a bit simpler and more robust. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
92ceebee763vzmigrate: remove -?Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c78b6e584cdvzmigrate: move --nodeps parsing to a separate functionSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8e441fe3295vzmigrate: in case of too many params, show themSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
452ff1255b3vzmigrate: don't print colon in bad_usage()Instead, put it to its argument. Useful for the next patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c558281fcafvzmigrate: suppress error from kill -0kill -0 $pid is used to check if the $pid is still there, and if not we error out with an appropriate message. It doesn't make sense to show an error from kill: kill: (1235) - No such process so let's suppress it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
5c6958dd97dvzmigrate: use vznnc -fSee previous commit for explanation. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c4d348418bavzncc: add -f FD optionIf a program to run allows to specify a file descriptor to read from and write to (ploop copy already does), we can keep its stdin/stdout intact with this option. This should help to see debug output from ploop copy (alas, sending side only for now as receiving side stdout is redirected to /dev/null by vzmigrate). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
afd0155374evznnc: check that -p is setPort number is required argument, so check it's supplied. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
687ae1c471evznnc(8): provide usage exampleSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
40accebb81cvznnc(8): explain -- separatorSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
fd8a3eb9b20vzmigrate: fix vznnc usageAs ploop copy contains options, we need to guard them from vznnc's own options by using -- separator. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
341be58ade1vznnc: add poll() to check if stdin is aliveThis is an attempt to solve a problem of stale vznnc. vzmigrate runs vznnc -l via ssh in background, like this: ssh -L localhost:$port:localhost:$port $DEST vznnc -l $port $CMD & ssh_pid=$! and then proceeds to other stuff. If that other stuff fails, vzmigrate needs to do a rollback, so it kill ssh: kill -TERM $ssh_pid The problem is while ssh itself is killed, vznnc on the $DEST is sti...
Kir KolyshkinKir Kolyshkin
09af37a8bc7vznnc: check error from listen()Although it's unlikely that listen() will fail, check its return value just to be on the safe side. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1f29823760fvznnc: minor refactoringMove cl_addr and cl_len declaration to connect block. Initialize cl_addr right at declaration. Mark yes variable as const. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f1c55c7bf17vznnc: use getoptMake vznnc more flexible it in arguments parsing by using getopt. As syntax is changed now, modify vzmigrate accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1097e4b4a77vzmigrate: fix port forwardingAs vznnc listens at localhost, ssh -L remote_host argument should also be localhost. While at it, s/localhost/127.0.0.1/ so that ssh no longer relies on proper 'localhost' record in /etc/hosts. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
236808631f0vzmigrate: replace socat and bash with vznncSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
edf1688941cvznnc: addThis little proggie is added to replace socat in vzmigrate. Problems with socat are: - one more dependency - can't get executed program exit code Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f45647040f9vzmigrate: bind to localhost onlyWhen setting up openssh port forwarding to be used by ploop copy with feedback, make ssh listen only on localhost rather than any IP. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
739786a9acavzmigrate: add --flags to vzctl chkpnt callvzctl chkpnt --flags option can be used to pass flags/caps of the remote CPU (obtained by vzcptcheck tool) to the local kernel, so it might use this knowledge to do something good. Whether or not the current kernel uses that is questionable, but it might. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
381fc43fbcevzmigrate: ability to run verbose ploop copyIn case -vv is specified, run ploop -vvvv copy. This will print ploop timings in case ploop is compiled with timings profiling (see http://git.openvz.org/?p=ploop;a=commitdiff;h=9e4aa564fc40) Signed-off-by: Kir Kolyshkin <kir@openvz.org>