28366 Commits

Author SHA1 Message Date
Rohit Yadav
1ec4d0155a CLOUDSTACK-8701: Allow SAML users to switch accounts
SAML authorized accounts might be across various domains, this allows for
switching of accounts only in case of SAML authenticated user accounts across
other accounts with the same SAML uid/username.

Moves the previous switch account logic to its own ui-custom module

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

Conflicts:
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
	ui/index.jsp
2015-08-14 11:58:44 +05:30
Rohit Yadav
89f47ece3d CLOUDSTACK-8702: Add/refactor sessionkey checking code to HttpUtils
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit cb7dd7b27dff1408cc41d69152a644c5b8842bfe)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-14 11:56:55 +05:30
Rohit Yadav
5d29b63cfa CLOUDSTACK-8613, CLOUDSTACK-6301: Dump KVM domain XML with secure flag
When dumping XML use appropriate flags:

1, VIR_DOMAIN_XML_SECURE (dump security sensitive information too)
8, VIR_DOMAIN_XML_MIGRATABLE (dump XML suitable for migration)

Source:
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainXMLFlags

This fixes CVE 2015-3252: VNC password lost during VM migration across KVM
hosts. The issue is also seen when a VM is rebooted.

(cherry picked from commit cb2aca751630ea60ad2fffed3d12e3fa2a5e93b5)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-14 10:57:36 +05:30
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
Radu Stefanache
cea45b2124 Merge pull request #1 from radu-stefanache/radu-stefanache-patch-1
Typo correction
2015-08-13 16:05:56 +01:00
Daan Hoogland
ff66175f55 Merge pull request #681 from DaanHoogland/coverity-regressions
Coverity regressions per 10 aug 2015Not all are in here, the db upgrade code seems to stay the main pitfall.

* pr/681:
  coverity 1315775: proper getting of networkLabel
  coverity 1315774: improvement of code to negate false positive

Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-08-13 16:25:01 +02:00
Rajani Karuturi
a65339ff1b CLOUDSTACK-8669: making StringUtils.getDefaultCharset protected
made this protected as its only use is in the Test file.
2015-08-13 17:39:44 +05:30
Boris Schrijver
aa7f8e57c5 Added unit tests for CLOUDSTACK-8133
Tests will confirm the behaviour of the newly added response fields of listSecurityGroups.

Signed-off-by: Wido den Hollander <wido@widodh.nl>

This closes #679
2015-08-13 13:47:38 +02:00
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
shweta agarwal
792c27c9bd test case automated for list template pagination
additional verification added
This closes #646
2015-08-13 15:51:16 +05:30
Remi Bergsma
af7e9b8dec Merge pull request #668 from pritisarap12/CLOUDSTACK-8693-Adding-missing-code-in-testpath_same_vm_name.py_testpatha
CLOUDSTACK-8693-Adding-missing-code-in-testpath_same_vm_name.py_testpath-Adding "cls.hypervisor = cls.testClient.getHypervisorInfo()"
-Fixed pep8 issues

