3345 Commits

Author SHA1 Message Date
Wei Zhou
c0a0aec0f9 Merge pull request #732 from ustcweizhou/revert-volume-snapshot-master
Guys, can you review it? things need to be discussed:
(1) this supports KVM/QCOW2 only. Anyone want to implement for other Hypervisor/format ?
(2) The original data volume (on primary storage) will be removed.
(3) The script uses the default timeout in libvirtComputingResource. Do we need to add one in global configuration (like copy.volume.wait or backup.snapshot.wait, create.volume.from.snapshot.wait)
(4) In scripts/storage/qcow2/managesnapshot.sh, I use "qemu-img convert -f qcow2 -O qcow2" to copy the snapshot from secondary to primary (hence there is no base image file), instead of "cp -f", this is because convert is faster than cp in my testing.

* pr/732:
  CLOUDSTACK-5863: revert volume snapshot for KVM/QCOW2

Signed-off-by: Wei Zhou <w.zhou@tech.leaseweb.com>
2015-09-01 16:18:40 +02:00
Wei Zhou
312cb877b1 CLOUDSTACK-5863: change response from SuccessResponse to SnapshotResponse 2015-08-28 08:54:11 +02:00
Rajani Karuturi
0680648036 CLOUDSTACK-8647: added cmd and response class for the new api 2015-08-27 17:30:19 +05:30
Rohit Yadav
5f04aa5687 Merge pull request #673 from anshul1886/CLOUDSTACK-8721
CLOUDSTACK-8721: Fixed Setting details of VM through API results in removal of all other details except the one passed in API

* pr/673:
  CLOUDSTACK-8721: Fixed Setting details of VM through API results in removal of all other details except the one passed in API

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 16:08:46 +05:30
Wei Zhou
92344c006d CLOUDSTACK-5863: revert volume snapshot for KVM/QCOW2 2015-08-24 11:01:50 +02:00
radu-stefanache
c7a3ad4dc0 More typos 2015-08-20 13:04:29 +01:00
Rajani Karuturi
e384f2d146 Merge pull request #715 from devdeep/CLOUDSTACK-8687
CLOUDSTACK-8687: Prepare template only on a given storage poolUpdate prepare template api to seed/prepare a template only on a given primary storage. Currently, the prepare template api will seed/prepare a given template on all the primary storage pools in a zone. If however, a user wishes to prepare a template only a particular storage pool, it isn't possible. Updated the api to take storage pool id as an optional parameter. If the pool id is provided then the template is prepared only on the given primary storage pool. Also added unit tests to validate the functionality

* pr/715:
  CLOUDSTACK-8687: Unit tests for validating the prepare template functionality. These tests validate that the templates get scheduled for seeding. Additionally, if a template is already seeded, we do not try and seed it again. Tests also validate that templates are seeded to storage pools which are available.
  CLOUDSTACK-8687: Update prepare template api to seed/prepare a template only on a given primary storage. Currently, the prepare template api will seed/prepare a given template on all the primary storage pools in a zone. If however, a user wishes to prepare a template only a particular storage pool, it isn't possible. Updated the api to take storage pool id as an optional parameter. If the pool id is provided then the template is prepared only on the given primary storage pool

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-08-19 15:58:42 +05:30
Devdeep Singh
adf6b588dd CLOUDSTACK-8687: Update prepare template api to seed/prepare a template
only on a given primary storage. Currently, the prepare template api
will seed/prepare a given template on all the primary storage pools in
a zone. If however, a user wishes to prepare a template only a
particular storage pool, it isn't possible. Updated the api to take
storage pool id as an optional parameter. If the pool id is provided
then the template is prepared only on the given primary storage pool
2015-08-19 10:04:05 +05:30
Boris Schrijver
bb819ca222 Renamed internal variables of NicProfile.java to adhere to the naming convention.
See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.
2015-08-18 14:05:00 +02:00
Boris Schrijver
c30ba1df0b Refactored Nic.java for readability.
Changed methodnames according to Nic.java refactor.

Fixed NicVO.java due to regression from Nic.java refactor.

Fixed VmWareGuru.java after Nic.java refactor.

See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.
2015-08-18 14:04:48 +02:00
Boris Schrijver
5db3371840 Refactored NicProfile.java for readability.
See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.
2015-08-17 14:12:10 +02:00
Remi Bergsma
0fcc7297e0 Merge pull request #680 from borisroman/CLOUDSTACK-8580
Interface changes related to CLOUDSTACK-8580See issue CLOUDSTACK-8580 and individual commits.

