27930 Commits

Author SHA1 Message Date
Ian Southam
b7b54f1680 Fixes to enable test to succeed. Small change to Marvin to be able to override retries
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-08 11:19:12 +02:00
Ian Southam
1a93d700dd New test and fixes for vpcr code in 4.6
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-08 11:19:12 +02:00
nitt10prashant
45781b95b9 CLOUDSTACK-8615 :skip all tests in test_ps_limits.py for lxc
CLOUDSTACK-8615 :skip all tests in test_ps_limits.py for lxc
This closes #565
2015-07-08 11:54:47 +05:30
Daan Hoogland
4ad178e4b1 rats: licenses added
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #535
2015-07-07 13:48:20 +02:00
Daan Hoogland
d8ab5f3ab8 findbugs: equals unit tests
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-07 13:48:19 +02:00
Daan Hoogland
34629446b6 findbugs equals(obj) implementations go against the contract these are removed from the call into separate calls
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-07 13:48:19 +02:00
Daan Hoogland
4bba499412 rats: licenses missing 2015-07-06 17:04:26 +02:00
Daan Hoogland
a71c985223 findbugs: added test for getServiceProvider of CreateVpcOffering api
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #538
2015-07-06 16:22:19 +02:00
Daan Hoogland
e34389a612 findbugs: impossible cast(s) fixed by changing field types
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-07-06 16:22:19 +02:00
Daan Hoogland
31c6b14dd4 Merge branch 'improvement/CLOUDSTACK-8607' change the host password on the host itself via the updateHostPassword API
- Make sure the new password replaces the old one in the queue
    - Updated the patch files for XenServer
    - Updated the script path on LibvirtComputing class
    - Adding update_host_passwd to VRScripts
    - Add implementation to CitrixUpdateHostPasswordCommandWrapper
    - Improve testUpdateHostPasswordCommand() unit test on CitrixRequestWrapperTest
    - Adding update_host_passwd.sh script
    - Adding the host IP address as an instance variable on UpdateHostPasswordCommand
    - Improving the Unit Test (LibvirtComputingResourceTest) to get it covering the new code
    - Make sure doUpdateHostPassword() doesn't get called if flag is set to false
    - Do not update XenServer hosts if the cluster ID is not informed

    This closes #559
2015-07-06 16:15:22 +02:00
wilderrodrigues
e348e76eee CLOUDSTACK-8607 - Improving unit tests
- Adding more unit tests as suggested by Daan and Rajani.
   - Mocking SshHelper and the Script classes, used by Citrix and Libvirt resources respectively.
2015-07-06 14:58:17 +02:00
Rajani Karuturi
f1a64902cc Merge branch 'PR-REVIEW-335'
This closes #335
2015-07-06 11:48:38 +05:30
nitt10prashant
896f6b1e5e CLOUDSTACK-8439:Automation for feature CPU/Memory overcommit
CLOUDSTACK-8439:Automation for feature CPU/Memory overcommit
This closes #226
2015-07-06 09:45:26 +05:30
wilderrodrigues
86297e70be CLOUDSTACK-8607 - Make sure the new password replaces the old one in the queue
- Added log info to show details of the operation
   - Renamed the addPwdToQueue to replaceOldPasswdInQueue
2015-07-04 11:33:52 +02:00
wilderrodrigues
efa34361df CLOUDSTACK-8607 - Changed update script to return exit code based on the result
- Changed location of the update_host_passwd script
   - Updated the patch files for XenServer
   - Updated the script path on LibvirtComputing class
   - Removed the hostIP from the LibvirtUpdateHostPasswordCommandWrapper execute() method
2015-07-03 14:29:57 +02:00
Sudhansu
510fc11319 BUG-ID: CLOUDSTACK-8484 - Hosts without tag are not listed while
listing the hosts for migration for instance with tag
Added marvin test for this issue.
Steps
         1. Create a Compute service offering with the tag.
         2. Create a Guest VM with the compute service offering
            created above.
         3. find hosts to migrate the vm crated above

Validations
         1. Ensure that the offering is created with the
            tag.The listServiceOffering API should list show tag
         2. findHostsForMigration cmd should list both suitable
            and not-suitable hosts
