Commit Graph

3169 Commits

Author SHA1 Message Date
Rohit Yadav 8f3cd943b1 APPLE-333: Oobm plugin for nested-cloudstack environments
This implements an out-of-band management plugin for nested-cloudstack
environments where the hypervisor host is a VM in a parent CloudStack environment
that is used as a host in the (testing) CloudStack environment. This plugin
allows power operations to translate into start/stop/reboot of the VM (host).

The out-of-band management configuration accepted are:
- Address: The API URL of the parent CloudStack enviroment
- Port: The uuid of the (host) VM in the parent CloudStack environment
- Username: The apikey of the user account who has ownership on the (host) VM
- Password: The secretkey of the user account who has ownership on the (host) VM

Note: change password of the oobm interface is not support by this plugin

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-04-19 16:58:38 +05:30
Abhinandan Prateek 4991d165f3 FR-17: KVM, Xen and VMware support + UI with Marvin test 2017-03-27 09:53:40 +05:30
Rohit Yadav a00cb07ee0 APPLE-328: Metrics View APIs
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-02-16 13:20:30 +05:30
Rohit Yadav 876fc7434d APPLE-165: Host HA management and HA provider for KVM
Host-HA offers investigation, fencing and recovery mechanisms for host that for
any reason are malfunctioning. It uses Activity and Health checks to determine
current host state based on which it may degrade a host or try to recover it. On
failing to recover it, it may try to fence the host.

The core feature is implemented in a hypervisor agnostic way, with two separate
implementations of the driver/provider for Simulator and KVM hypervisors. The
framework also allows for implementation of other hypervisor specific provider
implementation in future.

The Host-HA provider implementation for KVM hypervisor uses the out-of-band
management sub-system to issue IPMI calls to reset (recover) or poweroff (fence)
a host.

The Host-HA provider implementation for Simulator provides a means of testing
and validating the core framework implementation.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-01-18 18:18:53 +05:30
Rohit Yadav bb0282dfa1 CLOUDSTACK-9299: Incorporate out-of-band management PR changes
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-10 14:12:10 +05:30
Rohit Yadav a5de2714e9 CLOUDSTACK-9299: Out-of-band Management for CloudStack
Support access to a host’s out-of-band management interface (e.g. IPMI, iLO,
DRAC, etc.) to manage host power operations (on/off etc.) and querying current
power state in CloudStack.