* pr/680:
  Made interface changes related to CLOUDSTACK-8580

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-14 11:47:36 +02:00
Boris Schrijver
655fcc924f Made interface changes related to CLOUDSTACK-8580
Added responses to ListCapabilities to reflect CLOUDSTACK-8580 changes.

This to add these options to the gui. See issue CLOUDSTACK-8580.

3be14e978a

Removed comments as proposed by Daan Hoogland.
2015-08-14 11:13:21 +02:00
John Burwell
ef44c7d305 CLOUDSTACK-8566: Strips the username and password credentials from host details
... map returned by the following API calls by filtering these fields from the
details attribute in the HostResponse class:

  * listHosts
  * addHost
  * cancelHostMaintenance
  * listHosts
  * prepareHostForMaintenance
  * reconnectHost
  * updateHost

This fix addresses CVE 2015-3251.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 3a48171bd8a70c6012afce32c7636afffc1d2f7d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-14 10:49:40 +05:30
Boris Schrijver
03f48872d6 CLOUDSTACK-8133 Added Virtualmachine count and ID's to listSecurityGroups response.
See issue CLOUDSTACK-8133 for more information.

Added null check by comment of Koushik Das.

Added brackets by comment of Wido den Hollander.

Removed a call to findById() by comment of Koushik Das.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-08-13 13:47:38 +02:00
Mike Tutkowski
8b0266d12e Merge branch 'pr/547'
* pr/547:
  CLOUDSTACK-8601. VMFS storage added as local storage can be re-added as shared storage. Fail addition of a VMFS shared storage pool in case it has already been added as local storage in CS.

Signed-off-by: Mike Tutkowski <mike.tutkowski@solidfire.com>
2015-08-10 19:00:53 -06:00
Anshul Gangwar
728635a3d3 CLOUDSTACK-8721: Fixed Setting details of VM through API results in removal of all other details except the one passed in API 2015-08-10 16:14:04 +05:30
Daan Hoogland
520e0c8de0 CLOUDSTACK-8656: code in comment removed 2015-07-30 15:52:17 +02:00
Sudhansu
fd17e47e15 BUG-ID: CLOUDSTACK-8483 - Private template not visible in project added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.
Signed-off-by: Pierre-Luc Dion <pdion891@apache.org>
2015-07-26 10:27:48 -04:00
Sudhansu
f8ef13c5e6 BUG-ID: CLOUDSTACK-8483 - Private template not visible in project added new 'projectId' parameter in createTemplate command and based current user, account and projectid decide the owner of the template.
Signed-off-by: Pierre-Luc Dion <pdion891@apache.org>
2015-07-26 10:27:48 -04:00
Boris Schrijver
2984acca83 CLOUDSTACK-8580 Users are now able to view, expunge and recover their vm's themselves. Two configuration options are added to allow this behaviour on a global or per account scale. Configuration options default to false.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #593
2015-07-23 13:59:44 +02:00
Wido den Hollander
8d96aab9b2 CLOUDSTACK-8581: Do not make attributes final and don't set them to null
Signed-off-by: Wido den Hollander <wido@widodh.nl>

This closes #582
2015-07-17 10:07:04 +02:00
Wido den Hollander
178a9f555d CLOUDSTACK-8581: S3, make connection TTL and TCP KeepAlive configureable
Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-07-17 10:07:04 +02:00
wilderrodrigues
984fafce77 CLOUDSTACK-8641 - Adding unit tests
- Making sure that the boolean value is false and also that the updateHostPassword() method gets called.

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

This closes #596
2015-07-16 18:28:27 +05:30
wilderrodrigues
c3c8baf259 CLOUDSTACK-8641 - When calling "update hostpassword" API it throws NPE if the update_passwd_on_host if not informed
- On getUpdatePasswdOnHost() method, if updatePasswdOnHost is null then return false.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-16 18:28:27 +05:30
Rohit Yadav
42940a8828 CLOUDSTACK-8622: Reinstate working sessions in browser
- Login is based on sessionkey HttpOnly Cookie
- ApiServlet does login verification using sessionKey from both the request cookies
  and the API parameters. In both cases, if either or both are passed they should
  match the sessionKey stored in the current session of the HttpRequest
- UI: it no longer needs to read or set sessionkey cookie
- UI: it no longer needs to return g_sessionKey value in the API requests, though
  to support a sso mechanism g_sessionKey is still passed in the API is not null
- Secure jsessionid cookie is set to be HttpOnly and Secure
- SAML login should also set HttpOnly cookie before redirecting to UI
- SAML: listIdps & getSPMetadata APIs are readonly now, won't log out a logged in user

