debian-add_ip.sh: ignore comments when looking for venet0When starting a debian container, the /etc/vz/dists/scripts/debian-add_ip.sh
script will do some checks to automatically overwrite debian interfaces
config if the VM is in venet mode.
When we leave some old commented venet configuration in
/etc/network/interfaces, the script will detect it and overwrite it,
even if we don't want to because the network is in veth mode.
Steps to reproduce :
1. ...
[style] vzctl_mount_snapshot(): rm unneeded typecastBoth vzctl_mount_param.guid and ploop_mount_param.guid are of char *
type, so there is no need to do casting here.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Implement nameserver/searchdomain inheritanceNow, if NAMESERVER/--nameserver and/or SEARCHDOMAIN/--searchdomain value
is "inherit", the corresponding setting is taken from host system's
/etc/resolv.conf. That way, a user don't have to do extra configuration
step required for DNS to work inside a container.
Note that per-CT parameters are inherited from the global
/etc/vz/vz.conf, so we set NAMESERVER=inherit in vz.conf and therefore
all ...
ct: fix exec to really enter into pidns (v3)setns() of the pid namespace unlike unsharing of other namespaces
does not take affect immediately. Instead it affects the children
created with fork and clone.
v2: don't forget about the end mark in close_fds
v3: use nice and dandy env_wait()
https://bugzilla.openvz.org/show_bug.cgi?id=2658
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
[build] configure: set localstatedir to w/o prefix/var should be /var, not /usr/local/var or /usr/var.
Currently we work around this by supplying --localstatedir argument
to ./configure in vzctl.spec, but people building/installing from source
have bad paths as a result.
So, use the same trick as we did for sysconfdir in commit 2e95e285.
https://bugzilla.openvz.org/show_bug.cgi?id=2637#c2
Reported-by: hoverhell@gmail.com
Signed-off-by: Kir ...
[build] configure.ac: change indentation... when printing configuration results.
To be used by the next patch.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
[build] fix for automake < 1.10.2If someone wants to build vzctl from git on a RHEL5/CentOS 5 system
(or other similar system having automake < 1.10.2), they will discover
that pkglibexecdir is not set and scripts are installed to /scripts.
We could have said (in configure.ac)
AM_INIT_AUTOMAKE([1.10.2
to require newer automake, but since we are still supporting RHEL5
let's workaround by setting pkglibexecdir manually.
NOT...
vzlist -j: fix to work on RHEL5 kernelvzlist --json is not working on RHEL5 kernel. The problem is caused by
the fact that in JSON mode all the parameters are listed by default, and
in RHEL5 kernel there is no way to get the value of cpus field from the
running container. vzlist should just ignore it, instead it fails.
Fix to skip cpus collection in case it's not available.
https://bugzilla.openvz.org/2661
Reported-by: Pavel Odi...
vzmigrate: add ability to ignore some checksMore preliminary checks were introduced recently to vzmigrate, such as
ipv6 module check (commit 9198710) and cpu capabilities compatibility
check (commit e22c459).
Say, for CPU flags, there is no easy way to find out whether or not
these capabilities are used by applications running in a particular
container -- but if they are, migration will fail. So, to be on the
safe side, vzmigrate is not...
vzmigrate --help: simplify synopsysDon't mention all possible option in synopsys since there are too many
of them.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzmigrate: improve invalid cmdline handingThis patch changes the way vzmigrate reacts to invalid command line.
Now, instead of showing a screen full of options, it just tells what's
wrong with the command line, and gives a hint on where to read about
the correct syntax, so the error is more clear.
Also, if --help, -h, --usage, or -? were given, or no options at all,
it shows usage as before.
Exit code logic is also fixed. When showin...
Fix compilation on arches without support for VZhttps://bugzilla.redhat.com/show_bug.cgi?id=971821
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
scripts/vps-rst: make VE_VETH_DEVS optionalIt is empty in case CT does not have any veth devices.
https://bugzilla.openvz.org/show_bug.cgi?id=2659
[kir@openvz.org: modify var description accordingly]
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
create.c: fix warnings compiling w/o ploopFix these:
> CC create.lo
> create.c: In function 'cleanup_umount_ploop':
> create.c:108:2: warning: implicit declaration of function
> 'vzctl_umount_image' [-Wimplicit-function-declaration]
> create.c: In function 'fs_create':
> create.c:132:37: warning: unused variable 'ploop_ch' [-Wunused-variable]
> create.c: At top level:
> create.c:106:13: warning: 'cleanup_umount_ploop' defined ...
Do enable ploop fsck on start, require ploop 1.8* vzctl.spec: require ploop 1.8
* configure.ac: check for fsck field of appropriate struct
* vzctl_mount_image(): uncomment fsck flag passing to ploop
Basically this enables fsck for inner ploop filesystem on mount,
as it was promised in commit 83aec22.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
etc/vz.conf: comment out NEIGHBOUR_DEVS by defaultThis is a better default with higher chances it will work out of the
box. In case someone needs to limit ARP announces, they can uncomment.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl convert: rename old private back if failedIf the final rename failed, let's try to rename the old one back
and warn a user if we failed.
This is an addition to previous commit, related to bug #2638.
https://bugzilla.openvz.org/2638
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl convert: fix final renamesAt the end of conversion, we used to do:
- remove the old private area
- rename the newly created one to the proper name
All this was done without any error checking, so if removing fails,
then renaming fails as well, and then there's no way to roll back
(because we might have already removed the old private).
Instead, let's do this:
1. Rename old private to temp
2. Rename the new private to...
vzctl_env_convert_ploop(): fix mkdir modeIt should be 0700 not 0600. As a result, a container converted to ploop
had wrong mode:
# ls -ld /vz/private/1031
drw------- 3 root root 4096 Jul 3 03:35 /vz/private/1031
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl_env_convert_ploop: fix a commentThe comment describing what the function does in details was
obsoleted and not up to date. Remove it.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
destroydir: don't return -1vzctl destroy flow is this:
main()
run_action()
destroy()
vps_destroy()
vps_destroy_dir()
destroydir()
and in case destroydir() returns non-zero the value is returned from
main. Therefore, we can't return -1. Use the appropriate VZ_* error
codes.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
scripts/vps-netns_dev_add: rework config actionCommit 4fdbcb5 adds required parameter ACTION to vps-netns_dev_add
script, but ct_netdev_ctl() and ct_ip_ctl() do not set it. That
leads to the following bug:
When trying to start a container with configured `IP_ADDRESS`, it fails
with the subj message ("vps-netns_dev_add ERROR: Missing parameter:
ACTION").
Instead of setting required parameter ACTION, let's just
set optional parameter SKI...
Do not save STOP_TIMEOUT=-1 to configstop_timeout of -1 means "not set" so we should not save
it to config.
This is a fix to previous commit 7ebd103
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
[style] remove a few *CPUUNITS definesWe don't use all these three, defined in two places.
We only use one, so let's leave it and rename to a more
understandable name.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl start: do fsck for ploop, add --skip-fsckThis patch adds
(1) Setting fsck flag for ploop_mount on CT start
(2) Option --skip-fsck for vzctl start command
(together with man page and bash_completion changes)
(3) Using --skip-fsck from init.d/vz script
NOTE that while everything is in place, fsck flag is not actually
passed on to ploop library. It is because the current version
of ploop library released (1.7.1) does not have it ye...
scripts/vps-download: rename to /usr/sbin/vztmpl-dlThis script, while used by vzctl create and bash-completion script,
can also be used directly by users. So let's move it to /usr/sbin
and rename to vztmpl-dl.
Man page will follow.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
scripts/vz-postinstall.in: silent sysctl -pThere may be some parameters in /etc/sysctl.conf which are not
set by this script and are not applicable to the current system.
An example from CentOS 6 system is this one:
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
Let's suppress these errors fro...
Introduce vz-postinstall scriptIn order to make installation easier, let's introduce the script
which will set up /etc/sysctl.conf and /etc/sysconfig/selinux.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Deny "unlimited" value for DISKSPACE/DISKINODESUsing a special value of "unlimited" was intended for user beancounters
parameters only. But since the same parsing functions are used for
diskspace and diskquota parameters, there was an ability to use
"unlimited" for these. This patch disables this.
Using "unlimited" for diskspace and diskinodes is just plain wrong.
For simfs/vzquota based container, the proper way of having unlimited
disk ...
Remove check for ploop sizeRemove check_ploop_size() introduced by commit 6905fc7, letting
ploop library decide what size is supported.
The reason for commit 6905fc7 was some people mistakenly had
'unlimited' as a value for DISKSPACE parameter in config.
The proper fix would be to error out once we see 'unlimited' --
implemented in the next commit.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzmigrate: use remote VZ_PRIVATE and VE_ROOTUse the remote VE_PRIVATE and VE_ROOT default path (vz.conf) for
migration. This is required then VE_PRIVATE and VE_ROOT are different on
source and destination nodes.
[kir@openvz.org: fixed rsync error checking]
https://bugzilla.openvz.org/2523
distscripts: update for newer Arch LinuxI updated vzctl distscripts for Arch Linux to support netctl and tried
to get full backward compatibility for netcfg.
https://bugzilla.openvz.org/2617
vzmigrate: check ipv6 module on destIn case of live migration, if ipv6 module is loaded locally,
it should also be loaded on the destination node.
https://bugzilla.openvz.org/2555
Reported-by: Jim Faulkner <james.faulkner@yale.edu>
Reported-by: Vasily Averin <vvs@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzmigrate: fix check for IPs when there are noneFrom the original bug report:
> vzmigrate fails to migrate VPS when it has no IP addresses. It says IP
> address is already used on destination node, which is not true.
>
> # vzmigrate destination 999
> Starting migration of CT 999 to destination
> Error: IP address(es) already in use on destination node
>
> This worked fine in vzctl 4.2. It is not working in vzctl 4.3.1.
This bug was introdu...