2015-07-03 17:36:54 +05:30
Koushik Das
5d9f851deb CLOUDSTACK-8603: Random list VM failures at scale (more than 1000 VMs) when VM has resource tags There is no 'removed' field on the resource_tags table. So 'id' based search may return a record or null in case record is deleted. Added a check for null or empty in search resource tags based on 'id'.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #551
2015-07-03 15:25:11 +05:30
Kishan Kavala
3a19a8916e BUG-ID:CLOUDSTACK-7472: kvmclock fix for LXC is not required after fixing CLOUDSTACK-8177
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #557
2015-07-03 15:21:18 +05:30
wilderrodrigues
6c92ccf8d1 CLOUDSTACK-8607 - Refactoring attribute name
- Refactoring attribute name from shouldUpdateHost to updatePasswdOnHost
   - Fixing ApiConstants class because it had an error in the constant name
2015-07-03 11:43:56 +02:00
wilderrodrigues
0dd02ce043 CLOUDSTACK-8607 - Adding support to update host passwd on XenServer hypervisors
- Adding update_host_passwd to VRScripts
   - Add accessor method to host password on CitrixResourceBase
   - Add implementation to CitrixUpdateHostPasswordCommandWrapper
   - Improve testUpdateHostPasswordCommand() unit test on CitrixRequestWrapperTest
   - Add line to patch files on xenserver directory

Concerning the LibVirt change:

   - I forgot to assing the return of the getDefaultHypervisorScriptsDir() method to the hypervisorScriptsDir variable
2015-07-03 10:24:44 +02:00
Sudhansu
b593657503 BUG-ID: CLOUDSTACK-8484 - Hosts without tag are not listed while
listing the hosts for migration for instance with tag

While preparing the suitable hosts we are accidentally removing the
incompatible (host does not have host tag) hosts from otherhost list(
incorrect use of List.retainAll).
2015-07-03 11:41:55 +05:30
Koushik Das
f138192c94 CLOUDSTACK-8606: DB performance impacted due to VM sync.
VM sync. generates a lot of queries on vm_instance table with 'instance_name' as filter. Since the field is not
indexed, these kind of queries will impact DB performance. Added an index for instance_name field.

This closes #553
2015-07-03 10:06:48 +05:30
wilderrodrigues
47c7a1083f CLOUDSTACK-8607 - Adding update_host_passwd.sh script
- Modifying the LibvirtUpdateHostPasswordCommandWrapper in order to execute the script on the host
   - Adding the script path to LibvirtComputingResource
   - Adding the host IP address as an instance variable on UpdateHostPasswordCommand
   - Improving the Unit Test (LibvirtComputingResourceTest) to get it covering the new code
2015-07-02 14:54:51 +02:00
wilderrodrigues
a74971df06 CLOUDSTACK-8607 - Adding shouldUpdateHost flag
- Make sure doUpdateHostPassword() doesn't get called if flag is set to false
   - Do not update XenServer hosts if the cluster ID is not informed
