]> git.proxmox.com Git - pve-cluster.git/log
pve-cluster.git
6 years agossh_merge_known_hosts: refactor and simplify
Thomas Lamprecht [Thu, 6 Jul 2017 11:19:38 +0000 (13:19 +0200)]
ssh_merge_known_hosts: refactor and simplify

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agossh_merge_known_hosts: address auth failure problem
Thomas Lamprecht [Thu, 6 Jul 2017 11:19:37 +0000 (13:19 +0200)]
ssh_merge_known_hosts: address auth failure problem

On node addition we create two entries in the cluster-wide known_host
file with our public host key, one with the pve-localhost bound IP
address and one with our nodename.

SSH always lower cases hostnames or their aliases before comparing
them to the known host entry. This is allowed as per RFC 1035,
Section "2.3.3 Character Case" [1].
No problems are caused by this, if known_host entries are not hashed,
as both, the original value and the now specified value can be
compared canonically in an case insensitive matter.

But, if a known_host entry is hashed we have no access to its
original plain text value – and we cannot do a case insensitive
comparison anymore. SSH thus expects that the original value was
transformed to lowercase before hashing. We did not follow this
convention when we added node keys to the clusters known_host file as
we kept the case.  This resulted in problems when a user set up nodes
with names containing uppercase letters.[2]

Instead of transforming everything to lowercase on hashing lets omit
hashing known_host entries completely.
To explain why this can be done safely – without security
implications - we need to state the reason why hashing those entries
would gain some security in the first place. It wants to prevent
information leakage for the case an local account gets taken over by
an attacker. If not hashed, the attacker could use the known_host
file to see which other host the user connected to.
This could "just" leak information on what a user does but could also
make it easier to attacked the listed hosts too - e.g. if the user
had an unprotected SSH key which the hosts trust. As there are other
ways to get a list of hosts where an user connected too
(.bash_history, monitoring outgoing traffic, ...) hashing known_host
entries itself provides just a small hurdle of obfuscation in the
case an account got already taken over. And this is the case for an
normal, unprivileged user account.
In the case of PVE hashing the used known_host file brings absolutely
*no* advantage. First, the affected known_host file is located under
/etc/pve/priv where only root has read access. Thus, an attacker
would need to take over root to get the known_hosts in the first
place. If he did take over root all hope is lost one way or another.
Even if known_host was world readable, hashing would not do much.
As and attacker would know that the nodes IPs are entries he could
use /etc/network/interfaces to get the subnet of interest and just
bruteforce all entries until we got all node IPs - he normally would
only need to iterate through 8-16 bit in an IPv4 network.
Even this could be simplified by just port scanning the range for an
open port 8006, to get all PVE nodes in a subnet.
Further /etc/hosts (world readable) often provides the information
which hashing known_hosts tries to hide, as does /etc/pve/.members
(readable by: www-data,root)

So, to summarize, while for an unprivileged user it may add a slight
defense against a information leak it really doesn't for a PVE
systems root/cluster members - all information which it tries to hide
is accessible in various other ways.

Add new entries in plain text, add checks if entries are already
there for the plain text case too. Further use lowercase comparison
as openssh does.
If hashed entries are already there allow them still, but ensure that
a lowercase'd version is saved to avoid authentication failed
problems.

[1]: https://tools.ietf.org/html/rfc1035#section-2.3.3
[2]: https://forum.proxmox.com/threads/35473

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoadd simple corosync config parser self check
Thomas Lamprecht [Mon, 26 Jun 2017 12:10:57 +0000 (14:10 +0200)]
add simple corosync config parser self check

Each test reads and parses a config "writes" it again and then
re-parses it.
Then both the parsed hash structures and the raw config get compared
This is cheap and should catch simple regressions in either the
parser or writer, as currently we have no safety net that
modifications on either one didn't cause regressions.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agobump version to 5.0-10
Dietmar Maurer [Thu, 22 Jun 2017 06:29:49 +0000 (08:29 +0200)]
bump version to 5.0-10

6 years agopvecm delnode: prevent deleting current node
Thomas Lamprecht [Tue, 13 Jun 2017 07:25:34 +0000 (09:25 +0200)]
pvecm delnode: prevent deleting current node

