31285 Commits

Author SHA1 Message Date
Rohit Yadav
561630e449
router: Fix routing tables for public IP NAT based access (#2579)
This fixes routing table rule setup regression to correctly router
marked packets based on interface related ip route tables. This thereby
fixes the access of VMs in the same VPC using NAT/SNAT public IPs.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-20 15:29:04 +05:30
Nicolas Vazquez
256dd9043d Remove packaging job from pull request template (#2589) 2018-04-20 09:59:38 +02:00
Rohit Yadav
f46518a9be
capacity: remove unused threadpool (#2588)
This removes unused injectables and threadpool.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-20 00:53:57 +05:30
Rohit Yadav
8da2462469
CLOUDSTACK-10333: Secure Live VM Migration for KVM (#2505)
This extends securing of KVM hosts to securing of libvirt on KVM
host as well for TLS enabled live VM migration. To simplify implementation
securing of host implies that both host and libvirtd processes are
secured with management server's CA plugin issued certificates.

Based on whether keystore and certificates files are available at
/etc/cloudstack/agent, the KVM agent determines whether to use TLS or
TCP based uris for live VM migration. It is also enforced that a secured
host will allow live VM migration to/from other secured host, and an
unsecured hosts will allow live VM migration to/from other unsecured
host only.

Post upgrade the KVM agent on startup will expose its security state
(secured detail is sent as true or false) to the managements server that
gets saved in host_details for the host. This host detail can be accesed
via the listHosts response, and in the UI unsecured KVM hosts will show
up with the host state of ‘unsecured’. Further, a button has been added
that allows admins to provision/renew certificates to KVM hosts and can
be used to secure any unsecured KVM host.

The `cloudstack-setup-agent` was modified to accept a new flag `-s`
which will reconfigure libvirtd with following settings:

    listen_tcp=0
    listen_tls=1
    tcp_port="16509"
    tls_port="16514"
    auth_tcp="none"
    auth_tls="none"
    key_file = "/etc/pki/libvirt/private/serverkey.pem"
    cert_file = "/etc/pki/libvirt/servercert.pem"
    ca_file = "/etc/pki/CA/cacert.pem"

For a connected KVM host agent, when the certificate are
renewed/provisioned a background task is scheduled that waits until all
of the agent tasks finish after which libvirt process is restarted and
finally the agent is restarted via AgentShell.

There are no API or DB changes.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-20 00:36:18 +05:30
Rafael Weingärtner
9288c64e5f systemvm: Use double quotes with 'RROUTER' variable in "common.sh" script (#2586)
While debugging the VR for #2579, I noticed that one of the scripts were breaking. The variable RROUTER was not set and this broke a conditional.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-20 00:27:45 +05:30
Rafael Weingärtner
bfe4cb0c41
Fix Python code checkstyle execute by "systemvm\test\runtests.sh" (#2576)
* dependencies update

* Add extra blank line required by ...!?

* fix W605 invalid escape sequence and more blank lines

* print all installed python packages versions
2018-04-18 13:07:37 -03:00
Rohit Yadav
392f62dae0
consoleproxy: use consoleproxy.domain for non-ssl enable env (#2562)
This allows CloudStack to use a console proxy domain instead of public
IP address even when ssl is not enabled but console proxy url/domain
is defined in global settings.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-16 18:12:41 +05:30
Rohit Yadav
156dbf466c agent: Add logging to libvirt qemu hook (#2554)
This allows logging to the default libvirt qemu hook

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-16 13:50:48 +02:00
Nicolas Vazquez
b69c37862c [Vmware] Fix for OVF parsing error (#2567) 2018-04-13 11:19:30 +02:00
Rohit Yadav
e71d4d4371 CLOUDSTACK-10304: turn off apache2 server tokens and signature in systemvms (#2563)
* systemvm: turn off apache2 server tokens and signature

This turns off apache2 server version signature/token in headers.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* systemvm: remove invalid code as conf.d is not available now

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-13 10:44:25 +02:00
Khosrow Moossavi
5d05da21ef Add "Fixes: number" to PR template for auto-closing issues (#2557) 2018-04-12 10:07:00 +02:00
Rohit Yadav
ea33a35297
debian: Use only -l for libvirtd default file on debian (#2550)
This fixes #2546

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-11 14:08:57 +05:30
Rohit Yadav
d588f7d92b ui: Make zonal dashboard larger (#2560)
The host/alert dashboard panels are on the top side, the dashboard
statistics page gets less room. This increases the panel by 100px for
zone dashboard and decreases the host/alert panels by 100px.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-10 21:53:02 -03:00
ernjvr
6b6b3824aa Create database upgrade from 4.11.0.0 to 4.11.1.0 & VMWare version to OS mappings (#2490)
* Create database upgrade from 4.11.0.0 to 4.11.1.0. Add missing VMWare version to OS mapping SQL in the schema-41100to41110.sql.

* add unit test and add 4.11.0.0 entry to _upgradeMap
2018-04-10 10:25:43 +02:00
ernjvr
bb09caf8dc packaging: remove deprecated tomcat based sysconfig file for centos (#2538)
Remove deprecated tomcat configuration file instead of moving it, since moving it prevented the 4.11 upgrade from overwriting it with the new jetty configurations. Also added systemctl daemon-reload to refresh daemon services so that management server can start up seamlessly after the upgrade.

Fixes #2537
2018-04-10 00:31:09 +05:30
dahn
2756d41039
manual mapped ldap fix (#2517)
* translate groovy test for ADLdapUserManagerImpl to java

* fixed by returning the actual result instead of false

* unit test case for manual mapped user in ldap
2018-04-09 17:38:49 +02:00
Rohit Yadav
9cf1532f0e
debian: remove old usage jars during upgrade (#2552)
This removes old cloudstack-usage jars during upgrade as part of
the pre-install step of cloudstack-usage deb package.

This fixes #2542.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-09 17:21:06 +05:30
dahn
cff4032f00
CLOUDSTACK-10287 package require open jdk 1.8 (#2519) 2018-04-02 22:01:41 +00:00
dahn
23ae6762bd
make Broadcast- and IsolationURI visible to admin (#2520) 2018-04-02 21:55:18 +00:00
Rohit Yadav
43f2a28d65 Merge branch '4.10' into 4.11 2018-03-30 16:17:37 +05:30
Rohit Yadav
5dcc3c2c54 Merge branch '4.9' into 4.10
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-30 16:16:11 +05:30
Rohit Yadav
78abb353ac Tagging release 4.9.3.1 on branch robot-tls-fix.
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJas0g9AAoJEEhCSCEO49iEUzIP/3cBrkhQuaGTNA5NEsNuT3ca
 BI6bUkH5Jm0LWGvCxRvg4ZwZgzAO7KUb1CzEqlG/F+YC6PHUMgi+41wcPKdIjKGB
 VXHkmVkHGNUCjXG8YO7cBODA1VsqyFa2NUTe4kJKIlJ6SBJ7amUFEEMgH5nk5oIO
 LlNg9LetNqlTpBTkKVUkkOKVou+nLSoB46SnQ+mmlaT1uwIK8JpCeZQ5KmNsutnX
 mWsiu7T50ItJYrN0ZxEIhDX/7WZhTK1ogkkorNpRbSAHjhjwsaJrhLOdmuXAFHur
 R0zMSshU9U/nOuaOLwSnxmJirKyhuop++ZsOSLKgzHE2cj0bOfdWCdzPapJTpFls
 /DP96Pahu+GyelS2buBhfNDnOL2kdtcyXpwBxGxG3rXnd6bSL3rbLbBhgwQF5XeU
 XEVl0Bwyydo9kycefxrq0DY5I73zBRE3f/6fs+Xz2UNqUWI6QJDL6e/s0IXhZBs+
 JwGrcB1QTDRi3H6SgVM1cb1Ih7d4dIyFgpPSK6EUC9jbl3y9KvlnhiXU3Z9M0lpo
 WDFkeiy0V5MEMR6EusC/b1EeJCFicmnj1azlbwUVaRyUGgY6l8DarwwBHX23fnyW
 exY9STXjNrWWRI3FSTiWorW6i+c+xgZ41uxNDSc2hUejCmDhrpV7TLypRLT4hvYp
 95QU/OSZCw81IVmw1uOD
 =Ql9D
 -----END PGP SIGNATURE-----

Merge tag '4.9.3.1' into 4.9

Tagging release 4.9.3.1 on branch robot-tls-fix.
2018-03-30 16:14:17 +05:30
Mike Tutkowski
e68f5cea67 Only use the host if its Resource State is Enabled. (#2512) 2018-03-29 17:43:22 +00:00
ernjvr
7647e104b2 CLOUDSTACK-10278 idempotent column addition (#2449)
* CLOUDSTACK-10278 - WIP: need to test this script before create a pull request

* CLOUDSTACK-10278 - added more idempotent stored procs and moved all lines, that end with a semicolon in existing proc, onto one line because com/cloud/utils/db/ScriptRunner.java executes the sql as soon as it reads in line with a semicolon delimeter at the end.

* CLOUDSTACK-10278 - changed more sql statements to call idempotent stored procs

* CLOUDSTACK-10278 - WIP: need to test this script before create a pull request

* CLOUDSTACK-10278 - added more idempotent stored procs and moved all lines, that end with a semicolon in existing proc, onto one line because com/cloud/utils/db/ScriptRunner.java executes the sql as soon as it reads in line with a semicolon delimeter at the end.

* CLOUDSTACK-10278 - changed more sql statements to call idempotent stored procs
2018-03-28 11:19:08 +00:00
Rohit Yadav
986ecfa7e9
CLOUDSTACK-10341: Reduce systemvmtemplate size, install nftables (#2506)
This reduces systemvmtemplate size by 600MB and installs nftables,
updates iptables. This also fixes a failing smoke test.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-28 13:11:51 +05:30
Rohit Yadav
48e6989da4
CLOUDSTACK-10227: Fix mkdir path for centos rpms (#2513)
This fixes the mkdir path `/usr/bin` for el6/7 rpms.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-27 22:52:37 +05:30
Khosrow Moossavi
535e6153cc CLOUDSTACK-10232: SystemVMs and VR to run as HVM on XenServer (#2465)
Publishing boot args both to grub and xenstore-data and let
cloud-early-config decides if the VM is in PV or HVM mode
to read from correct source.
2018-03-27 15:48:37 +05:30
Rohit Yadav
c4cc679c3b
CLOUDSTACK-10319: Allow TLSv1, v1.1 for XenServer, Vmware (#2507)
This reverts changes from #2480, instead moves TLS settings to
java ciphers settings config file. It should be sufficient to enforce
TLS v1.2 on public facing CloudStack services:
- CloudStack webserver (Jetty based)
- Apache2 for secondary storage VM
- CPVM HTTPs server

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-26 14:16:49 +05:30
René Moser
c8dcc64b65 CLOUDSTACK-10341: VR minor fixes to systemvmtemplate (#2468)
- Fixes rsyslog: fix config error in rsylslog.conf

Feb 26 08:09:54 r-413-VM liblogging-stdlog[19754]: action '*' treated as ':omusrmsg:*' - please use ':omusrmsg:*' syntax instead, '*' will not be supported in the future [v8.24.0 try http://www.rsyslog.com/e/2184 ]
Feb 26 08:09:54 r-413-VM liblogging-stdlog[19754]: error during parsing file /etc/rsyslog.conf, on or before line 95: warnings occured in file '/etc/rsyslog.conf' around line 95 [v8.24.0 try http://www.rsyslog.com/e/2207 ]

- Run apache2 only after cloud-postinit

- Increase /run size for VR with 256M RAM

root@r-395-VM:~# systemctl daemon-reload
Failed to reload daemon: Refusing to reload, not enough space available on /run/systemd. Currently, 15.8M are free, but a safety buffer of 16.0M is enforced.

tmpfs            23M  6.5M   16M  29% /run
2018-03-23 11:52:29 +05:30
Rohit Yadav
2a068696f8
CLOUDSTACK-10340: Add setter to hypervisorType in VMInstanceVO (#2504)
This adds a missing setter to set hypervisorType in VMInstanceVO.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-23 11:48:13 +05:30
Rohit Yadav
1ee66e0165 Updating pom.xml version numbers for release 4.9.3.1
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
4.9.3.1
2018-03-22 11:37:50 +05:30
Rohit Yadav
d9fb660df9 CLOUDSTACK-10322: Fix Robot Attack upgrade bountycastle
This upgrades bountycasle version v1.59 to fix for robot attack.
In addition, this disables TLSv1.0 as it is deprecated both in
use by management server, agents and in apache2 configs.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-22 11:10:43 +05:30
Nicolas Vazquez
6a75423779 CLOUDSTACK-10231: Asserted fixes for Direct Download on KVM (#2408)
Several fixes addressed:

- Dettach ISO fails when trying to detach a direct download ISO
- Fix for metalink support on SSVM agents (this closes CLOUDSTACK-10238)
- Reinstall VM from bypassed registered template (this closes CLOUDSTACK-10250)
- Fix upload certificate error message even though operation was successful
- Fix metalink download, checksum retry logic and metalink SSVM downloader
2018-03-20 19:24:46 +05:30
Rohit Yadav
1ad04cbc9b
CLOUDSTACK-10330: Add PULL_REQUEST_TEMPLATE (#2489)
This adds a standard pull request template.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-19 11:40:57 +05:30
Rohit Yadav
30175d6879
CLOUDSTACK-10132: Extend support for management servers LB for agents (#2469)
The new CA framework introduced basic support for comma-separated
list of management servers for agent, which makes an external LB
unnecessary.

This extends that feature to implement LB sorting algorithms that
sorts the management server list before they are sent to the agents.
This adds a central intelligence in the management server and adds
additional enhancements to Agent class to be algorithm aware and
have a background mechanism to check/fallback to preferred management
server (assumed as the first in the list). This is support for any
indirect agent such as the KVM, CPVM and SSVM agent, and would
provide support for management server host migration during upgrade
(when instead of in-place, new hosts are used to setup new mgmt server).

This FR introduces two new global settings:

- `indirect.agent.lb.algorithm`: The algorithm for the indirect agent LB.
- `indirect.agent.lb.check.interval`: The preferred host check interval
  for the agent's background task that checks and switches to agent's
  preferred host.

The indirect.agent.lb.algorithm supports following algorithm options:

- static: use the list as provided.
- roundrobin: evenly spreads hosts across management servers based on
  host's id.
- shuffle: (pseudo) randomly sorts the list (not recommended for production).

Any changes to the global settings - `indirect.agent.lb.algorithm` and
`host` does not require restarting of the mangement server(s) and the
agents. A message bus based system dynamically reacts to change in these
global settings and propagates them to all connected agents.

Comma-separated management server list is propagated to agents on
following cases:
- Addition of a host (including ssvm, cpvm systevms).
- Connection or reconnection by the agents to a management server.
- After admin changes the 'host' and/or the
  'indirect.agent.lb.algorithm' global settings.

On the agent side, the 'host' setting is saved in its properties file as:
`host=<comma separated addresses>@<algorithm name>`.

First the agent connects to the management server and sends its current
management server list, which is compared by the management server and
in case of failure a new/update list is sent for the agent to persist.

From the agent's perspective, the first address in the propagated list
will be considered the preferred host. A new background task can be
activated by configuring the `indirect.agent.lb.check.interval` which is
a cluster level global setting from CloudStack and admins can also
override this by configuring the 'host.lb.check.interval' in the
`agent.properties` file.

Every time agent gets a ms-host list and the algorithm, the host specific
background check interval is also sent and it dynamically reconfigures
the background task without need to restart agents.

Note: The 'static' and 'roundrobin' algorithms, strictly checks for the
order as expected by them, however, the 'shuffle' algorithm just checks
for content and not the order of the comma separate ms host addresses.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-15 16:34:03 +05:30
Rohit Yadav
ab0bce2a1b
CLOUDSTACK-10296: Find time different from last timestamp (#2458)
This fixes a difference issue in rVR heartbeat check script raised
recently on dev@.
Reduce logging to avoid logging to fill ramdisk
Make checkrouter return fault state when keepalived is not running

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-15 16:32:18 +05:30
Nicolas Vazquez
74db647dbb CLOUDSTACK-10321: CPU Cap for KVM (#2482) 2018-03-14 18:21:24 +00:00
Raf Smeets
19d6578732 CLOUDSTACK-10303 : Refactor test data to nuage_test_data.py runnable against simulator (#2483)
* Refactored nuage tests

Added simulator support for ConfigDrive
Allow all nuage tests to run against simulator
Refactored nuage tests to remove code duplication

* Move test data from test_data.py to nuage_test_data.py

Nuage test data is now contained in nuage_test_data.py instead of
test_data.py
Removed all nuage test data from nuage_test_data.py

* CLOUD-1252 fixed cleanup of vpc tier network

* Import libVSD into the codebase

* CLOUDSTACK-1253: Volumes are not expunged in simulator

* Fixed some merge issues in test_nuage_vsp_mngd_subnets test

* Implement GetVolumeStatsCommand in Simulator

* Add vspk as marvin nuagevsp dependency, after removing libVSD dependency

* correct libVSD files for license purposes

pep8 pyflakes compliant
2018-03-14 17:17:36 +05:30
Khosrow Moossavi
7112affe19 Bump the version of Debian net-installer to 9.4.0 (#2485) 2018-03-13 09:46:42 +01:00
Rohit Yadav
da8cf8c370
CLOUDSTACK-10319: Prefer TLSv1.2, deprecate TLSv1.0,1.1 (#2480)
This deprecates and remove TLS 1.0 and 1.1 from preferred list of
protocols and keeps only TLSv1.2.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-12 11:43:59 +01:00
Rohit Yadav
c0440e8124 CLOUDSTACK-10317: Fix SNAT rules for additional public nics (#2476)
* CLOUDSTACK-10317: Fix SNAT rules for additional public nics

This allows networks with additional public nics to have correct
SNAT iptables rules applied on configuration.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* update based on Wei's suggested change

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-03-08 10:01:36 +01:00
Nicolas Vazquez
c0b920f740 CLOUDSTACK-10274: L2 network refused to be designed on VXLAN physical network (#2448)
L2 network refused to be designed on VXLAN physical network. Add fix for vxlan issue.
Add condition for L2 networks which do not allow specifying vlan.
2018-03-06 14:56:47 +01:00
Rafael Weingärtner
0bb20a7ed2
Merge pull request #2464 from resmo/fix/4.11/CLOUDSTACK-10299
[4.11] CLOUDSTACK-10299: UI: fix error in network listing in project mode
2018-02-27 12:04:57 -03:00
Rohit Yadav
5c2b8f80f0 CLOUDSTACK-10306: Upgrade to VMware 6.5 vim jar dependency (#2467)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-02-27 12:28:48 +01:00
Sigert Goeminne
3dfbcbc48a CLOUDSTACK-10298: fix for recreation of an earlier deleted Nuage managed network (#2460)
* CLOUDSTACK-10298: Recreation of an earlier deleted Nuage managed isolated or vpc tier network fails

Added negative tests for feature vsd managed subnets
Added fixes for reacreation of an earlier deleted Nuage managed network
Updated Nuage Vsp CloudStack client to 1.0.8
Co-authored by: Sigert Goeminne <sigert.goeminne@nuagenetworks.net>

* removed commented code as per review comment
2018-02-27 12:25:15 +01:00
Rohit Yadav
0ece15f86e Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-02-26 16:57:48 +01:00
Nicolas Vazquez
703054964a CLOUDSTACK-10305: Rare race condition in KVM migration (#2466)
There is a race condition in the monitoring of the migration process on KVM. If the monitor wakes up in the tight window after the migration succeeds, but before the migration thread terminates, the monitor will get a LibvirtException “Domain not found: no domain with matching uuid” when checking on the migration status. This in turn causes CloudStack to sync the VM state to stop, in which it issues a defensive StopCommand to ensure it is correctly synced.

Fix: Prevent LibvirtException: "Domain not found" caused by the call to dm.getInfo()
2018-02-26 15:31:51 +01:00
Rene Moser
2a5459d517 cleanup commented out code 2018-02-26 11:57:44 +01:00
Rafael Weingärtner
cae3292560
Merge pull request #2454 from shapeblue/keystore-utils-sudoer
CLOUDSTACK-10283: Sudo to setup agent keystore, fail on host add failure
2018-02-22 19:44:24 -03:00
Rene Moser
bff7c01f19 CLOUDSTACK-10299: UI: fix error in network listing in project mode 2018-02-20 16:48:23 +01:00