2015-07-02 11:12:08 +02:00
wilderrodrigues
96ad6f6ccd CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Change the retry() method to return Answer.createUnsupportedCommandAnswer(command) instead of throwing an exception

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #546
2015-07-01 15:04:58 +02:00
wilderrodrigues
c6013303e9 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Increasing test coverage
     - resource package: 86.7%
     - utils package: 95.1%
     - wrapper package: 97.5%

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:58 +02:00
wilderrodrigues
644458f5ac CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding remaining command wrappers

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:58 +02:00
wilderrodrigues
b54126918b CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding NiciraNvpCreateLogicalRouterCommandWrapper
   - Adding NiciraNvpDeleteLogicalSwitchPortCommandWrapper
   - Adding NiciraNvpFindLogicalSwitchPortCommandWrapper
   - Adding NiciraNvpUpdateLogicalSwitchPortCommandWrapper
   - Decoupling private methods from NiciraNvpResource

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
b4ce81ab6c CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding NiciraNvpDeleteLogicalSwitchPortCommandWrapper

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
361ab5ddbd CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding NiciraNvpCreateLogicalSwitchPortCommandWrapper
   - Removing unsued field from NiciraNvpResourceTest

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
28c1da969d CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding command wrappers NiciraNvpCreateLogicalSwitchCommandWrapper and NiciraNvpDeleteLogicalSwitchCommandWrapper
   - Refactoring the retry mechanism
   - Applying the new retry mechanism to current wrappers and old methods in NiciraNvpResource
   - Adding 2 tests
   - Fixing the testRetries() in NiciraNvpResourceTest class

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:57 +02:00
wilderrodrigues
27c9651b32 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Refactoring NiciraNvpResource
   - Added NiciraNvpUtilities and NiciraNvpCreateLogicalSwitchCommandWrapper
   - Removing 1 execute methods form NiciraNvpResource
   - Added 1 unit test

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
wilderrodrigues
6a51294d19 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Refactoring NiciraNvpResource
   - Added NiciraNvpMaintainCommandWrapper
   - Removing 1 execute methods form NiciraNvpResource
   - Added 1 unit test

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
wilderrodrigues
0d943d5426 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Refactoring NiciraNvpResource
   - Added NiciraNvpRequestWrapper
   - Removing 1 execute methods form NiciraNvpResource
   - Added 1 unit test

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
wilderrodrigues
fc478604e8 CLOUDSTACK-8590 - Refactoring NiciraNVP resource
- Adding the NiciraNvpWrapper
  - This class will keep track of all Wrappers of the Nicira NVP Plugin

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-01 15:04:56 +02:00
Likitha Shetty
9463356ca6 CLOUDSTACK-8600. Upon detaching a disk, delete VM folder if empty.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #545
2015-07-01 14:53:23 +02:00
wilderrodrigues
23c664209a CLOUDSTACK-8180 - RouterVM does no longer provide X-ForwardedFor header with Loadbalancer
- Formatting code

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

CLOUDSTACK-8180 - RouterVM does no longer provide X-ForwardedFor header with Loadbalancer

   - Make sure the "option forwardfor" is always available by not removing it
   - If keepalived is enabled, then set "no option forceclose"

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #549
2015-07-01 14:50:23 +02:00
jeff
93b201d43a Allow custom command role ACL files on classpath in Static Role API Checker.
This commit has a small refactoring of cloud-plugin-acl-static-role-based
to allow it to read files on the classpath that might have a different name
than "commands.properties". It also allows more than one file to be read from.

Rationale: Third-party plugins may want to keep their API command access level
configuration separate from the main file so as to reduce configuration
maintenance work during packaging and deployments.

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

This closes #354
2015-07-01 14:43:29 +02:00
Likitha Shetty
299c07c3e1 CLOUDSTACK-8597. Failed to migrate volume from zone-wide to cluster-wide storage. While live migrating a volume, CS chooses the endpoint to perform the migration by selecting any host that has the storage containing the volume mounted on it. Instead, if the volume is attached to a running VM, the endpoint chosen by CS should be the host that contains the VM.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #541
2015-07-01 12:33:26 +02:00
wilderrodrigues
f72412a80d Merge branch 'fixtravis3' of https://github.com/rsafonseca/cloudstack
This closes #531
2015-07-01 09:12:17 +02:00
Rohit Yadav
02c3d14f6e saml2: Use UTF-8 based charset for encoding bytes to strings
This fixes the fingbug issue DM_DEFAULT_ENCODING found in SAMLUtils

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 17:46:35 +02:00
Rohit Yadav
3ff92e883e database: fix upgrade paths from 4.5.2 to 4.6.0
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 12:58:47 +02:00
Rohit Yadav
107595a6a5 CLOUDSTACK-8457: SAML auth plugin improvements for production usage
* Move config options to SAML plugin
  This moves all configuration options from Config.java to SAML auth manager. This
  allows us to use the config framework.
* Make SAML2UserAuthenticator validate SAML token in httprequest
* Make logout API use ConfigKeys defined in saml auth manager
* Before doing SAML auth, cleanup local states and cookies
* Fix configurations in 4.5.1 to 4.5.2 upgrade path
* Fail if idp has no sso URL defined
* Add a default set of SAML SP cert for testing purposes
  Now to enable and use saml, one needs to do a deploydb-saml after doing a deploydb
* UI remembers login selections, IDP server

- CLOUDSTACK-8458:
    * On UI show dropdown list of discovered IdPs
    * Support SAML Federation, where there may be more than one IdP
        - New datastructure to hold metadata of SP or IdP
        - Recursive processing of IdP metadata
        - Fix login/logout APIs to get new interface and metadata data structure
        - Add org/contact information to metadata
        - Add new API: listIdps that returns list of all discovered IdPs
        - Refactor and cleanup code and tests