Else corosync really delete himself from the cluster which pmxcfs
cannot really handle and this is a bad idea in general.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agofactor out corosync methods to own module
Thomas Lamprecht [Tue, 13 Jun 2017 07:25:33 +0000 (09:25 +0200)]
factor out corosync methods to own module

PVE::Cluster is already quite big, the corosync part is ~250 lines
long of 1900 total. Further the corosync part is only needed in a few
specialised places (API2/ClusterConfig and CLI/pvecm).
This speaks for factoring out this part in a separate perl module as
most modules which use Cluster load the corosync parts for no reason.
Further, cluster handling through API may even add more corosync
related methods.

Create a new Corosync perl module and move all relevant methods over.
Method names lost the 'corosync_' prefix, not really needed anymore
as they already lives in the 'Corosync' namespace now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agopmxcfs: fix segfault in cfs_create_status_msg
Fabian Grünbichler [Tue, 13 Jun 2017 13:22:05 +0000 (15:22 +0200)]
pmxcfs: fix segfault in cfs_create_status_msg

it's possible to request a status message for a no longer
existing nodename in a standalone setting (e.g., node was
renamed after pmxcfs was started).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoadd sshinfo_to_command_base
Wolfgang Bumiller [Tue, 6 Jun 2017 08:03:57 +0000 (10:03 +0200)]
add sshinfo_to_command_base

required for rsync's --rsh

6 years agomtunnel: add -run-command for insecure pipes
Wolfgang Bumiller [Tue, 30 May 2017 13:30:12 +0000 (15:30 +0200)]
mtunnel: add -run-command for insecure pipes

While we still need ssh to initiate the command, the data
can then be sent insecurely to the IP and port the mtunnel
command tells us to connect to.

6 years agobump version to 5.0-9
Wolfgang Bumiller [Thu, 1 Jun 2017 08:06:10 +0000 (10:06 +0200)]
bump version to 5.0-9

6 years agopmxcfs: don't warn when calling destructors with NULL
Wolfgang Bumiller [Thu, 1 Jun 2017 07:34:34 +0000 (09:34 +0200)]
pmxcfs: don't warn when calling destructors with NULL

Similar to free() & friends, destructors should simply
return in that case.

Fixes a0fce192be37 (pmxcfs: use memdb_tree_entry_free())

6 years agobump version to 5.0-8
Dietmar Maurer [Wed, 31 May 2017 07:11:25 +0000 (09:11 +0200)]
bump version to 5.0-8

6 years agosshinfo: add the network cidr
Wolfgang Bumiller [Tue, 30 May 2017 13:30:11 +0000 (15:30 +0200)]
sshinfo: add the network cidr

6 years agoFix #1383: pmxcfs: use memdb_tree_entry_free()
Wolfgang Bumiller [Tue, 16 May 2017 09:32:41 +0000 (11:32 +0200)]
Fix #1383: pmxcfs: use memdb_tree_entry_free()

Use the right destructor instead of g_free(), as it may
contain another data pointer which needs freeing.

6 years agoCluster.pm: add get_ssh_info and ssh_info_to_command
Wolfgang Bumiller [Mon, 22 May 2017 08:29:58 +0000 (10:29 +0200)]
Cluster.pm: add get_ssh_info and ssh_info_to_command

To get a node's address info optionally inside a specified
network (eg. migration_network), and a standardized way to
create an SSH command from this info.

6 years agoadd replication.cfg to observed files
Dietmar Maurer [Tue, 9 May 2017 10:43:34 +0000 (12:43 +0200)]
add replication.cfg to observed files

7 years agobump version to 5.0-7
Fabian Grünbichler [Mon, 15 May 2017 12:59:15 +0000 (14:59 +0200)]
bump version to 5.0-7

7 years agoRevert "Add storage_replication_network to datacenter.cfg"
Dietmar Maurer [Mon, 8 May 2017 09:33:20 +0000 (11:33 +0200)]
Revert "Add storage_replication_network to datacenter.cfg"

This reverts commit 1341b8fe392c4d3e6cc74e6ba4ff68bc32821195.

We want to use the migration network settings instead.