Given the wide range of out-of-band management interfaces such as iLO and iDRA,
the service implementation allows for development of separate drivers as plugins.
This feature comes with a ipmitool based driver that uses the
ipmitool (http://linux.die.net/man/1/ipmitool) to communicate with any
out-of-band management interface that support IPMI 2.0.

This feature allows following common use-cases:
- Restarting stalled/failed hosts
- Powering off under-utilised hosts
- Powering on hosts for provisioning or to increase capacity
- Allowing system administrators to see the current power state of the host

For testing this feature `ipmisim` can be used:
https://pypi.python.org/pypi/ipmisim

FS:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Out-of-band+Management+for+CloudStack

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-10 13:16:03 +05:30
Rohit Yadav 6f1e834753 CLOUDSTACK-8562: Make role permissions orderable
- Makes role permissions orderable in UI/backend
- Role permissions evaluated by fixed order
- Rules draggable in UI
- Migration script adds a default order

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-09 10:53:45 +05:30
Rohit Yadav 9d8b1fd7e5 CLOUDSTACK-8562: Make role permissions orderable
- Makes role permissions orderable in UI/backend
- Role permissions evaluated by fixed order
- Rules draggable in UI
- Migration script adds a default order

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-03 23:00:46 +05:30
Rohit Yadav f30c52a16c CLOUDSTACK-8562: DB-Backed Dynamic Role Based API Access Checker
This feature allows root administrators to define new roles and associate API
permissions to them.

A limited form of role-based access control for the CloudStack management server
API is provided through a properties file, commands.properties, embedded in the
WAR distribution. Therefore, customizing API permissions requires unpacking the
distribution and modifying this file consistently on all servers. The old system
also does not permit the specification of additional roles.

FS:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Dynamic+Role+Based+API+Access+Checker+for+CloudStack

DB-Backed Dynamic Role Based API Access Checker for CloudStack brings following
changes, features and use-cases:
- Moves the API access definitions from commands.properties to the mgmt server DB
- Allows defining custom roles (such as a read-only ROOT admin) beyond the
  current set of four (4) roles
- All roles will resolve to one of the four known roles types (Admin, Resource
  Admin, Domain Admin and User) which maintains this association by requiring
  all new defined roles to specify a role type.
- Allows changes to roles and API permissions per role at runtime including additions or
  removal of roles and/or modifications of permissions, without the need
  of restarting management server(s)

Upgrade/installation notes:
- The feature will be enabled by default for new installations, existing
  deployments will continue to use the older static role based api access checker
  with an option to enable this feature
- During fresh installation or upgrade, the upgrade paths will add four default
  roles based on the four default role types
- For ease of migration, at the time of upgrade commands.properties will be used
  to add existing set of permissions to the default roles. cloud.account
  will have a new role_id column which will be populated based on default roles
  as well

Dynamic-roles migration tool: scripts/util/migrate-dynamicroles.py
- Allows admins to migrate to the dynamic role based checker at a future date
- Performs a harder one-way migrate and update
- Migrates rules from existing commands.properties file into db and deprecates it
- Enables an internal hidden switch to enable dynamic role based checker feature

Deprecate commands.properties

- Fixes apidocs and marvin to be independent of commands.properties usage
- Removes bundling of commands.properties in deb/rpm packaging
- Removes file references across codebase

Reviewed-by: John Burwell <john.burwell@shapeblue.com>
QA-by: Boris Stoyanov <boris.stoyanov@shapeblue.com>

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-25 14:52:02 +05:30
Rohit Yadav 938f1d2a7d CLOUDSTACK-9020: Metrics views for CloudStack UI
Implements following:
- A metrics table widget that is:
  - vertically and horizontally scrollable with pagination/infinite scrolling
  - sortable columns (client side)
  - groupable/collapsible columns
  - alternate row coloring
  - refresh button to refresh views
  - threshold table cell coloring
  - panel/breadcrumb navigation
  - quick view action column
  - translatable labels
- Sortable column for all CloudStack tables (client side)
- Configurable UI pagesize for list API calls, 'default.ui.page.size'
- Metrics views: Zones, Clusters, Hosts, Instances, Storage pools, Volumes
- Resource filtering/navigation: Zones->Clusters->Hosts->Instances->Volumes, Storage Pool->Volumes

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-01-20 12:54:06 +01:00
Rohit Yadav a4f552d46d cloudstack: set next version to 4.5.3-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-09-14 09:59:40 +05:30
Rohit Yadav 7385441807 Updating pom.xml version numbers for release 4.5.2
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-19 14:42:54 +05:30
John Burwell 3a48171bd8 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>
2015-08-14 10:49:28 +05:30
Rohit Yadav 17366f2b18 CLOUDSTACK-8301: Enable configuring local storage use for system VMs at zone level
Backported from #263 for 4.5 branch, original bugfix by @koushik-das et al

More information on:
https://issues.apache.org/jira/browse/CLOUDSTACK-8301
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Enable+configuring+local+storage+use+for+system+VMs+at+zone+level

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

This closes #661
2015-08-08 22:41:52 +05:30
Rohit Yadav 12edad3e20 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:27:34 +05:30
Rohit Yadav 20ce346f3a 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

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

This closes #489
2015-06-29 12:25:02 +02:00
René Moser 00fffbe081 template, api: fix format desc, add OVA format
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #331

(cherry picked from commit 666263e84d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-29 21:02:30 +02:00
Milamber 8eafdbd224 CLOUDSTACK-6181 Specify GB for the value of rootdisksize parameter. Add some Bytes/GB for log or exception messages. Fix Gb->GB. 2015-05-23 18:53:18 +01:00
Rohit Yadav 9e9b231672 CLOUDSTACK-8505: Don't allow non-POST requests for default login API
We add a new contract to pass Http request to authentication plugin system. In
the default login API, we disallow non-POST requests.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-22 10:11:15 +01:00
Rene Moser fd97705f83 listPortForwardingRules: fix typo in doc
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #248

(cherry picked from commit e8f8e0e3f2)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-13 15:44:13 +02:00
Daan Hoogland 06de2d6292 backport of CLOUDSTACK-8197 create MinVRVersion config item
Conflicts:
  api/src/com/cloud/network/VirtualNetworkApplianceService.java
  engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

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

This closes #244
2015-05-13 09:33:16 +02:00
Rohit Yadav 4ba72a877c Updating pom.xml version numbers for release 4.5.2-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-07 15:33:01 +02:00
Rohit Yadav 0eb4eb2370 Updating pom.xml version numbers for release 4.5.1
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-04 12:17:03 +02:00
Rohit Yadav 7a1cb28c9f server: Introduce Unknown Status to be used in AbstractInvestigatorImpl
The PR #211 introduced changes where the abstract investigator testIpAddress()
would return other Status, which previously only returned null, Up or Down. In
this patch we introduce a new Status "Unknown" that replaces null's semantics.

The important changes #211 introduced was the debugging statements as semantically
the changes would work same as the consumers of testIpAddress() method only used
if returned values were Up or Down and in other cases (null, Alert etc) it would
simply continue to loop through the resources being investigated.

Keeping the debug logs, this commit only replaces the previously returned null
values with Status.Unknown and fixed the debug statements to reflect the same.
In case of trapped exceptions too, we return Unknown status but log the exception
we trapped.

server: add null assertions and remove dead code with testIpAddress usage

This closes #222

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-03 15:15:29 +02:00
Rohit Yadav 279efb0432 CLOUDSTACK-6139: Fix regression, allow zone level systemvm localstorage config
From b3f18e7d74, the zone level systemvm local
storage setting never worked as it needed to be moved to config depot.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-01 15:24:53 +02:00
Ilia Shakitko 50dd37fcc9 GetUsageRecordsCmd - NewInputFormat for START_DATE and END_DATE (with time; backward capabile)
This closes #191

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-25 02:49:21 +02:00
Rohit Yadav 3e8b12bbb1 CLOUDSTACK-8399: Allow changing hvm flag in updateTemplate API
This allows changing the hvm flag for a template after the template has been
registered.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-23 15:27:43 +02:00
Rohit Yadav c71339569d RemoteAccessVpn: fix regression preshared key is not sent to UI/clients
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-23 14:04:32 +02:00
Rene Moser 5f154b91ba CreateVMSnapshot: fix typo in API description
This closes #161

(cherry picked from commit 4a424500f3)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-14 00:59:49 +05:30
Rohit Yadav 0fe4acf525 CLOUDSTACK-6353: Fix list to have correct LB IP for each rule
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-26 18:20:59 +05:30
Rajani Karuturi 5da733072e CLOUDSTACK-5236 : ability to identify where the user is from (ex. LDAP)
Added a source column to the user table.

Source now has only two values UNKNOWN,LDAP with UNKNOWN being the
default and is an enum is com.cloud.User.

When the source is UNKNOWN, the old method of authenticating against all
the available authenticators is used. If a source is available, only
that particular authenticator will be used.

added overloaded methods in AccountService to createUserAccount and
createUser with source specified.
2015-03-16 12:35:37 +05:30
Rohit Yadav c198dfdb7a Update pom and version usage to 4.5.1-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-12 12:13:18 +05:30
Rohit Yadav 02cadc3fb3 api: avoid sending sensitive data in api response
- UI: use post when updating user
- S3: don't send s3 key in the response
- VPN: don't send preshared key in remoteaccessvpn api response
- Snapshot response should set zone id not volume's device id

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-11 16:34:11 +05:30
Phillip Kent edf7675d2e modify description for name parameter in ListVMsCmd.java
(cherry picked from commit d4523c5778)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-05 18:28:34 +05:30
René Moser e39ec2767e CreatePortForwardingRuleCmd: Fix typos and update descriptions.
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>

This closes #94
2015-03-05 11:02:05 +01:00
Rohit Yadav 5481485a08 CLOUDSTACK-5238: password checks, NPE fixes and minor fixes
- insecure authenticators excluded in configuration
- snapshot response should have zone
- remove vmsnapshots when removing accounts

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-27 18:20:10 +05:30
Rohit Yadav e000646790 CLOUDSTACK-8273: fix baremetal account creation
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-27 15:52:25 +05:30
Pierre-Yves Ritschard c37841817e ensure agent reconciliation triggers events
(cherry picked from commit 0ba75bcebd)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-18 11:15:13 +05:30
Rohit Yadav e5cd75790a CLOUDSTACK-7085, CLOUDSTACK-7084: disallow empty passwords
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-16 15:31:22 +05:30
Santhosh Edukulla 78bfaa79cf Fixed few coverity issues like invalid boxing unboxing issues, resource leaks, null dereferences
(cherry picked from commit ef6ec7b276)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-06 16:50:20 +05:30
Rohit Yadav af278fe1ab Fix typos
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-06 15:53:41 +05:30
Rohit Yadav d2bf21065e DeployVmCmd: Fix NPE case
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-06 14:20:57 +05:30
Kishan Kavala 7a397cd4ef For volumes created from template, do not log offering ID in VOLUME.CREATE in usage_event. Moved offering type to DiskOffering interface
(cherry picked from commit 9eb8d538dd)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-05 16:37:59 +05:30
Damodar 01cc1b816d CLOUDSTACK-7792: Usage Events to be captured based on Volume State Machine
(cherry picked from commit 781648fb10)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
	engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
2015-02-05 15:22:21 +05:30
Damodar 8ec6d0471c CLOUDSTACK-7648: There are new VM State Machine changes introduced which were missed to capture the usage events
(cherry picked from commit 50185b7c3a)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BaremetalManagerImpl.java
	server/src/com/cloud/capacity/CapacityManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
2015-02-05 14:56:52 +05:30
Rohit Yadav 48ec9ac11b CLOUDSTACK-8190: Fix xenserver traffic label for backward compatiblity
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-02 16:09:56 +05:30
Santhosh Edukulla 737edd90dc Fixed few coverity patches
NPE in delete firewall rules observed, cherry-picking fix from master.

(cherry picked from commit 31a42d2b7a)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-02 12:48:38 +05:30
Daan Hoogland 766f8216a0 state description c&p fix 2015-01-24 13:35:07 +01:00
Harikrishna Patnala 9cf05dc842 CLOUDSTACK-7534: ResetVM for VM with attached datadisk fails when enable.ha.storage.migration is false
Separate global config to enable/disable Storage Migration during normal deployment
Introduced a configuration parameter named enable.storage.migration

(cherry picked from commit c55bc0b2d1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-20 14:43:10 +05:30
Rajesh Battala 1288d533ef CLOUDSTACK-7774 Description field is missing in Health policy API's
(cherry picked from commit e5d3e496ab)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-20 12:04:53 +05:30