- CLOUDSTACK-8459:
    * Add HTTP-POST binding to SP metadata
    * Authn requests must use either HTTP POST/Artifact binding

- CLOUDSTACK-8461:
    * Use unspecified x509 cert as a fallback encryption/signing key
      In case a IDP's metadata does not clearly say if their certificates need to be
      used as signing or encryption and we don't find that, fallback to use the
      unspecified key itself.

- CLOUDSTACK-8462:
    * SAML Auth plugin should not do authorization
      This removes logic to create user if they don't exist. This strictly now
      assumes that users have been already created/imported/authorized by admins.
      As per SAML v2.0 spec section 4.1.2, the SP provider should create authn requests using
      either HTTP POST or HTTP Artifact binding to transfer the message through a
      user agent (browser in our case). The use of HTTP Redirect was one of the reasons
      why this plugin failed to work for some IdP servers that enforce this.
    * Add new User Source
      By reusing the source field, we can find if a user has been SAML enabled or not.
      The limitation is that, once say a user is imported by LDAP and then SAML
      enabled - they won't be able to use LDAP for authentication
    * UI should allow users to pass in domain they want to log into, though it is
      optional and needed only when a user has accounts across domains with same
      username and authorized IDP server
    * SAML users need to be authorized before they can authenticate
        - New column entity to track saml entity id for a user
        - Reusing source column to check if user is saml enabled or not
        - Add new source types, saml2 and saml2disabled
        - New table saml_token to solve the issue of multiple users across domains and
          to enforce security by tracking authn token and checking the samlresponse for
          the tokens
        - Implement API: authorizeSamlSso to enable/disable saml authentication for a
          user
        - Stubs to implement saml token flushing/expiry

- CLOUDSTACK-8463:
    * Use username attribute specified in global setting
      Use username attribute defined by admin from a global setting
      In case of encrypted assertion/attributes:
      - Decrypt them
      - Check signature if provided to check authenticity of message using IdP's
        public key and SP's private key
      - Loop through attributes to find the username

- CLOUDSTACK-8538:
    * Add new global config for SAML request sig algorithm

- CLOUDSTACK-8539:
    * Add metadata refresh timer task and token expiring
        - Fix domain path and save it to saml_tokens
        - Expire hour old saml tokens
        - Refresh metadata based on timer task
        - Fix unit tests

This closes #489

(cherry picked from commit 20ce346f3acb794b08a51841bab2188d426bf7dc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	client/WEB-INF/classes/resources/messages_hu.properties
	plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixCheckHealthCommandWrapper.java
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
	ui/scripts/ui-custom/login.js
2015-06-29 12:31:51 +02:00
wilderrodrigues
527d6ee77b Making possible to update KVM hosts password in the database via the API
- Make sure the doUpdateHostPassword() method returns the result from the answer, not always true
   - Added the LibvirtUpdateHostPasswordCommandWrapper class, which will handle the changes in the KVM agent
     That's will be further implemented in the future. The command will avoid the agent to complain about Unsupported command
   - Added a test to make sure the current implementation of the comment works
     - If changes in the future, it will also require changes. In that way, we make sure nobody will break it

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #527
2015-06-29 09:59:12 +02:00
wilderrodrigues
b8ab3cd3b3 Fix a bug in the doUpdateHostPassword() method
- 2 years ago a change in that method caused an issue when trying to update the hosts password:
    - they would be updated in the databse but not in the host it self, causing the hosts to disconnect after a management server resstart

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:11 +02:00
wilderrodrigues
3367ecc71c Improving exception message
- Adding both ID and UUID of the host

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:11 +02:00
wilderrodrigues
284e2d68e1 In case we cannot update the password of all hosts in a cluster, please stop and notify the user about the failure.
- The host id that failed to get updated will be informed in the error.

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:11 +02:00
wilderrodrigues
ea9db195ed Extracting local variable in order to make the code more readable.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:11 +02:00
wilderrodrigues
4690c3d844 Formatting the code of the AgentManagerImpl class
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:10 +02:00
wilderrodrigues
b6f12984c5 Add supported hypervisors to a list
- By doing so the check is simple and will require less effort when adding other hypervisors.

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:10 +02:00