7 years agopvecm add: fix #1369 - re-allow using hostnames for ringX_addr
Thomas Lamprecht [Tue, 2 May 2017 09:51:22 +0000 (11:51 +0200)]
pvecm add: fix #1369 - re-allow using hostnames for ringX_addr

If an user passed a hostname as ring0_addr or ring1_addr the check_ip
checked failed as it implicitly assumed IPs even if we allowed a
general address (i.e. IP or hostname) as a format for those
properties.

Fixes: #1369
Reported here: https://forum.proxmox.com/threads/34342/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoremote_node_ip: replace fallback method with new PVE::Network helper
Thomas Lamprecht [Tue, 2 May 2017 09:51:21 +0000 (11:51 +0200)]
remote_node_ip: replace fallback method with new PVE::Network helper

Improve code reuse.

Note that the wantarray check exists in the used helper, so the
return signature of remote_node_ip stayed the same here

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoremote_node_ip: use same return signature for both branches
Thomas Lamprecht [Tue, 2 May 2017 09:51:20 +0000 (11:51 +0200)]
remote_node_ip: use same return signature for both branches

We have two return statements in the remote_node_ip submethod, one
checked if we are in list context and adapt the returning values
accordingly and one just returned a list, independent of the
context.
Adapt the second one and check the context there.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agobump version to 5.0-6
Dietmar Maurer [Wed, 3 May 2017 05:42:44 +0000 (07:42 +0200)]
bump version to 5.0-6

7 years agoremove postinst script
Dominik Csapak [Thu, 13 Apr 2017 09:35:04 +0000 (11:35 +0200)]
remove postinst script

we only executed a 'pvecm updatecerts --silent there', but we do this
already in the systemd service in ExecStartPost, so
this is unnecessary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agobump version to 5.0-5
Wolfgang Bumiller [Fri, 28 Apr 2017 11:59:04 +0000 (13:59 +0200)]
bump version to 5.0-5

7 years agoAdd storage_replication_network to datacenter.cfg
Wolfgang Link [Mon, 24 Apr 2017 15:15:24 +0000 (17:15 +0200)]
Add storage_replication_network to datacenter.cfg

This parameter will define the network fore the storage replication.

7 years agofix file permission check in chmod
Dominik Csapak [Fri, 14 Apr 2017 15:07:46 +0000 (17:07 +0200)]
fix file permission check in chmod

since mode_t has additional bits set for file mode (see stat(2) ),
we have to ignore those, or we never can set the mode

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agobump version to 5.0-4
Fabian Grünbichler [Mon, 10 Apr 2017 14:02:15 +0000 (16:02 +0200)]
bump version to 5.0-4

7 years agochange installarchlib to vendorarch
Dominik Csapak [Tue, 4 Apr 2017 12:40:58 +0000 (14:40 +0200)]
change installarchlib to vendorarch

installarchlib is
/usr/lib/<arch>/perl/5.24
which is only a symlink provided by libperl5.24 and not suited
to install files in it directly

vendorarch is
/usr/lib/<arch>/perl5/5.24
which is the correct location for installing arch libraries
(we already use this in librados2-perl)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agoremove autogenerated makefiles
Dominik Csapak [Tue, 4 Apr 2017 12:40:57 +0000 (14:40 +0200)]
remove autogenerated makefiles

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agoimplement chown and chmod for user root group www-data and perm 0640
Stefan Priebe [Tue, 4 Apr 2017 14:43:31 +0000 (16:43 +0200)]
implement chown and chmod for user root group www-data and perm 0640

This allows us to use management software for files inside of /etc/pve.
e.g. saltstack which rely on being able to set uid,gid and chmod

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
7 years agobump version to 5.0-3
Dietmar Maurer [Fri, 17 Mar 2017 10:59:40 +0000 (11:59 +0100)]
bump version to 5.0-3

7 years agorrd_dump: filter undefined values encodes as 'U'
Dietmar Maurer [Fri, 17 Mar 2017 10:58:40 +0000 (11:58 +0100)]
rrd_dump: filter undefined values encodes as 'U'

7 years agobump version to 5.0-2
Fabian Grünbichler [Mon, 13 Mar 2017 12:23:27 +0000 (13:23 +0100)]
bump version to 5.0-2

