OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
c2dfbe01009Released vzctl 4.2Changes: see http://openvz.org/Download/vzctl/4.2/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Nikolay A. FetisovKir KolyshkinNikolay A. Fetisov
9ff3a27acf4etc/dists/scripts/etcnet-{add,del}_ip.sh: IPv6 supportThis adds IPv6 support for etcnet-based containers (i.e. ALT Linux). https://bugzilla.openvz.org/2482 [kir@openvz.org: rm empty lines added by original patch]
Kir KolyshkinKir Kolyshkin
69e8c7b216betc/dists/scripts/postcreate.sh: Fedora 18 supportFor Fedora 18+, we need to set the following caps: /usr/sbin/arping = cap_net_raw+ep /usr/sbin/clockdiff = cap_net_raw+ep /usr/bin/systemd-detect-virt = cap_dac_override,cap_sys_ptrace+ep ALSO NOTE that in Fedora 17+ ping comes with CAP_NET_ADMIN which is needed to use ping -m being non-root. But since CAP_NET_ADMIN is not granted to a container by default, ping with this capability set will ...
Kir KolyshkinKir Kolyshkin
a407cc40ec7vzlist: warn/skip invalid CTIDs in ve.conf filesAs original bug reporter puts in, using a CTID of 12 digits in ve.conf file name results in strange-looking error: # mv /etc/vz/conf/2013020601.conf /etc/vz/conf/201302060101.conf ; mv # /vz/private/2013020601 /vz/private/201302060101; mv # /vz/root/2013020601 /vz/root/201302060101 # vzlist -a Unable to open /etc/vz/conf/-561402811.conf: No such file or directory CTID NPROC STATUS IP_ADD...
Kir KolyshkinKir Kolyshkin
955e600106fvzlist: more strict for cmdline-supplied CTIDsFirst, move the veid check out of 'if' statement, similar to the previous commit aa84f2f for vzctl. Second, check for VEID_MAX as well to filter out invalid CTIDs as early as possible. Related to https://bugzilla.openvz.org/2514 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
aa84f2f0354vzctl: fix check for VEID_MAXCommit af42bbd introduced check for CTID < VEID_MAX. Apparently this check was only performed if CTID supplied was a name, i.e. after name -> CTID conversion. Fix it by moving the check out of if statement. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
fbe8374dfb1vzevent: do umount/mount when rebooting CTApparently in some cases (like NFS mounts invoked by vzctl mount scripts) vzevent should do umount/mount when restarting a container. In general, this is the right thing to do anyway, and this is what vzctl restart does. So, let's add umount to vzevent-reboot. Also, since there is a hack to do reboot of Fedora 17 container in vzevent-stop script, modify it accordingly to do umount before check...
Kir KolyshkinKir Kolyshkin
c2890e9d6e9vzlist -j: fix showing disk usage for stopped CTsIncidentally found this discrepancy between vzlist and vzlist -j: # vzlist 1016 -o diskspace,diskspace.s,diskspace.h,diskinodes,diskinodes.s,diskinodes.h DSPACE DSPACE.S DSPACE.H DINODES DINODES.S DINODES.H 445080 2268740 2268740 25976 144288 144288 # vzlist 1016 -j -o diskspace,diskinodes [ { "diskspace": { "usage": 0, "softlimit...
Kir KolyshkinKir Kolyshkin
b2f673af549vzlist: fix segfault on ploop CT with no DISKINODES setIf a ploop-based CT have no DISKINODES set in its config file (which is perfectly legal), vzlist -o diskspace (or vzlist -j) segfaults: # vzlist 1016 -o diskspace Segmentation fault (core dumped) # vzlist -j 1016 Segmentation fault (core dumped) gdb copy-paste: Program received signal SIGSEGV, Segmentation fault. get_ve_ploop_info (ve=0x64b060) at vzlist.c:1471 1471 ve->quota->disks...
Kir KolyshkinKir Kolyshkin
5f4e1ac399avzctl snapshot-list: fix processing first optionFirst option to snapshot-list were ignored, because getopt_long() starts processing options from argv[1], assuming argv[0] is binary name. To fix, do not increment argv (and decrement argc) when calling run_action(); instead, do this inside run_action when needed. This way if we would add something that uses getopt() we'd be fine. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e90cd9cb314In-container devices: add support for Fedora 18Fedora 18's systemd employs a new scheme for static devices, this patch adds support for it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b70354a9724Use make_static_dev() for creating quota deviceNo need for separate mk_quota_dev() anymore. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
aa6c128fe60Factor out create_static_dev() out of dev_create()Very similar code is used in mk_quota_dev(), so let's factor it out. The next patch will make use of it outside of dev.c scope. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f6fd368d2e9vzctl set --ipadd/ipdel: support for Fedora 18 CTFirst, in F18 ifconfig is not included by default, so we (finally) use ip instead. Second, it doesn't like having 127.0.0.1 on venet0, the simplest way to make it like it is to have ARPCHECK="no" in ifcfg-venet0 file. Slightly tested here and there, looks like it works. Heavily based on patch by Konstantin Volkov <wolf@parallels.com>, with all the bugs added by me. Signed-off-by: Kir Kolysh...
Kir KolyshkinKir Kolyshkin
a4289f17baavzctl snapshot-list: do not return 11. Introduce VZCTL_E_SNAPSHOT_LIST exit code, use it and document it in vzctl(8). 2. Use more generic exit codes where possible in vzctl_env_snapshot_list() and friends. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
411bcfc52e8vzctl snapshot-list: check if snapshot is supportedRather than presenting empty snapshot list, bail out with an error, or crash, check that 1 the container is ploop-based 2 ploop is supported Crash would happen if ploop library is not avaialble, because vzctl_env_snapshot_list() now calls ploop functions. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e1d90d5b5afFix vzctl enter/exec to upstream containerTesting vzctl enter on 3.8rc3 kernel, got this: # uname -a Linux kirpad 3.8.0-0.rc3.git0.1.fc19.x86_64 #1 SMP Thu Jan 10 21:09:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux # vzctl start 101 Directory /proc/vz not found, assuming non-OpenVZ kernel Starting container... Container is mounted Container start in progress... # vzctl enter 101 Directory /proc/vz not found, assuming non-OpenV...
Kir KolyshkinKir Kolyshkin
8fd947a0abbscripts/.gitignore: add vps-netns_dev_{add,del}Commit c6f7199 adds these two, and they are generated from .in files so should be mentioned in .gitignore Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1df15f1a7dfvzctl.spec: add buildroot rm to %installAs per http://fedoraproject.org/wiki/EPEL/GuidelinesAndPolicies#Prepping_BuildRoot_For_.25install Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3b72d815938vzctl snapshot-list: make it workingCommit 9a4a853 added a new implementation of snapshot-list, with command-line options processed directly by vzctl_env_snapshot_list(). For that to work, we need to skip options processing in parse_action_opt(), this is what this patch does. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3e26e4cd4d0man/*: correct path to scriptsCommit d3c8b95 moved scripts from /usr/lib[64] to /usr/libexec. Fix man pages accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
19e6a3ac921init.d/vz-redhat: stop vz earlierAs it nicely laid out by the bug reporter: > I noticed after rebooting one of our hardware nodes the other day that > all of the 'sshd' processes in the VPSes had disappeared. It turns out > this is related to the new "suspend/restore" feature added in vzctl 4.1, > and also to the /etc/init.d/sshd script shipped in CentOS. > > The sshd init script in CentOS contains the following in its "stop"...
Kir KolyshkinKir Kolyshkin
2fc34ffb5f5init.d/vz-gentoo: don't call tools by absolute pathApparently in recent Gentoo the ip tool was moved from /sbin to /bin, so this initscript stopped working. Apparently runscript makes sure all the needed directories are in PATH (I have tested with runscript from baselayout-1.12.11.1, pretty old one) so we can just drop the /sbin/ prefix. While at it, do it not only for ip, but also for modprobe and sysctl. http://bugzilla.openvz.org/2477 htt...
Kir KolyshkinKir Kolyshkin
9a4a85397f7vzctl snapshot-list: re-implementThis is a new implementation of snapshot-list, with configurable fields etc. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ab356332eaavzctl(8): add missing CTID to SYNOPSYSIt was absent from a few places. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6d2838d0f4dimage.c: add generate_snapshot_component_name()Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9c42bc5fcd2list.h: add LIST_HEAD macro to declare and init listSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
506d89ad009util.c: introduce vzctl_get_normalized_guid()The code was already there in conf_parse_guid(), so just extract it and move to util.c. To be used by a following patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9ebcf4a2a84Remove old snapshot-list codeTo be replaced by a new implementation by a following patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
40aa74ca341Move snapshot-related macros to snapshot.hThey will be used by a later patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
11167404685vzctl: do now warn about VE_STOP_MODEvzctl --verbose usually complains about unknown parameters in global configuration file, which sometimes help to discover issues like typos in parameter names. Like this: > Warning at /etc/vz/vz.conf:6: unknown parameter VE_STOP_MODE ("stop"), > ignored To prevent false positives, there is a list of well-known parameters which are not used by vzctl itself (see more details in commit de8b7f6)....
Dustin LundquistKir KolyshkinDustin Lundquist
adff613328bFix extra arguments parsing by add-on modulesModule argument behavior changed with commit 772715b1, prior to this any arguments which were not defined in set_opt[] was passed to mod_parse(). After this commit the entire list of available options is passed down to vps_parse_opt() which then attempts to parse them all with parse() including additional arguments introduced by the module. Fix this by passing the internally available argument...
Kir KolyshkinKir Kolyshkin
658010cfa91load_ploop_lib(): prevent buffer overflowvzctl can be compiled with an old version of ploop library headers, so size of struct ploop_functions might be smaller than the one of the currently installed library, causing a buffer overflow in ploop_resolve_functions() leading to all sorts of funny effects. While it's indeed an issue with ploop_resolve_functions() design, let's workaround it here by providing a safety bag. Signed-off-by: ...
Kir KolyshkinKir Kolyshkin
853fe09566dsrc/lib/image.c: don't init static objectThere is no need to, it is zeroed anyway. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9756abe091dvz_chroot(): fix off-by-one in sigaction() argumentAccording to bits/signum.h, NSIG is the biggest signal number + 1, so fix the for() loop accordingly. Found while using valgrind: ==775013== Warning: bad signal number 65 in sigaction() Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d416e4ad90cvzubc: fix -w/-c checkArguments -w|--watch and -c|--color can't be used together, so there is a check for that. The problem is if -c stays before -w on the command line, this check wouldn't work. So move the check to after argument parsing. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
53a08a23701vzubc: remove check for watch presenseFirst, it was only performed for -w|--watch and was not performed for -wd and -wt. Second, "watch not found" error will be found and printed later by exec anyway, so why bother? Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a74b8f5ab80vzubc: add -wt option (add -t to invoked watch)> Please, add -wt option to vzubc (correspondind -t option for watch(1)). http://bugzilla.openvz.org/2474 Reported-by: Evgenii Terechkov <evg@altlinux.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
82e76523cc5etc/init.d: move VZREBOOTDIR to vz-redhatVZREBOOT declaration should be right here in vz-redhat script not in initd-functions. initd-functions is a compatibility layer for Debian and Red Hat systems, it contains everything that is different between Deb and RH, such as VARLOCK location. This is a fix to commit af5bf43. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9e84e33023aetc/init.d/vz-gentoo: fix missing VZREBOOTDIRThat was pretty lame from my side. Fix for commit af5bf43. http://bugzilla.openvz.org/2467 Reported-by: Andrei Vinogradov <spamslepnoga@inbox.ru> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Glauber CostaKir KolyshkinGlauber Costa
19fea083b02configure: 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
74cdb9b546fetc/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>
Kir KolyshkinKir Kolyshkin
5949e80b97dinit.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
1c9388df700vzlist: 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>
Glauber CostaKir KolyshkinGlauber Costa
8fec4357ce5allow 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>
Glauber CostaKir KolyshkinGlauber Costa
9c9c0658eccdon't compile hooks_vz.c if vz-kernel support is not enabled.Signed-off-by: Glauber Costa <glommer@parallels.com>
Glauber CostaKir KolyshkinGlauber Costa
d335c6d2a34don'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
c9d9170b0a3provide 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.com>
Glauber CostaKir KolyshkinGlauber Costa
622295b0ec8vz_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>
Glauber CostaKir KolyshkinGlauber Costa
47d04738e98configure: 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...