* pr/668:
  CLOUDSTACK-8693-Adding-missing-code-in-testpath_same_vm_name.py_testpatha

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-13 12:00:35 +02:00
Jayapal
da9e757b8e CLOUDSTACK-8710: Fixed applying iptables rules for s2s vpn 2015-08-13 14:07:12 +05:30
Priti Sarap
6fd491b1ce CLOUDSTACK-8693-Adding-missing-code-in-testpath_same_vm_name.py_testpatha 2015-08-13 13:11:50 +05:30
Mike Tutkowski
8fcc76e7ff Fixing a FindBugs issue related to PR 674 2015-08-12 22:57:59 -06:00
Mike Tutkowski
55ae168cdd Merge pull request #674 from Mike Tutkowski (mike.tutkowski@solidfire.com)
* pr/674:
  getUsedBytes should query the SolidFire cluster to acquire the size of the given volume if there is no volume_details info for that volume (and then create a volume_details row for this volume so we don't have to make that cluster call for this purpose again)

Signed-off-by: Mike Tutkowski
Signed-off-by: Mike Tutkowski <mike.tutkowski@solidfire.com>
2015-08-12 12:48:36 -06:00
Mike Tutkowski
bcfbc6d73c getUsedBytes should query the SolidFire cluster to acquire the size of the given volume if there is no volume_details info for that volume (and then create a volume_details row for this volume so we don't have to make that cluster call for this purpose again) 2015-08-12 12:24:17 -06:00
Milamber
4be622e4ff Add missing localization for some labels in Web UI
- on new functionnality: upload volume/template from Local
- on the zone configuration wizard for the "Next" button
- update French messages properties from transifex
- Improve some French translations ("Téléverser" for "Upload")
2015-08-12 17:30:15 +01:00
Radu Stefanache
f5a6d8ca3a Typo correction
Simple typo in the code .
2015-08-12 09:48:49 +01:00
Daan Hoogland
1ab3b96594 coverity 1315775: proper getting of networkLabel 2015-08-12 01:10:31 +02:00
Daan Hoogland
a3ae8e0645 coverity 1315774: improvement of code to negate false positive 2015-08-12 01:04:06 +02:00
Daan Hoogland
c0534756d0 CLOUDSTACK-8656: network related exception logging 2015-08-11 18:14:20 +02:00
Remi Bergsma
fa56b3f37e Merge pull request #678 from remibergsma/sec-stor-script-mysql-default-port
Improve cloud-install-sys-tmplt to work in dev environment againThe script that you run to initially setup secondary storage, had some errors. As it now depends on /etc/cloudstack/management/db.properties, it did not work any more on my development environment.

I defined some defaults that work in development environments (those are sane defaults anyway), then check if the /etc/cloudstack/management/db.properties file exists. If so, it reads from there and gets the vars just like before. If not, it keeps the defaults unless of course someone overrides them on the command line.

While working on the script, I also fixed the indentation and found a query that was not yet using the -P mysql port variable.

I tested it both on my development environment as well as in an environment installed from RPM (where you'd have /etc/cloudstack/management/db.properties and that both worked.

PS @snuf please check if it also works again for you.

* pr/678:
  clean-ups in the file
  this query had no -P port specified so did not work
  make sane defaults for MySQL settings

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-11 17:19:16 +02:00
Remi Bergsma
2f858a7d08 clean-ups in the file
- replace tabs with 4 spaces
- removed trailing spaces
- fixed indenting
- made if; then look the same
2015-08-11 14:55:16 +02:00
Remi Bergsma
ee9b644e28 this query had no -P port specified so did not work 2015-08-11 14:51:11 +02:00
Remi Bergsma
8a1e79f518 make sane defaults for MySQL settings
In dev environments, there is no /etc/cloudstack/management/db.properties file
That forces you to specify all parameters on the command line. This commit
sets some defaults, like port 3306, user root and localhost.

When available, it will still get settings from the config file and it will
also allow you to override it on the command line. So it is fully backwards
compatible.
2015-08-11 14:51:11 +02:00
Priti Sarap
1e6420149f CLOUDSTACK-8723: Verify API call "listUsageRecords" returns usage of new volume created after restore VM 2015-08-11 16:54:05 +05:30
Remi Bergsma
f65dec4b0f Merge pull request #658 from manuiiit/pull-11
Implemented condition that only admin or owner of the template can change its permissions ..... using updateTemplatePermissions API

Consider this scenario :
In a domain, there are three User Accounts UA1, UA2,UA3
A private template is registered by UA1
Through the updateTemplatePermissions API, UA1 gives permission to both UA2 and UA3
Now, UA2, having been shared the template, can remove the permission of UA3(or add permissions to another account).
EXPECTED BEHAVIOR :
UA2 should not be able to to add/remove permissions of other accounts.

* pr/658:
  Implemented condition that only admin or owner of the template can change its permissions using updateTemplatePermissions API

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-11 11:38:33 +02:00
sanjeev
b1fa378612 CLOUDSTACK-8720: Handle corner case in remove nic from vm Please see the bug for more details
Incorporating comments from pavanb018

This closes #671
2015-08-11 12:33:46 +05:30
Maneesha.P
f7e8d44552 Implemented condition that only admin or owner of the template can change its permissions using updateTemplatePermissions API 2015-08-11 11:08:35 +05:30
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
Remi Bergsma
cd02a59841 Merge pull request #656 from koushik-das/CLOUDSTACK-8704
CLOUDSTACK-8704: Schedule restart of router VMs ahead of user VMs as part of HA

VRs are scheduled for HA ahead of user VMs.

Refer to the bug for more details.

* pr/656:
  CLOUDSTACK-8704: Schedule restart of router VMs ahead of user VMs as part of HA VRs are scheduled for HA ahead of user VMs

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-10 12:13:15 +02:00
Koushik Das
44c1ef04a0 CLOUDSTACK-8704: Schedule restart of router VMs ahead of user VMs as part of HA
VRs are scheduled for HA ahead of user VMs
2015-08-10 14:51:44 +05:30
Remi Bergsma
e8ade2dd9e Merge pull request #662 from manuiiit/pull-14
CLOUDSTACK-8711: public_ip type resource count for an account is not decremented upon IP range deletionProblem:
--------------------------
When you add an IP range and associate it to an account then resource count of public_ip will be updated to the range length.
After some time try to delete this range and the resource count of public_up for this account is not descremented and is causing account not to add any more public IPs to it once it reaches the resource limit.
RCA:
----------------
We were not decrement the count while deleting the IP range that was associated to an account.
Fix:
-------------
Up on deletion we are decrementing the resource count for public_up now.

* pr/662:
  Bug-Id: CS-27335: public_ip type resource count for an account is not decremented upon IP range deletion

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-10 09:24:27 +02:00
Daan Hoogland
b074fc70d8 Merge pull request #664 from @kevindierkx
Removed leading tabs and trailing spaces from ui/scripts/accounts.js ui/scripts/accountsWizard.js ui/scripts/affinity.js ui/scripts/autoscaler.js ui/scripts/cloud.core.callbacks.js ui/scripts/cloudStack.js ui/scripts/configuration.js ui/scripts/dashboard.js ui/scripts/docs.js ui/scripts/domains.js ui/scripts/events.js ui/scripts/globalSettings.js ui/scripts/installWizard.js ui/scripts/instances.js ui/scripts/instanceWizard.js ui/scripts/lbStickyPolicy.js ui/scripts/network.js ui/scripts/plugins.js ui/scripts/projects.js ui/scripts/regions.js ui/scripts/sharedFunctions.js ui/scripts/storage.js ui/scripts/system.js ui/scripts/templates.js ui/scripts/vm_snapshots.js ui/scripts/vpc.js ui/scripts/zoneWizard.js

* pr/664:
  Removed more commented code from zoneWizard.js
  Removed large chunks of commented code
  Removed leading tabs from ui/scripts/*.js
  Removed trailing whitespace from ui/scripts/*.js

Signed-off-by: Daan Hoogland <hoogland@daan.cc>
2015-08-07 23:09:22 +02:00
Remi Bergsma
a08d8b1845 Merge pull request #666 from @remibergsma
CLOUDSTACK-8709 No out of band migrate alert for non-routers

* pr/666:
  CLOUDSTACK-8709 No out of band migrate alert for non-routers

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-07 16:44:21 +02:00
Remi Bergsma
90feab18e0 Merge pull request #659 from @manuiiit
CLOUDSTACK-8714 Restore VM (Re-install VM) with enable.storage.migration set to false fails

* pr/659:
  Bug-ID:CS-27160: Restore VM (Re-install VM) with enable.storage.migration set to false fails, later fails to start up VM too

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-07 16:36:54 +02:00
Wei Zhou
a9ace22fbd CLOUDSTACK-8638: install update_host_passwd.sh in cloudstack-common installation
Signed-off-by: Wido den Hollander <wido@widodh.nl>

This closes #663
2015-08-07 15:06:17 +02:00
Kevin Dierkx
43b9b8f0d5 Removed more commented code from zoneWizard.js 2015-08-07 15:04:57 +02:00
Kevin Dierkx
3acdd916b0 Removed large chunks of commented code 2015-08-07 14:55:59 +02:00
Remi Bergsma
daa30c4722 CLOUDSTACK-8709 No out of band migrate alert for non-routers 2015-08-07 14:30:00 +02:00
Kevin Dierkx
471a02d6a4 Removed leading tabs from ui/scripts/*.js 2015-08-07 11:58:13 +02:00
Kevin Dierkx
2bdbaf453e Removed trailing whitespace from ui/scripts/*.js 2015-08-07 11:25:15 +02:00
Mike Tutkowski
a5e563aa85 Merging #660 (Mike Tutkowski) (Retrieve a new device ID, if needed)
* pr/#660:
  CLOUDSTACK-8698: Retrieve a new device ID, if needed

Signed-off-by: Mike Tutkowski (mike.tutkowski@solidfire.com)
Signed-off-by: Mike Tutkowski <mike.tutkowski@solidfire.com>
2015-08-06 11:27:21 -06:00
Rajani Karuturi
7ac795f825 Merge pull request #657 from @karuturi
CLOUDSTACK-8696: Create Region fails with exception

* pr/657:
  CLOUDSTACK-8696: Create Region fails with exception

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-08-06 17:16:35 +05:30
Damodar
865623fd1e Bug-Id: CS-27335: public_ip type resource count for an account is not decremented upon IP range deletion
Reviewed-By: Kishan/Bharat

Signed-off-by: Maneesha.P <maneesha.papireddygari@citrix.com>
2015-08-06 14:39:27 +05:30
sanjeev
18fee95109 Removed medium dictionary from test_data and modified the tests dependent on it
Removed duplicate test data related to vm properties.Modified tests dependent on it

Removed duplicte service offerings from test data and modified tests dependent on it
Bug-Id: CLOUDSTACK-8617
This closes #644
2015-08-06 11:29:13 +05:30
Mike Tutkowski
2c8d179b7a Renamed two variables to make them more descriptive 2015-08-05 22:43:43 -06:00
Mike Tutkowski
abfe33a244 Merging #653 (Mike Tutkowski) (Reduce lowest hypervisor snapshot reserve value)
* pr/653:
  The lowest the hypervisor snapshot reserve value can be is 10 (down from 50).

Signed-off-by: Mike Tutkowski (mike.tutkowski@solidfire.com)
Signed-off-by: Mike Tutkowski <mike.tutkowski@solidfire.com>
2015-08-05 16:23:58 -06:00
Mike Tutkowski
2cbc168822 The lowest the hypervisor snapshot reserve value can be is 10 (down from 50). 2015-08-05 15:47:57 -06:00