7 years agobump version to 5.0-1
Fabian Grünbichler [Fri, 10 Mar 2017 12:03:40 +0000 (13:03 +0100)]
bump version to 5.0-1

7 years agobuildsys: update make upload target for stretch
Fabian Grünbichler [Fri, 10 Mar 2017 12:01:39 +0000 (13:01 +0100)]
buildsys: update make upload target for stretch

7 years agoupdate corosync dependencies
Fabian Grünbichler [Fri, 10 Mar 2017 12:00:43 +0000 (13:00 +0100)]
update corosync dependencies

7 years agoRequire Sys.Audit to read the cluster configuration
Emmanuel Kasper [Mon, 6 Mar 2017 10:42:30 +0000 (11:42 +0100)]
Require Sys.Audit to read the cluster configuration

Up to now only root could see the corosync cluster config.

Sys.Audit is the same permission required
for reading the HA Config and the HA Resources Config.

7 years agobuildsys: reformat (build-)depends
Fabian Grünbichler [Tue, 7 Mar 2017 07:40:35 +0000 (08:40 +0100)]
buildsys: reformat (build-)depends

7 years agouse unsigned long for strtoul result
Dominik Csapak [Fri, 3 Mar 2017 08:17:58 +0000 (09:17 +0100)]
use unsigned long for strtoul result

strtoul gives back an unsigned long int, which may or may not be wider
than a guint32 (depending on the platform)

when it is wider, the assignment would parse vmids bigger than 2^32 but
truncate them, giving back an invalid vmid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agobump version to 4.0-49
Dietmar Maurer [Tue, 28 Feb 2017 11:03:30 +0000 (12:03 +0100)]
bump version to 4.0-49

7 years agopvecm add: assert that ringX IPs are available on node add
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:11 +0000 (16:59 +0100)]
pvecm add: assert that ringX IPs are available on node add

If 'ringX_addr' parameters are used on adding a node to a cluster
check if those addresses are actually configured on the to-be-added
node. It makes no sense that the address is not or multiple times
configured.

This prevents a node in limbo, waiting for quorum (if it was the
second node in a cluster, even two node would be in the no-quorum
limbo) where manual pmxcfs kills, local starts and manual
configuration edits which may need to get manually synced to other
cluster members are needed.

The check does not cost much and gets only made on node additions, so
assert with our get_local_ip_from_cidr method that the IP is
configured on any interface.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agopvecm add: report all errors found at once
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:10 +0000 (16:59 +0100)]
pvecm add: report all errors found at once

Else only the first error got reported and we had no idea what else
was possible wrong.

I'll also use the $err method more in next commits

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agopvecm addnode: ensure ring1_addr is set if ring 1 is configured
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:09 +0000 (16:59 +0100)]
pvecm addnode: ensure ring1_addr is set if ring 1 is configured

Else the joining node will not be able to work correctly.
Also improve the respective error messages.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agopvecm addnode: ensure ring address isn't already used by cluster
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:08 +0000 (16:59 +0100)]
pvecm addnode: ensure ring address isn't already used by cluster

If someone enters the wrong address by accident when adding a node it
may cause havoc in the cluster (meaning a reset of the whole cluster
when HA is used, may even happen more often during the recovery
tries. Also a whole lot of problems get triggered in gneral, even
witouth HA).

Further, user get into a hard to repair situation where a layman may
not be able to fix it by hand even when given directions by an
experienced user.

This is a really bad outcome for such a small and easy to make
mistake, so just make a small check and assert that the requested IPs
are not used by any node on any ring in the cluster configuration.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agopvecm addnode: error out on interactive call
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:07 +0000 (16:59 +0100)]
pvecm addnode: error out on interactive call

addnode is thought to be used by the `add` command only.
So check if STDIN or STOUT are connected to a tty and exit with an
error message if this is the case.
The force flag allows overwriting this check.

Fixes bug #294

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agopvecm create: remove rrp_mode parameter
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:06 +0000 (16:59 +0100)]
pvecm create: remove rrp_mode parameter

I detected a bug where we overwrote the whole $interfaces variable
(and so all interfaces from the corosync config) if the 'rrp_mode'
param was set.

