OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
1dac99d5e5aReleased vzctl-3.2.1CHANGES (since 3.2) Regressions: * vzctl set --ram/--swap: fix (#2269) Improvements: * vzctl start: better error msg for vswap config vs non-vswap kernel (#2263) THANKS OpenVZ project would like to thank the following people who contributed patches and/or provided bugreports for this vzctl release (in no particular order): * Ilyas * b294615@rtrtr.com Signed-off-by: Kir Kolyshkin <kir@op...
Kir KolyshkinKir Kolyshkin
58812270392vzctl 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
c4df9c7d494vzctl 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. http://bugzilla.openvz.org/2269 Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 136d65bc0)
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>
Kir KolyshkinKir Kolyshkin
a9dbbe3e811Trivial whitespace cleanup1. "if(" -> "if (" 2. "," -> ", " Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b3dd476f155is_image_mounted(): do not forget to free diskdescrFix a couple of minor whitespace nitpicks nearby while at it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6905fc7dbbbIntroduce and use check_ploop_size()As pointed out in bug #2250, sometimes CTs come with DISKSPACE="unlimited", which is effectlively LONG_MAX. We are definitely not able to create a ploop device this big, so let's add a check that it's less than some max value. We have tried to figure out what the value is, and theoretically it seems that it is 2 TB minus 2GB for block map and 1M for some auxiliary data such as header. This va...
Kir KolyshkinKir Kolyshkin
01a392b456fMove inc_rusage() and shift_ubs_param() to where they truly belongThese two functions are only used from inside vzmemcheck.c, so let's - move them there (from validate.c) - mark them as static - remove their prototypes from validate.h Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
94be5ae40a3Mark fill_2quota_param() as static, remove prototypefill_2quota_param() is only used from inside src/lib/res.c, so it makes sense to mark it as static and remove its prototype from res.h. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
62f9173a879Mark get_ub_name() as static, remove prototypeget_ub_name() is only used in ub.c, so it should be marked as static. Also let's remove its prototype from ub.h Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
07e85a77ab1src/lib/snapshot.c: mark free_snapshot_data() as staticSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b79926ed0fcinclude/*.h: remove non-existen function prototypesThose are probably leftovers from the removed or changed code. Found by the following script: for INC in include/*.h; do for f in $(grep -E '^(int|void|char) ' $INC | awk {'print $2;'}| \ sed -e 's/(.*//' -e 's/^*//'); do if ! git --no-pager grep -wq "$f" -- '*.c'; then echo "$INC $f" fi done done Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a8103c1688abuild_cap_str(): do not add quotesLet's add quotes in store_cap() as for other similar functions. Will be required for vzlist -o capabilities Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7b39eba3524build_cap_str(): add 'delim' argumentWill be required for vzlist -o capabilities Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ed8f7419a56build_cap_mask(): allow old_cap to be NULLWill be required for vzlist -o capabilities Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a1b70796bc3src/lib/cap.c: fix build_cap_str() description- Fix a typo - Remove @return since this one returns void - Add len description Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ca3352bc8c8[style] remove NULL checks before free()free(NULL) is perfectly legal, so it doesn't make sense to check. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ec1e37acb40vzctl start: remove upstart/systemd hacks for FedoraThis basically reverts commits 166d66e and 9f1963a. With the modern OpenVZ kernels those hacks are no longer needed, plus Fedora OS templates come with a slightly patched systemd. NOTE that recent RHEL6-based kernel is required to run recent Fedora distros. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
961914f2dabsrc/lib/vzfeatures.c: fix compilation with older headersWhen trying to build vzctl on a CentOS 5 system, got this (see below). The fix is to move #include <linux/vzcalluser.h> to be below the #include "util.h" so that various defines and typedefs won't clash. Aaaand finally, here's the error message: CC vzfeatures.lo In file included from /usr/include/stdlib.h:438, from ../../include/util.h:21, from vz...
Kir KolyshkinKir Kolyshkin
f20083fc1fatypes.h: use standard typedef decl for envid_tSame as done in kernel headers (include/linux/vz*.h) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f8dad00b0eaMove struct log_param definition from logger.h to logger.c- Now we do not need to include <stdio.h> to logger.h - Next thing we see, we do not have this include in enter.c and ub.c - So add it there Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
cbf56633d64Move osrelease-related functions to where they belongCommit f0a858dd introduced support for setting osrelease. Functions used by it are only used in env.c, so let's move them there and make them all static. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ebc544b3fa5vzlist: do not use /proc/bc/resources for non-running CTsFor stopped CTs, UBC parameters should NOT be obtained from /proc/bc/resources. Since /proc/bc/resources do not usually list stopped CTs, this usually never happens. In some rare cases though a container is stopped but for some of its beancounters held value is not zero (such as because of a kernel bug in UBC accounting), and its UBC entry remains. In such a case, values from the proc file sho...
Kir KolyshkinKir Kolyshkin
49c0ece3db8vzlist: introduce and use FOR_ALL_UBC macroThis is mostly to save a few lines of code and make sure that if we ever add a new beancounter it will be easier to add it to vzlist code. Unfortunately we can't use this macro with UBC_FIELD. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f1c6d128c91vzlist: minor refactoring in MERGE_UBCTo not use the break statement (will be needed by the next patch). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c7cb58bd835vzlist: simplify MERGE_UBC macroRemove repeated parameters, similar to commit 1d613c4. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e2e56c33f78vzlist: refactor get_ub()/update_ubc()1. Do not use struct Cveinfo -- there is no need to 2. Only allocate new struct Cubc when it's really needed Number 2 should fix a lot of memory leaks :) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7ab85d9f8cfvzlist: show diskspace/diskinodes usage/limit for ploop CTsWe are using information from /proc/vz/vzquota to show diskspace and diskinodes usage and limits for CTs. Of course, it is not working for ploop-based CTs. So let's use ploop_info() for containers on ploop. Note that, unlike vzquota, it works for stopped CTs as well. BEFORE THIS PATCH: # vzlist -o ctid,layout,status,diskspace,diskspace.h,diskinodes,diskinodes.h -a CTID LAYOUT STATUS ...
Kir KolyshkinKir Kolyshkin
de32e547285vzlist: fix showing disk usage for mounted CTsIn case a container is mounted (and quota is enabled for it), its diskspace/diskinodes usage is well known from /proc/vz/vzquota. But because of status == VE_RUNNING check in PRINT_DQ the usage is now shown. Fix it by replacing the "is running" checking to "is usage==0". Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2290648888dUse PATH_MAX not MAXPATHLENMAXPATHLEN is BSD/Solaris constant, PATH_MAX is SUSv2. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7f6df1e9e44vzlist --help: document -t optionThis is an addition to commit 50991e2 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
81d19541dbfvzlist: nicer formatting for multi-line macrosJust make \ aligned Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1d613c46302vzlist: refactor UPDATE_UBCSimplify it a lot by removing repeating parameters Signed-off-by: Kir Kolyshkin <kir@openvz.org>