OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
7290617e6d1Released vzctl 3.3Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7b3bf88e8ccsetver.sh: exit with 0 if called w/o optionsIf setver.sh is called without any options, it's exit code is 1 because of if statements. Fix it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
54f7c5cc2a5Fix version in vzctl.spec and configure.acThis was mistakenly committed as part of 8458efd. Revert it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b5599ead7b6vzmigrate: improve timings display, add -t option1. Separate the code to print timings into a function 2. Use printf to produce better formatted output 3. Introduce -t, --times option to print timings 4. Retain backward compatibility by making -v imply -t 5. Document -t in man page Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
385945f6a8bvzmigrate: fix max verbosity in docSince commit 2bb2af83 max verbosity is 4. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8458efd7014setver.sh: added --verbose, --build, --installAdded the following options -b, --build Build rpms -i, --install Build and install rpms -v, --verbose Be verbose, show version which we set Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c6d150e5068vzctl.spec: add ploop requirementploop tool is required by vzmigrate. Note that ploop-lib dependency is redundant (it is required by ploop), so no need to have it here. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e3db18b3c11vzmigrate: show separate pcopy2 timeIn case we use ploop copy, second stage of it (after suspend) is happening just sefore dump, so "Suspend + Dump" time now includes time of pcopy second stage. Calculate this second stage pcopy time, show it as Pcopy2, and subtract its value from "Suspend + Dump" time. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0a9503204d4vzmigrate: fix showing suspend time for ploop caseThis looks a bit tricky because it's ploop copy who runs vzctl suspend. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a8ecbabcbe6vzmigrate: do not show rsync2 and 2nd quota times for ploop caseThose are skipped for ploop case, doesn't make sense to show zeroes here. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
00e4ef7fd24vzmigrate: fix 'Copy dump file' timing for ploop caseIt is calculated as $(get_time $time_copy_dump $time_rsync2), so we need to have time_rsync2 time, doesn't matter if we do rsync2 or not. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
96d59db894evzmigrate: fix rsync2 and disk quota times if quota is offOtherwise we have weird times for 2nd-level quota and second rsync. 2nd level quota: -1.33772e+09 After this patch, 2nd level quota time should be close to zero. Second rsync time in ploop case still needs to be fixed. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Slava DubrovskiyKir KolyshkinSlava Dubrovskiy
150b1cd3df8Fix vzctl and vzlist linking with ld-2.22Get error: libtool: link: i586-alt-linux-gcc -DSBINDIR=\"/usr/sbin\" -DPKGCONFDIR=\"/etc/vz\" -DPKGDATADIR=\"/usr/share/vzctl\" -DPKGLIBDIR=\"/usr/lib/vzctl\" -pipe -Wall -g -O2 -march=i586 -mtune=i686 -fno-strict-aliasing -Wall -Wpointer-arith -Wcast-qual -Winline -Wextra -Wcast-align -Wno-unused-parameter -Wno-missing-field-initializers -D_FILE_OFFSET_BITS=64 -o .libs/vzctl enter.o modules.o ...
Kir KolyshkinKir Kolyshkin
7bc785f65d9vzmigrate: proper rollback for non-live running ploop CT caseIf ploop-copy fails, we do not know if CT was stopped or not, so let's try to start it, ignoring/hiding possible errors. This is similar to commit 592b228, just for non-live migration case. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d80d25b98a8vzmigrate: use ploop-copy for offline migration of running CTTo minimize CT downtime, let's use ploop copy for the case of non-live migration of a running CT. It's pretty similar to live migration, the only difference is we stop CT instead of suspending it. Note we have to use --skip-mount option here (just introduced in commit 8930f16f), otherwise vzctl stop umounts the ploop device and ploop-copy fails. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e0d08fc44d2vzmigrate: put ploop copy code into a functionThis is mostly refactoring. While at it, also - improve code readability by using $dev and $delta variables - add sanity checks for PLOOP_DEV and TOP_DELTA Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c5da7a5f484vzmigrate: fix ploop-copy log messageIt is 'copying' not 'migrating' Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
802e5bce7c1vzmigrate: fix for offline top delta copySince commit 698958cc TOP_DELTA is relative to VE_PRIVATE. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3d513d3cae8vzmigrate: use pv when migrating top delta if possibleLooks nice. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
816f5d17ed9vzmigrate: add --delete-excluded to rsyncWhen migrating a CT with ploop, we add --exclude for top delta image file. The problem is this file can exist on a destination node, and ploop copy will fail. Easiest fix is to add --delete-excluded. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
592b228ee60vzmigrate: hide errors from vzctl chkpnt --restore if ploop-copy failedIn case ploop-copy failed, we do not know if it succeeded in suspending CT or not. In case it did, let's try to restore CT, but ignore/hide errors. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8930f16fb16vzctl stop: add --skip-umount flagThis one is presumably needed for doing ploop copy of top delta for offline (i.e. with stop) CT migration, to minimize CT downtime. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
698958cc2f5vzmigrate: fixed for ploop live migrationThese are mostly fixes/improvements for commit 740ccd4. 1. At the beginning of the script, initialize variables to be empty. 2. get_ploop_info(): fixes to use ${dev} 3. get_ploop_info(): return 1 and do not assign vars if something goes wrong 4. get_ploop_info(): make $TOP_DELTA is relative to $VE_PRIVATE (otherwise if file name is root.hdd rsync excludes the whole private) 5. Check get_plo...
Kir KolyshkinKir Kolyshkin
703aa788a7cvzmigrate(8): document exit code 16Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
5c4b42ee1dfsrc/lib/ub.c: empty line nitpickSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
410d61707besrc/validate.c: an indentation fixSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
740ccd4176cvzmigrate: ploop live migration using ploop-copyThis is an attempt to support live migration of CT on ploop, with the help of ploop-copy utility which uses ploop write tracker feature. ploop copy is only working in ploop > 1.2, thus fix requirements in spec file. http://bugzilla.openvz.org/2252 Reported-by: Paparaciz <helpaz@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
24dcace2a81vzctl(8): one more note that ram/swap default is bytesSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
72f47ac1336vzctl set --ram/--swap: add --forceOne can use --force to override if kernel is vswap-capable. While at it, document the behavior and --force switch in vzctl(8). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
136d65bc0advzctl set --ram/--swap: fixCommit cd8d526 is an epic fail: if you use any suffix the value is 1024 times larger than it should be. Oops. Fix by dividing by _page_size. While at it, round it up to nearest muliple of _page_size. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
434c4548811bash_completion: for vzctl restart offer running CT IDsrestart is same as stop+start, and for stop we only offer running CT IDs, so let's do the same. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
909ee712b5avzctl start: better error msg for vswap config vs non-vswap kernelCommit 09c6269 added check for vswap-enabled kernel when vswap config is to be used during vzctl start. It has been reported in bug #2263 that some people use broken configs (that look like vswap ones) on a non-vswap kernel, so the above commit make their CTs fail to start. Mitigate the breakage a bit by providing more detailed info in error message. Should fix http://bugzilla.openvz.org/2263...
Kir KolyshkinKir Kolyshkin
4c3b67a2669Released vzctl-3.2CHANGES (since vzctl 3.1) New features * vzctl console now accepts tty number argument * vzctl console: add ESC ! to issue SAK * vzlist: show diskspace/diskinodes usage/limit for ploop CTs * vzlist: add more new fields - layout (simfs/ploop) - private/root (to show VE_PRIVATE and VE_ROOT) - features - smart_ctid (CT name if available, otherwise numeric CTID) Fixes * vzctl start: abi...
Kir KolyshkinKir Kolyshkin
3ec6adca5f0vzmigrate: add -vvvv since it makes sense nowUse -vvvv to enable ssh/scp debug. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6978a1cbd5evzctl_env_delete_snapshot(): use GET_SNAPSHOT_XML_TMPSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2251a52c702src/snapshot.c: fix typo in a commentSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c36e34a92afvzctl restore: do not ignore DUMPDIRAfter commit 5fb65baa vzctl restore started ignoring value of DUMPDIR global configuration parameter. Fix it. Reported at http://forum.openvz.org/index.php?t=rview&goto=46169 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
87f59523456vzmigrate: do not use --sparse for ploop CTsShould help fixing bug #2252 (although this is not a complete fix) http://bugzilla.openvz.org/2252 Reported-by: Paparaciz <helpaz@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
197da4255cfvzmigrate: simpler check for ploop CTInstead of executing vzlist we can just check the DiskDescriptor.xml existence. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f9b4480d8cevzmigrate: be silent about disabled quotaCommit f9a2ec8c made vzmigrate skip all vzquota operations for ploop case. It was done by setting DISK_QUOTA=no which is perfectly fine, except for the messages printed by vzmigrate saying "skipping quota migration" (in case -v -v is specified). We could guard those messages by enclosing them in if [ "$PLOOP" != "yes" ]; then ... fi But it's easier just to remove those. Signed-off-by: K...
Kir KolyshkinKir Kolyshkin
2bb2af83fb8vzmigrate: make -vvv add -vv to rsyncPreviously, specifying -v 3 times was used to add -v to ssh/scp. Now with verbosity of 3 we add yet another -v to rsync, so it will show some more information about which files to consider etc. To have ssh/scp print debug output, specify -v four times (or -vv two times etc.) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a72603b8c31vzmigrate: fix ploop checkThis is a fix to commit 3f57d8c. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
bbe4e0bc806vzmigrate(8): describe exit code 15Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3f57d8c3fefvzmigrate: if CT is on ploop, check it is supported on dstOtherwise we will not be able to start CT, no reason to try migrating it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2d36fa0df18vzmigrate(8): describe exit code 14 (OVZ_NOT_RUNNING)Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
5fa6a80d98dvzmigrate.in: fix check for ploop CTPrevious patch left grep spit its match to stdout which we do not want. Also while at it let's add -w for stricter check. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f9a2ec8c403vzmigrate: skip vzquota ops for ploop CTsCheck if container is on ploop, and set in-script DISK_QUOTA=no, effectively skipping all vzquota-related operations. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8dd69cc9989vzlist: fix PRINT_STR_FIELDIt was broken by commit b199f80. A negative value was passed so p_outbuffer was decremented rather than incremented. Before this patch, vzlist could not show fields that go after any of those for which we use PRINT_STR_FIELD. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3a2be3d9998Get rid of setup_resource_management()Just call setup_ub() directly. Note there is no need to call check_ub() before setup_ub() because check_ub() has already been called in vps_start_custom, no need to check twice. vps_run_script() is a separate beast though, let's add check_ub() to it. This also makes the previous commit 09c6269 working, because check_ub() was called from setup_resource_management() which was called from vps_r...
Kir KolyshkinKir Kolyshkin
09c62690241vzctl set --ram/--swap, vzctl start: add checks for vswap-enabled kernelWhen trying to set --ram and --swap, do check that our kernel is vswap-capable. When trying to start container with vswap config, also check the kernel. This simple check should prevent all sorts of confusion and frustration I guess. http://bugzilla.openvz.org/2251 Reported-by: Nils Breunese <nils@lemonbit.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>