While this would be easy to with by changing the line to
$interfaces .= ...
I removed the whole rrp_mode parameter instead.

As:
a) I've seen no one running into this bug, so this parameter was not
   really used either way.
b) only the 'passive' is supported and works, 'active' has a whole
   lot of problems. If someone really wants it he should edit the
   corosync config file to achieve this

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agopvecm: small cleanup
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:05 +0000 (16:59 +0100)]
pvecm: small cleanup

clvm is was used in 3.4 and earlier, it won't come back anytime soon

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agopvecm add: fix check if corosync alread runs
Thomas Lamprecht [Wed, 22 Feb 2017 15:59:04 +0000 (16:59 +0100)]
pvecm add: fix check if corosync alread runs

`corosync-quorumtool` exit with 1 (CS_OK) if corosync runs and is
quorate.
Use `corosync-quorumtool -l` (list nodes) instead, this returns
1 if corosync does not run
0 if corosync runs, independent if a cluster is quorate or not.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoRemove depency to libxml-parser-perl
Emmanuel Kasper [Thu, 16 Feb 2017 15:34:16 +0000 (16:34 +0100)]
Remove depency to libxml-parser-perl

This xml parser was added to parser RHCM cluster.conf, we don't parse this
anymore.

7 years agobuildsys: write control file into build directory
Thomas Lamprecht [Wed, 8 Feb 2017 10:24:55 +0000 (11:24 +0100)]
buildsys: write control file into build directory

Else the first make {deb,dinstall} from a clean repo fails as we
generated the debian control file to the source debian/ folder.
Just write it directly to the build/debian directory, so we do not
clutter the source directory and build always with the up to date
control file.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agobuildsys: don't include autogenerated files
Wolfgang Bumiller [Tue, 7 Feb 2017 09:50:13 +0000 (10:50 +0100)]
buildsys: don't include autogenerated files

they're usually outdated

7 years agobuildsys: remove gthread dependency
Wolfgang Bumiller [Tue, 7 Feb 2017 09:49:49 +0000 (10:49 +0100)]
buildsys: remove gthread dependency

7 years agomake clean: remove *.buildinfo
Wolfgang Bumiller [Tue, 7 Feb 2017 09:46:22 +0000 (10:46 +0100)]
make clean: remove *.buildinfo

7 years agobuildsys: shlibs:Depends finds librrd on its own
Wolfgang Bumiller [Tue, 7 Feb 2017 09:45:06 +0000 (10:45 +0100)]
buildsys: shlibs:Depends finds librrd on its own

On stretch we have librrd8 instead of librrd4.

7 years agobuildsys: generate perlapi dependency version
Wolfgang Bumiller [Fri, 3 Feb 2017 15:37:25 +0000 (16:37 +0100)]
buildsys: generate perlapi dependency version

7 years agobuildsys: depend on lsb-base
Wolfgang Bumiller [Fri, 3 Feb 2017 15:24:46 +0000 (16:24 +0100)]
buildsys: depend on lsb-base

shipping init scripts without this dependency is considered
an error by lintian in stretch

7 years agobuildsys: make perl find the local IPCC.so
Wolfgang Bumiller [Tue, 31 Jan 2017 10:15:20 +0000 (11:15 +0100)]
buildsys: make perl find the local IPCC.so

Otherwise the checks depend on an installed version of the
package.

7 years agobuildsys: missing build dependencies
Wolfgang Bumiller [Fri, 3 Feb 2017 15:15:34 +0000 (16:15 +0100)]
buildsys: missing build dependencies

7 years agobuildsys: make job safety and old svn cruft removal
Wolfgang Bumiller [Fri, 3 Feb 2017 14:31:30 +0000 (15:31 +0100)]
buildsys: make job safety and old svn cruft removal

7 years agoalso update PVE/Makefile.in
Dietmar Maurer [Thu, 19 Jan 2017 08:51:04 +0000 (09:51 +0100)]
also update PVE/Makefile.in

7 years agobump version to 4.0-48
Dietmar Maurer [Tue, 29 Nov 2016 11:00:57 +0000 (12:00 +0100)]
bump version to 4.0-48

