2187 Commits

Author SHA1 Message Date
Rohit Yadav
7ce54bf7a8 CLOUDSTACK-9993: Securing Agents Communications (#2239)
This introduces a new certificate authority framework that allows
pluggable CA provider implementations to handle certificate operations
around issuance, revocation and propagation. The framework injects
itself to `NioServer` to handle agent connections securely. The
framework adds assumptions in `NioClient` that a keystore if available
with known name `cloud.jks` will be used for SSL negotiations and
handshake.

This includes a default 'root' CA provider plugin which creates its own
self-signed root certificate authority on first run and uses it for
issuance and provisioning of certificate to CloudStack agents such as
the KVM, CPVM and SSVM agents and also for the management server for
peer clustering.

Additional changes and notes:
- Comma separate list of management server IPs can be set to the 'host'
  global setting. Newly provisioned agents (KVM/CPVM/SSVM etc) will get
  radomized comma separated list to which they will attempt connection
  or reconnection in provided order. This removes need of a TCP LB on
  port 8250 (default) of the management server(s).
- All fresh deployment will enforce two-way SSL authentication where
  connecting agents will be required to present certificates issued
  by the 'root' CA plugin.
- Existing environment on upgrade will continue to use one-way SSL
  authentication and connecting agents will not be required to present
  certificates.
- A script `keystore-setup` is responsible for initial keystore setup
  and CSR generation on the agent/hosts.
- A script `keystore-cert-import` is responsible for import provided
  certificate payload to the java keystore file.
- Agent security (keystore, certificates etc) are setup initially using
  SSH, and later provisioning is handled via an existing agent connection
  using command-answers. The supported clients and agents are limited to
  CPVM, SSVM, and KVM agents, and clustered management server (peering).
- Certificate revocation does not revoke an existing agent-mgmt server
  connection, however rejects a revoked certificate used during SSL
  handshake.
- Older `cloudstackmanagement.keystore` is deprecated and will no longer
  be used by mgmt server(s) for SSL negotiations and handshake. New
  keystores will be named `cloud.jks`, any additional SSL certificates
  should not be imported in it for use with tomcat etc. The `cloud.jks`
  keystore is stricly used for agent-server communications.
- Management server keystore are validated and renewed on start up only,
  the validity of them are same as the CA certificates.

New APIs:
- listCaProviders: lists all available CA provider plugins
- listCaCertificate: lists the CA certificate(s)
- issueCertificate: issues X509 client certificate with/without a CSR
- provisionCertificate: provisions certificate to a host
- revokeCertificate: revokes a client certificate using its serial

Global settings for the CA framework:
- ca.framework.provider.plugin: The configured CA provider plugin
- ca.framework.cert.keysize: The key size for certificate generation
- ca.framework.cert.signature.algorithm: The certificate signature algorithm
- ca.framework.cert.validity.period: Certificate validity in days
- ca.framework.cert.automatic.renewal: Certificate auto-renewal setting
- ca.framework.background.task.delay: CA background task delay/interval
- ca.framework.cert.expiry.alert.period: Days to check and alert expiring certificates

Global settings for the default 'root' CA provider:
- ca.plugin.root.private.key: (hidden/encrypted) CA private key
- ca.plugin.root.public.key: (hidden/encrypted) CA public key
- ca.plugin.root.ca.certificate: (hidden/encrypted) CA certificate
- ca.plugin.root.issuer.dn: The CA issue distinguished name
- ca.plugin.root.auth.strictness: Are clients required to present certificates
- ca.plugin.root.allow.expired.cert: Are clients with expired certificates allowed

UI changes:
- Button to download/save the CA certificates.

Misc changes:
- Upgrades bountycastle version and uses newer classes
- Refactors SAMLUtil to use new CertUtils

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-28 12:15:11 +02:00
Daan Hoogland
693d63e7c4 CE-110 remove duplicate-unused functionality 2017-08-25 08:57:51 +02:00
Daan Hoogland
426894411e CE-110 move config to public fields 2017-08-25 08:57:51 +02:00
Nitin Kumar Maharana
1f29313071 CLOUDSTACK-10002: Restart network with cleanup spawns Redundant Routers(In Default Network Offering) (#2186)
The setter name is different from what it should be used by update call.
2017-08-22 22:48:32 +02:00
Rohit Yadav
cc749cca3e Merge branch '4.10' 2017-08-22 10:23:29 +02:00
Rohit Yadav
0f27bc9a7b Merge branch '4.9' into 4.10 2017-08-22 10:23:00 +02:00
Rohit Yadav
310195cbe2 CLOUDSTACK-10052: Simplify dynamic roles enable checking (#2241)
This fixes issue of enabling dynamic roles based on the global setting
only. This also fixes application of the default role/permissions mapping
on upgrade from 4.8 and previous versions to 4.9+.

Previously, it would make additional check to ensure commands.properties
is not in the classpath however this creates confusion for admins who
may skip/skim through the rn/docs and assume that mere changing the
global settings was not enough.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-22 10:22:27 +02:00
sureshanaparti
0c6cf69eee CLOUDSTACK-9717: [VMware] RVRs have mismatching MAC addresses for extra public NICs. (#1878)
Fix: When RVR is enabled and Peer Router is available, get the MAC addresses of the extra public NICs from the Peer Router and set them to the router.
2017-08-21 11:04:20 +02:00
SudharmaJain
b947eca958 CLOUDSTACK-9734: Destroy VM Fails sometimes (#2013) 2017-08-20 14:47:28 +02:00
Nitesh Sarda
d450e1acc0 CLOUDSTACK-9992 : Failed to change cluster to managed state 2017-08-19 14:13:31 +05:30
Nicolas Vazquez
3f330a2199 CLOUDSTACK-10044: Update role permission (#2236)
This feature allows changing permission for existing role permissions, as those were static and could not be changed once created. It also provides the ability to change these permissions in the UI using a drop down menu for each permission rule, in which admin can select ‘Allow’ or ‘Deny’ permission.

Changes in the API:

This feature modifies behaviour of updateRolePermission API method:

New optional parameters ‘ruleid’ and ‘permission’ are introduced, they are mutual exclusive to ‘ruleorder’ parameter. This defines two use cases:
Update role permission: ‘ruleid’ and ‘permission’ parameters needed
Update rules order: ‘ruleorder’ parameter needed
Parameter ‘ruleorder’ is now optional
updateRolePermission providing ‘ruleorder’ parameter should be sent via POST
2017-08-11 12:24:50 +02:00
Rohit Yadav
f84728d374 Merge branch '4.10' 2017-08-10 01:59:34 +02:00
Rohit Yadav
d9b7b8cb62 Merge branch '4.9' into 4.10
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-10 01:39:14 +02:00
Rohit Yadav
542b7e6608 CLOUDSTACK-8958: Fix typos introduced
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-10 01:12:59 +02:00
Wei Zhou
5645164dbb CLOUDSTACK-8958: release dedicated ip range in domain removal 2017-08-10 01:11:51 +02:00
Abhinandan Prateek
d7f5b929b2 CLOUDSTACK-9861: Expire VM snapshots after configured duration (#2026)
Default value of the account level global config vmsnapshot.expire.interval is -1 that conforms to legacy behaviour. A positive value will expire the VM snapshots for the respective account in that many hours.
2017-08-06 00:13:17 +02:00
Rohit Yadav
b204e4a5b9 Merge branch '4.10' 2017-08-04 10:58:59 +02:00
Rohit Yadav
84ad4c7057 Merge branch '4.9' into 4.10 2017-08-04 10:58:21 +02:00
Rohit Yadav
f4a138d251 Revert "CLOUDSTACK-9708: Router deployment failed due to two threads start VR simultaneously." (#2220)
This reverts commit 42e60ebac6f067e003598447ef75d914b7916734 / 9e20525e08d8dae7bcf3d568c5a1ccdb793eeb9d.
2017-08-04 10:57:54 +02:00
SowjanyaPatha
9fe5630c71 CLOUDSTACK-9944: In Cluster Management Server, Sometimes hosts stays in disconnected state (#2138)
In clustered management server setup on simultaneous restart of management server, sometimes hosts stays in disconnected state.
2017-08-03 22:34:23 +02:00
Rohit Yadav
98dc4eb96a CLOUDSTACK-9782: New Background Polling Task Manager (#2218)
CloudStack has several background polling tasks that are spread across
the codebase, the aim of this work is to provide a single manager to
handle submission, execution and handling of background tasks. With
the framework implemented, existing oobm background task has been
refactored to use this manager.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-03 11:53:45 +02:00
Sudharma Jain
96671543dc CLOUDSTACK-9567 Difference in the api call outputs for CAPACITY_TYPE_CPU = 1
(cherry picked from commit 732be53044d0a682bd124a291febc6e11cfde77b)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Priyank Parihar
30bb5587d2 CLOUDSTACK-9610: Disabled Host Keeps Being up status after unmanging cluster.
(cherry picked from commit 4b165f1b8f0781299ba955c8425a32e15869a1d1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Sudhansu
f8f71a5af6 CLOUDSTACK-9694: Unable to limit the Public IPs in VPC
Added missing clause to check for vpc_id

(cherry picked from commit cdf2b0727a653f71c2ea10be1b46d2002f88a2e3)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Sudhansu
4bacb64994 CLOUDSTACK-9842: Unable to map root volume usage to VM
removed code which nullifies  vm_instance_id
Also modified QueryManagerImpl to ignore volume which does not have uuid. This is to avoid duplicate volume listing.

(cherry picked from commit 3cced927c4b1d7e1d8f19bccef46ed8d82e31f41)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
SudharmaJain
af6c28b3ce CLOUDSTACK-8910: The reserved_capacity field increases suddenly after a vmware host failure
In case of vmware host failure, all the VMs including stopped VMs migrate
to the new host. For the Stopped Vms powerhost gets updated. This was
triggering HandlePowerStateReport which finally calls updatePowerState
updating update_time for the VM. This cause the capacity being reserved
for stopped VMs.

(cherry picked from commit 9d268c8cd589f70d41aa737206e7cf4b31007702)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Anshul Gangwar
16b67b40fd CLOUDSTACK-9686: Fixed multiple entires for builtin template in template
store ref table so builtin template is never downloaded completely
 In handleSysTemplateDownload method creating template only if there exists no entry
handleTemplateSync will take care of other scenario

(cherry picked from commit 929595c114f1214f064419a305cc115a3e136803)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Nitin Kumar Maharana
42e60ebac6 CLOUDSTACK-9708: Router deployment failed due to two threads start VR simultaneously.
(cherry picked from commit 9e20525e08d8dae7bcf3d568c5a1ccdb793eeb9d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Anshul Gangwar
9ddbd9eda7 CLOUDSTACK-8833: Fixed Generating url and migrate volume to another storage , resulting two entry in UI and listvolume is not working for that volume
Update the volume id in volume_store_ref table to newly created volume for migration

(cherry picked from commit 42b89278e9386b8bc90e36fb600d7730e676ae72)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Likitha Shetty
f9e51653ae CLOUDSTACK-8829 : Consecutive cold migration fails
(cherry picked from commit 88b0459c41c51e832547667ea537fb9ce9d9f4c1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Anshul Gangwar
e6855db78a CLOUDSTACK-9685: delete snapshot on primary associated with a volume when that volume is deleted
as that snapshot will never be going to use again and also it will fill up primary storage

(cherry picked from commit 336df84f1787de962a67d0a34551f9027303040e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Jayapal
765ab549ca CLOUDSTACK-9208: Assertion Error in VM_POWER_STATE handler- Fixed
(cherry picked from commit d7eae25322155810ba68aa6109978db287459736)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Sudhansu
ad5ec66b0d CLOUDSTACK-9831: Previous pod_id still remains in the vm_instance table after
VM migration with migrateVirtualMachineWithVolume

(cherry picked from commit 3564d30233184161df64e8aaee5ad96917cf8a1d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Wido den Hollander
7c58c37f08 ipv6: Set IPv6 CIDR and Gateway in 'nic' profile
Without this information a NPE might be triggered when starting a VR, SSVM or CP
as this information is read from the 'nics' table and causes a NPE.

During deployment we should set the IPv6 Gateway and CIDR for the NIC object so that
it is persisted to the database.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
(cherry picked from commit f661b631a13ba7f0c501eb5d1915eab3d097a37e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
nvazquez
823d1971a5 Fix for test failure
(cherry picked from commit c66df6e11f766844c4566543eb4b95945b2e7873)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-01 20:40:25 +02:00
Rohit Yadav
be8ae9822d Merge branch '4.10' 2017-07-26 15:19:13 +02:00
Rohit Yadav
c1f30d954b Merge branch '4.9' into 4.10 2017-07-26 15:18:42 +02:00
Wei Zhou
03aca885ae CLOUDSTACK-8186: make setRemoved to null possible 2017-07-26 14:57:23 +02:00
Wei Zhou
960cb84083 CLOUDSTACK-7984: Collect network statistics for VMs on shared network (KVM implementation) 2017-07-23 17:15:23 +02:00
Wei Zhou
088cca2b28 CLOUDSTACK-9997: Add cpu cores information in CapacityResponse
This commit contains following changes
(1) add CPU CORE information in op_host_capacity
(2) add capacity name in the CapacityResponse
(3) add allocatedCapacity for CPU/MEMORY/CPU CORE for zones
(4) sort CapacityResponse by zonename and CapacityType
2017-07-22 11:26:37 +02:00
Nitin Kumar Maharana
e243a31e41 CLOUDSTACK-8672 : NCC Integration with CloudStack.
Improvements.
2017-07-20 12:42:43 +05:30
Nitin Kumar Maharana
b2b422c7d7 CLOUDSTACK-8672 : NCC Integration with CloudStack. 2017-07-20 12:42:43 +05:30
Priyank Parihar
b2f7f9abb6 CLOUDSTACK-8672 : NCC Integration with CloudStack. 2017-07-20 12:42:43 +05:30
Rajesh Battala
884606f77b CLOUDSTACK-8672 : NCC Integration with CloudStack. 2017-07-20 12:42:43 +05:30
dahn
3a70c5cd16 schema: 4.10 to 4.11 upgrade path (#2175)
Add 4.10 to 4.11 upgrade path

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-07-13 15:45:26 +05:30
Rajani Karuturi
4bc7c270fa Updating pom.xml version numbers for release 4.11.0.0-SNAPSHOT
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2017-07-12 12:09:38 +05:30
Rajani Karuturi
4f229d19ad Updating pom.xml version numbers for release 4.10.1.0-SNAPSHOT
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2017-07-10 10:36:24 +05:30
Rajani Karuturi
9d2893d44a Updating pom.xml version numbers for release 4.10.0.0
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2017-07-03 10:06:43 +05:30
Mike Tutkowski
ccb68e13a7
Fix for an issue introduced in this commit: 336df84f1787de962a67d0a34551f9027303040e
(cherry picked from commit c57f556966ab68b5bd91bb0d009a5ae170402e26)

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2017-06-15 16:28:52 +05:30
Rohit Yadav
ed376fcad6 Merge remote-tracking branch 'origin/4.9'
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-06-07 11:21:27 +05:30