Performed tests (login, saml login if applicable, page refreshes, opening
multiple tabs, logout) with following combinations:
- SAML disabled, normal auth as admin, domain-admin and user
- SAML enabled, normal auth as admin, domain-admin and user; and saml sso as
  admin, domain-admin and user

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

This closes #574
This closes #308
2015-07-10 17:25:07 +05:30
Jayapal
140cd7c227 CLOUDSTACK-8324: Fixed config key in multiple places 2015-07-10 09:47:09 +05:30
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
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
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
Likitha Shetty
13a98dd196 CLOUDSTACK-8601. VMFS storage added as local storage can be re-added as shared storage.
Fail addition of a VMFS shared storage pool in case it has already been added as local storage in CS.
2015-07-01 10:47:36 +05:30
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
03dd34039a Decouple the use of updateHostPassword
- The code was hard to maintain because updating a host or all the hosts in a cluster was handled in the same method
   - Created updateHost and updateCluster password in both ResourceManager and ManagementServer interfaces/classes
   - The chck for whihc method to use is done in the API level
   - Started adding the support for KVM host passwd update

No API changes are needed and it will be backwards compatible.

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:10 +02:00
wilderrodrigues
305ce786e0 Formatting UpdateHostPasswordCmd class
- Needs to be formatted before applying other changes

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:09 +02:00
wilderrodrigues
4e6fd0f17f Formatting the code of the ManagementService class
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-06-29 09:59:09 +02:00
Daan Hoogland
edfe6f4d4f findbugs Boolean return null in getter not in is-query
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #534
2015-06-28 12:41:44 +02:00
Daan Hoogland
f5847147c0 findbugs: serializable fields
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #533
2015-06-26 15:11:16 +02:00
Rene Moser
af902fd9d9 CLOUDSTACK-8578: implement state=present for listing only non-destroyed VMs
So the behavior before this fix can be used in a proper way.

Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #513
2015-06-24 20:21:33 +02:00
Daan Hoogland
55c1d9f3fa findbugs: fields of serializable made serializable
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #522
2015-06-24 20:20:12 +02:00
Rafael da Fonseca
dc40f6117b Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING warning in DeployVMCmd.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #498
2015-06-22 10:47:48 +02:00
Rafael da Fonseca
ae328a6588 Fix 2 findbugs STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE warnings in BaseCmd.java Dateformat objects are not threadsafe and should be defined as instance variables Both INPUT_FORMAT and NEW_INPUT_FORMAT are only used in ParamProcessWorker.java and doesn't makes it more readable to declare in own class
Add missing import statement

Removed extraneous file

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #457
2015-06-15 16:32:30 +02:00
Rafael da Fonseca
d0a494b71b Fix findbugs DM_BOXED_PRIMITIVE_FOR_PARSING in DeployVMCmd.java Was creating Long to assign to long
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #417
2015-06-15 12:09:24 +03:00
Rafael da Fonseca
16baa1289b Remove unused imports to fix checkstyle warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #414
2015-06-15 12:09:19 +03:00
Rafael da Fonseca
9c4162ac7f Fix 2 findbugs ClassCastExceptions getDetails() isn't called anywhere in the code, either way, implementation is wrong since details is a Map\<String, String\> and not a Map\<String, Map\<String,String\>\> If this piece of could would get run, it would just fail trying to cast String to HashMap\<String,String\> Removed nonsense comment about casting a Collection to a Map obviously giving exception
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:09:18 +03:00
Rafael da Fonseca
a7a39a608c Remove unused imports to fix checkstyle warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #413
2015-06-15 12:09:17 +03:00
Rafael da Fonseca
96d6aaa293 Fix findbugs ClassCastException in UpgradeSystemVMCmd.java getDetails() isn't called anywhere in the code, either way, implementation is wrong since details is a Map<String, String> and not a Map<String, Map<String,String>> If this piece of could would get run, it would just fail trying to cast String to HashMap<String,String> in line 83
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:09:16 +03:00
Rafael da Fonseca
8634fe5cf5 Remove unused imports to fix checkstyle warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #412
2015-06-15 12:09:15 +03:00
Rafael da Fonseca
31a4f0ad6b Fix findbugs ClassCastException in ScaleSystemVMCmd.java getDetails() isn't called anywhere in the code, either way, implementation is wrong since details is a Map<String, String> and not a Map<String, Map<String,String>> If this piece of could would get run, it would just fail trying to cast String to Map<String,String>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:09:14 +03:00