7 years agoadd API class for cluster configuration
Dietmar Maurer [Tue, 29 Nov 2016 10:51:38 +0000 (11:51 +0100)]
add API class for cluster configuration

Read-only for now. addnode/delnode implementation will follow.

7 years agomove corosync config helpers to PVE::Cluster
Dietmar Maurer [Tue, 29 Nov 2016 10:21:16 +0000 (11:21 +0100)]
move corosync config helpers to PVE::Cluster

7 years agocleanup: delete trailing whitespace
Dietmar Maurer [Tue, 29 Nov 2016 06:44:46 +0000 (07:44 +0100)]
cleanup: delete trailing whitespace

7 years agoFix #1199: pmxcfs: vmlist cache update condition in rename
Wolfgang Bumiller [Wed, 9 Nov 2016 08:15:56 +0000 (09:15 +0100)]
Fix #1199: pmxcfs: vmlist cache update condition in rename

rename() wrongly used the vmid filled in by
path_contain_vm_config() as a condition for whether to
update the vmlist cache rather than the returned nodename.

This caused a rename in any folder of a file whose name
was a number followed by '.conf' to remove the corresponding
vmid from the vmlist cache.

7 years agopmxcfs: cleanup: remove unnecessary checks before free
Wolfgang Bumiller [Wed, 9 Nov 2016 08:15:55 +0000 (09:15 +0100)]
pmxcfs: cleanup: remove unnecessary checks before free

7 years agopmxcfs: cleanup
Wolfgang Bumiller [Wed, 9 Nov 2016 08:15:54 +0000 (09:15 +0100)]
pmxcfs: cleanup

7 years agonew helper initialize_cert_cache()
Dietmar Maurer [Fri, 25 Nov 2016 06:32:31 +0000 (07:32 +0100)]
new helper initialize_cert_cache()

7 years agomoved x509 certificate cache helpers from pve-manager package
Dietmar Maurer [Fri, 25 Nov 2016 06:24:25 +0000 (07:24 +0100)]
moved x509 certificate cache helpers from pve-manager package

No we depend on libcrypt-ssleay-perl.

7 years agosetup_sshd_config: add start_sshd flag
Dietmar Maurer [Thu, 24 Nov 2016 05:40:17 +0000 (06:40 +0100)]
setup_sshd_config: add start_sshd flag

and call setup_sshd_config within updatecerts.

7 years agopvecm.pm: add space after perl reference operator
Dietmar Maurer [Thu, 24 Nov 2016 05:16:54 +0000 (06:16 +0100)]
pvecm.pm: add space after perl reference operator

Else emacs font lock mode gets confused.

7 years agouse cannot instead of can't
Dietmar Maurer [Thu, 24 Nov 2016 05:12:23 +0000 (06:12 +0100)]
use cannot instead of can't

7 years agoerror out when getting remote ip address fails
Thomas Lamprecht [Fri, 11 Nov 2016 08:03:13 +0000 (09:03 +0100)]
error out when getting remote ip address fails

remove the noerr flag so that we error out when we get multiple IPs
from a CIDR or none at all, the user has to guarantee that his CIDR
matches just one IP on each local host.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoget_local_migration_ip: change to a reasonable error message
Thomas Lamprecht [Fri, 11 Nov 2016 08:03:12 +0000 (09:03 +0100)]
get_local_migration_ip: change to a reasonable error message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoset PERLIB=.. instead of overwriting rules from pve-doc-generator.mk
Dietmar Maurer [Thu, 3 Nov 2016 08:18:15 +0000 (09:18 +0100)]
set PERLIB=.. instead of overwriting rules from pve-doc-generator.mk

7 years agodo not set format_description for migration type property
Dietmar Maurer [Thu, 3 Nov 2016 07:59:38 +0000 (08:59 +0100)]
do not set format_description for migration type property

We want to show possible enum values in the man page.

7 years agoremoved unused script gen-datacenter-pod.pl
Dietmar Maurer [Thu, 3 Nov 2016 07:48:31 +0000 (08:48 +0100)]
removed unused script gen-datacenter-pod.pl

7 years agoMakefile: remove unused RELEASE var
Dietmar Maurer [Thu, 3 Nov 2016 07:41:34 +0000 (08:41 +0100)]
Makefile: remove unused RELEASE var

7 years agobump version to 4.0-47
Dietmar Maurer [Thu, 3 Nov 2016 07:41:01 +0000 (08:41 +0100)]
bump version to 4.0-47

7 years agowrite_datacenter_config: do not overwrite new migration option with old value
Dietmar Maurer [Thu, 3 Nov 2016 07:37:32 +0000 (08:37 +0100)]
write_datacenter_config: do not overwrite new migration option with old value

Just to be sure.

7 years agoadd migration format to datacenter config
Thomas Lamprecht [Mon, 31 Oct 2016 08:42:30 +0000 (09:42 +0100)]
add migration format to datacenter config

This adds a new format for configuring cluster wide migration
settings.
Those settings include the migration transfer method, secure
(currently ssh) or insecure (tcp), this deprecates the
migration_unsecure parameter which we only keep for backward
compatibility and map it to the new property.
The mapping of the setting should be unproblematic for the user as
exactly the same semantics happen.
Only the case where both, new and old are set at the same time is
problematic, here warn the user and ignore the old setting.

Further the migration network can be set, this denotes the network
used for sending the migration traffic.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoadd request for migration ip to mtunnel
Thomas Lamprecht [Fri, 28 Oct 2016 10:11:33 +0000 (12:11 +0200)]
add request for migration ip to mtunnel

reuse mtunnel to allow the migration source side to ask the
migration target side for its dedicated migration IP.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoadd 'mtunnel' to pvecm
Thomas Lamprecht [Fri, 28 Oct 2016 10:11:32 +0000 (12:11 +0200)]
add 'mtunnel' to pvecm

This was copied from the 'qm' CLI tool as it uses no functionality
from qemu server itself and will be used in the abstract migrate
class.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoadd get_local_migration_ip method
Thomas Lamprecht [Fri, 28 Oct 2016 09:53:25 +0000 (11:53 +0200)]
add get_local_migration_ip method

used to get the local IP from the datacenter migration->network
CIDR, if any.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agobump version to 4.0-46
Dietmar Maurer [Tue, 20 Sep 2016 07:36:42 +0000 (09:36 +0200)]
bump version to 4.0-46

7 years agoreload corosync.conf after removing a node
Dietmar Maurer [Tue, 20 Sep 2016 07:34:30 +0000 (09:34 +0200)]
reload corosync.conf after removing a node

origial patch from w.link, rebased on current code

7 years agoFix #1093: allow also delete node by IP
Wolfgang Link [Tue, 6 Sep 2016 09:43:57 +0000 (11:43 +0200)]
Fix #1093: allow also delete node by IP

If there is a second ring or the ring0_addr is set on a IP.
pvecm nodes shows the ip instead the name.
So there is a reason to delete a node also by IP.

7 years agouse new repoman for upload target
Dietmar Maurer [Tue, 13 Sep 2016 04:33:03 +0000 (06:33 +0200)]
use new repoman for upload target

7 years agobump version to 4.0-45
Dietmar Maurer [Tue, 13 Sep 2016 04:30:25 +0000 (06:30 +0200)]
bump version to 4.0-45

7 years agopmxcfs: increase max filesize from 128k to 512k
Thomas Lamprecht [Mon, 12 Sep 2016 15:50:54 +0000 (17:50 +0200)]
pmxcfs: increase max filesize from 128k to 512k

This fixes bug 1014 and also fixes a few other problems where user
ran into the file size limitation, I did not found the bug entries
for them, but they covered:
1) there was a maximum of about <1500 services which could be
   managed by our HA manager, as after that the manager_status file
   got to big

2) firewall rules may also reach this limit on a bigger setup

I tested this with concurrent started read/writes of random data
files from and into RAM (tmpfs mounts), as long as we do not flush
often and read everything at once (i.e. write/read with a big block
size) the performance stays good.

The limiting factor in speed is not corosyncs CPG but sqlite, that
can be seen when comparing worst case scenarios between local pmxcfs
and clustered pmxcfs instances and simple debug logging.

We optimize our sqlite usage quite heavy, relevant additional speed
gains cannot be made without loosing reliability, as far as I've
seen.

So I only got into problems if I read/wrote small blocks
with a few hundred big writes started at once, e.g.
for i in {1..100}
do
    dd if=/tmp/random512k.data of="/etc/pve/data$i" bs=1k &
done

As with the above worst case each block gets written as a single
transaction to the database, where each transaction has to be locked
and synced to disk for reliability.
So packing all changes (i.e. the whole file) into one DB transaction
does not produces much overhead of 512k files compared to 128k files

As data written through the PVE framework is written and read in
such a way we can increase this without seeing much of a
performance impact.

It should be also noted that just because files can now get bigger
not a lot will get that. Rather there may be just one to three files
bigger than 128k on some setups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agobump version to 4.0-44
Wolfgang Bumiller [Fri, 19 Aug 2016 12:52:53 +0000 (14:52 +0200)]
bump version to 4.0-44

7 years agouse g_return_val_fail as cfs_loop_stop_worker returns void
Thomas Lamprecht [Fri, 5 Aug 2016 10:34:04 +0000 (12:34 +0200)]
use g_return_val_fail as cfs_loop_stop_worker returns void

do not use g_return_val_if_fail because the cfs_loop_stop_worker
function does not return anything and newer versions of GCC complain
about that (I used gcc version 5.4.0 20160609 (Debian 5.4.0-6 from
stretch)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agoadd mac_prefix option to datacenter.cfg
Wolfgang Bumiller [Thu, 14 Jul 2016 06:44:29 +0000 (08:44 +0200)]
add mac_prefix option to datacenter.cfg

We allow up to 3 fixed prefix bytes.

7 years agobump version to 4.0-43
Wolfgang Bumiller [Mon, 11 Jul 2016 11:57:55 +0000 (13:57 +0200)]
bump version to 4.0-43

7 years agoensure quorum is set false when corosync fails
Thomas Lamprecht [Thu, 30 Jun 2016 14:35:36 +0000 (16:35 +0200)]
ensure quorum is set false when corosync fails

If corosync directly fails (i.e. `killall corosync`) the local node
acted like it had still quorum, which is not ideal.

Ensure that we set quorate to false before we finalize the quorum.

Do this in:

* service_quorum_dispatch, if it fails it is important that we set
it to false, as there is a good possibility that the
quorum_notification_fn won't get called anymore, reproducible with
$ killall corosync && sleep 0.1 && ls -l /etc/pve/ \
  && systemctl start corosync
Expected behavior: corosync is dead, the ls should show that
everything in /etc/pve is read only
Shown: behavior: /etc/pve still has read/write access and
PVE::Cluster::check_cfs_quorum() still returns true

* service_quorum_initialize: just to be sure as we successfully
  registered the quorum notification function already

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 years agocleanup format strings for cfs_* messages
Thomas Lamprecht [Tue, 24 May 2016 13:55:53 +0000 (15:55 +0200)]
cleanup format strings for cfs_* messages

This does not change semantics on our current target platform
(x86_64) but is needed for porting it to other platforms.

The GCC on ARM, for example, complains about them.

For all:
* size_t use "%z*"
* off_t use "%j*"
* uint64_t use "PRI*64"

where * may be one of (X,d,u).

Also cast guint64 to uint64_t to allow use of a general, portable
format which also supports hex output as the GUINT64_FORMAT allows
decimal output only.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: mir@datanom.net
7 years agobuildsys: add phony deb target, make ${DEBS} non-phony
Wolfgang Bumiller [Tue, 28 Jun 2016 13:11:00 +0000 (15:11 +0200)]
buildsys: add phony deb target, make ${DEBS} non-phony

7 years agobump version to 4.0-42
Dietmar Maurer [Tue, 14 Jun 2016 07:56:35 +0000 (09:56 +0200)]
bump version to 4.0-42

7 years agoFix command line arguments when creating the ssl private key
Emmanuel Kasper [Mon, 13 Jun 2016 14:18:11 +0000 (16:18 +0200)]
Fix command line arguments when creating the ssl private key

A fresh pve-cluster installation on top of Debian would err
because the ssl private key generation failed.

7 years agobump version to 4.0-41
Dietmar Maurer [Fri, 10 Jun 2016 11:06:46 +0000 (13:06 +0200)]
bump version to 4.0-41