29656 Commits

Author SHA1 Message Date
Rohit Yadav
1770f3cb86 dynamic-roles: remove unnecessary order by ID
On some MySQL server envs, this may cause a SQL statement error, though
I was unable to reproduce it. Since it's not needed, an order by 'sort_order'
is enough, we can safely remove it.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-18 13:46:18 +05:30
Will Stevens
b4ad38d687 Revert "Merge pull request #1493 from shapeblue/nio-fix"
This reverts commit 7ce0e10fbcd949375e43535aae168421ecdaa562, reversing
changes made to 29ba71f2db3a3b7dcdad3a7c1f83725cffd56261.

This was reverted because it seemed to be related to an issue
when doing a DeployDC, causing an `addHost` error.
2016-05-16 17:30:44 -04:00
Will Stevens
f175ad1ae0 Revert "Merge pull request #1534 from shapeblue/niotest-fix"
This reverts commit 9f970f28b18534dffe33196ead60ea861f501fa9, reversing
changes made to 6d0c92be7257afcf5f1a9f4453e3470e0083125d.

This was reverted because it seemed to be related to an issue
when doing a DeployDC, causing an `addHost` error.
2016-05-16 17:30:20 -04:00
Will Stevens
4e1f9cd82a Revert "Merge pull request #1538 from shapeblue/nio-test-timeoutfix"
This reverts commit f88cb880974fa56866492c437af291e40bd1a4f6, reversing
changes made to 688522ecd41d5e2bf09467aa236deb50f7826982.

This was reverted because it seemed to be related to an issue
when doing a DeployDC, causing an `addHost` error.
2016-05-16 17:29:42 -04:00
Will Stevens
ed8d47eef2 Revert "CLOUDSTACK-9348: Make NioConnectio loop less aggressive"
This reverts commit 540d9572fd491db3ce182d26636fc74ada4e171c.

This was reverted because it seemed to be related to an issue
when doing a DeployDC, causing an `addHost` error.
2016-05-16 17:27:07 -04:00
Will Stevens
e3b38bbd4f Merge release branch 4.8 to master
* 4.8:
  Add perl-modules as install dependency for cloudstack-agent
2016-05-13 17:07:26 -04:00
Will Stevens
a0aa0604ec Merge release branch 4.7 to 4.8
* 4.7:
  Add perl-modules as install dependency for cloudstack-agent
2016-05-13 17:06:39 -04:00
Will Stevens
7a0b37a29a Merge pull request #1495 from greenqloud/pr-install-perl-modules-on-agent
Add perl-modules as install dependency for cloudstack-agentRequired to run perl scripts that configure networking for VMs.

* pr/1495:
  Add perl-modules as install dependency for cloudstack-agent

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-13 17:05:55 -04:00
Will Stevens
06c6b367e7 Merge pull request #1532 from exoscale/fix/db-cache-miss
DAO: Hit the cache for entity flagged as removed tooI came along this part of the code and I don't see any reason why the cache should not be used when fetching with the "removed" ones. It will help decrease the number of DB queries.

*It can be merged in many CS versions*

* pr/1532:
  DAO: Rewrite change for method findByIdIncludingRemoved(ID id)
  dao: Hit the cache for entity flagged as removed too since they are put in cache afterwards.

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-13 17:04:57 -04:00
Will Stevens
f2f895a5c2 Merge pull request #1537 from PaulAngus/master
Remove extraneous log directory and add catalina.out log rotationrebased and squashed
replacement for PR: https://github.com/apache/cloudstack/pull/1087

Remove extraneous log directory (/var/log/cloudstack-management)
and adds catalina.out log rotation

* pr/1537:
  Remove extraneous log directory and add catalina.out log rotation

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-13 17:04:18 -04:00
Will Stevens
7be8585787 Merge pull request #1520 from NuxRo/kvm-numa-cpu-reporting
CPU socket count reporting correctionCPU socket count reporting correction
From https://github.com/MissionCriticalCloud/cosmic-plugin-hypervisor-kvm/pull/16

* pr/1520:
  Remove empty spaces causing the build to fail
  CPU socket count reporting correction

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-13 17:02:10 -04:00
Will Stevens
c82d50270d Merge pull request #1280 from anshul1886/CLOUDSTACK-9199
CLOUDSTACK-9199: Fixed deployVirtualMachine API does not throw an error when cpunumber is specified for static compute offeringhttps://issues.apache.org/jira/browse/CLOUDSTACK-9199

To test:
-------------
Deploy VM by providing cpuNumber, cpuSpeed or memory for static/ non dynamic service offering
Deployment should fail.

API example:
------------------
http://10.220.135.6/client/api?command=deployVirtualMachine&name=olotwo&response=&zoneid=ab6e4154-62a3-42a8-9627-3cbdc66bcbb6&templateid=3aaaace6-91b4-11e5-b6fc-e26c2aa1d1d0&hypervisor=XenServer&serviceofferingid=39643075-4b45-489d-afac-88f09d536bdd&details[0].cpuNumber=1&details[0].cpuSpeed=1000&details[0].memory=1000&securitygroupids=60844698-91b4-11e5-b6fc-e26c2aa1d1d0&_=1448277187743

* pr/1280:
  CLOUDSTACK-9199: Fixed deployVirtualMachine API does not throw an error when cpunumber is specified for static compute offering

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-13 17:00:35 -04:00
Will Stevens
3343f1229c Merge pull request #1376 from milamberspace/L10N-update-Master-20160127
L10n update master 20160127cc @remibergsma @bhaisaab @DaanHoogland

* pr/1376:
  Update L10N resource files with 4.9 strings from Transifex (20160511) Force "translator" mode with the transifex client. Update Transifex client config file (regenerated by Tx client)

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-13 17:00:00 -04:00
Will Stevens
821b2da126 Merge pull request #1543 from shapeblue/nio-fix-aggressive-cpu-use
Fix Nio/CPU issue and CI failures- Reverts ea2286 that introduced a wakeup on each connection loop run.
- In SSL handshake code removes delegated tasks to be run in separate threads.

/cc @kiwiflyer @swill @jburwell and others for review

@kiwiflyer please help me test this fix and share if it makes the NioConnection robust now, without having the selector consume a lot of CPU. Thanks.

* pr/1543:
  test: fix cleanup sequence for test_acl_listvolume test
  CLOUDSTACK-9299: Fix test failures on CI
  CLOUDSTACK-9348: Make NioConnectio loop less aggressive

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-13 11:10:01 -04:00
Marc-Aurèle Brothier
39aa0e4f35 DAO: Rewrite change for method findByIdIncludingRemoved(ID id)
Also change the sibling method findById(final ID id)
2016-05-13 11:01:39 +02:00
Rohit Yadav
acc781d086 test: fix cleanup sequence for test_acl_listvolume test
Changes the cleanup sequence as the cleanup code causes exceptions in
several Travis runs such as:
https://travis-ci.org/apache/cloudstack/jobs/129925224

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-13 14:16:06 +05:30
Rohit Yadav
ae0f169123 CLOUDSTACK-9299: Fix test failures on CI
- Fixes oobm integration test to skip if known ipmitool bug is hit
- Fixes ProcessTest unit test case to use sleep
- Removes redundant unit test that covers code in ProcessTest

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-13 09:47:32 +05:30
Rohit Yadav
540d9572fd CLOUDSTACK-9348: Make NioConnectio loop less aggressive
- Reverts ea2286 that introduced a wakeup on each connection loop run.
- In SSL handshake code removes delegated tasks to be run in separate threads.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-13 08:54:49 +05:30
Will Stevens
2b4b8aa40c Merge release branch 4.8 to master
* 4.8:
  This patch addresses two issues:
2016-05-12 18:25:08 -04:00
Will Stevens
3bbeb6af95 Merge release branch 4.7 to 4.8
* 4.7:
  This patch addresses two issues:
2016-05-12 18:23:37 -04:00
Will Stevens
bbb2dd034e Merge pull request #1536 from ntavares/useextdns_rvmvip47
Honour GS use_ext_dns and redundant VR VIPThis patch addresses two issues:

On redundant VR setups, the primary resolver being handed out to instances is the guest_ip (primary IP for the VR). This might lead to problems upon failover, at least while the DHCP lease doesn't update (because the primary resolver will be checked first until times out, however it'll be gone upon failover).

If Global Setting use_ext_dns is true, we don't want the VR to be the primary resolver at all.

* pr/1536:
  This patch addresses two issues:

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 18:23:01 -04:00
Milamber
9b93989032 Update L10N resource files with 4.9 strings from Transifex (20160511)
Force "translator" mode with the transifex client.
Update Transifex client config file (regenerated by Tx client)
2016-05-12 22:30:40 +01:00
Will Stevens
9320f858f3 Merge pull request #1460 from shapeblue/jsb/jenv-pyenv
CLOUDSTACK-9334: Support jenv and pyenv to manage Java and Python versions  * Adds .java-version to specify Java 1.7 as the JDK version to use
    for CloudStack development.  jenv does not support comments in
    this file.  Therefore, no license header is present.
  * Adds .python-vresion to specify Python 2.7.11 as the Python to
    use for CloudStack development.  pyenv does not support comments
    in this file.  Therefore, no license header is present.
  * Adds requirements.txt to specify the default dependencies used
    for CloudStack development.  It does not include Marvin's
    dependencies because it's bundle already defines the dependencies
    which are installed with Marvin.
  * Updates INSTALL.md to explain how to utilize jenv and pyenv for
    CloudStack development

* pr/1460:
  CLOUDSTACK-9334: Support jenv and pyenv to manage Java and Python versions

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 16:50:40 -04:00
Will Stevens
8c3722d953 Merge pull request #1444 from rafaelweingartner/workAroundPR780
CLOUDSTACK-8800 : Improved the listVirtualMachines API call to include memory utilization information for a VMThis PR introduces the changes proposed in PR #780 with some work to make the code null safe.

During this PR, I have also removed some unused code.

* pr/1444:
  Removed unnecessary check when creating the “userVmResponse” object.
  Fixed issues from CLOUDSTACK-8800 that were introduced in PR 780
  CLOUDSTACK-8800 : Improved the listVirtualMachines API call to include memory utilization information for a VM for xenserver,kvm and for vmware.

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 16:49:14 -04:00
Will Stevens
20cf8b23c0 Merge pull request #1453 from GabrielBrascher/brascher-removeUnusedClasses2
Remove classes with no referencesI used UCDetector (http://www.ucdetector.org/) as a plugin for Eclipse.  With this tool, I discovered a lot of code without any reference (variables, methods and classes).

Following the work that was done at [https://github.com/apache/cloudstack/pull/1448]; this pull request had the goal of removing some of these classes. To check if I wasn't missing anything I searched for any file that could reference some of those classes. As I haven't found any way of these classes being used, they were removed. Note that some of them I found other references, but references such as commented lines or tests, nothing that could indicate their use (as XML files configuring beans or another class instantiating an object with "new").

Waiting for tests. Please tell me if I am missing something.

Removed Classes:
- org.apache.cloudstack.framework.jobs.JobCancellationException (**Note:** removed
variable JobCancellationException in com.cloud.utils.SerialVersionUID)
- org.apache.cloudstack.ldap.NoSuchLdapUserException (**Note:** removed test file
/cloud-plugin-user-authenticator-ldap/test/groovy/org/apache/cloudstack/ldap/NoSuchLdapUserExceptionSpec.groovy)
- com.cloud.agent.api.storage.CreateVolumeOVAAnswer
- com.cloud.exception.MissingParameterValueException
- org.apache.cloudstack.api.response.StatusResponse
- org.apache.cloudstack.api.response.VolumeDetailResponse
- org.apache.cloudstack.api.response.UpgradeVmResponse
- org.apache.cloudstack.api.response.AddIpToVmNicResponse
- org.apache.cloudstack.api.response.TemplateZoneResponse (**Note:** at
org.apache.cloudstack.api.response.TemplateResponse, there is this
comment "To avoid breaking backwards compatibility, we still treat a
template at different zones as different templates, so not embedding
template_zone information in this TemplateZoneResponse set. `private
Set<TemplateZoneResponse> zones;`" but right now it is not used)
- org.apache.cloudstack.api.response.NicDetailResponse

* pr/1453:
  Removed classes with no reference

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 16:48:03 -04:00
Will Stevens
3f97908417 Merge release branch 4.8 to master
* 4.8:
  writeIfNotHere requires an array of strings, not a string
2016-05-12 16:47:09 -04:00
Will Stevens
a1e181cd7e Merge release branch 4.7 to 4.8
* 4.7:
  writeIfNotHere requires an array of strings, not a string
2016-05-12 16:46:28 -04:00
Will Stevens
170765e90d Merge pull request #1456 from greenqloud/pr-4.7-baremetal_metadata_parameter_bugfix
writeIfNotHere requires an array of strings, not a string

* pr/1456:
  writeIfNotHere requires an array of strings, not a string

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 16:45:34 -04:00
Will Stevens
f88cb88097 Merge pull request #1538 from shapeblue/nio-test-timeoutfix
Disable NioTestHistorically NioTest has caused issue in CI environment and several developer machines due to network requirements which could be disabled by firewall or security enforcers such as selinux. This disables the test once again using a historic commit 881a6e1
Signed-off-by: Rohit Yadav <rohit.yada

To build and just run this test: mvn clean install -pl utils -Dtest=NioTest

* pr/1538:
  utils: Disable NioTest

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 16:38:37 -04:00
Will Stevens
688522ecd4 Merge pull request #1385 from DaanHoogland/CLOUDSTACK-9265
CLOUDSTACK-9265 cleanup around httpclient versionssome cleanup done
- replaced HttpStatus from org.apache.commons.httpclient with that from org.apache.http
- removed unthrown HttpException
- left auto reformat in place

* pr/1385:
  CLOUDSTACK-9265 cleanup around httpclient versions

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:11:28 -04:00
Will Stevens
c79affaefb Merge pull request #1528 from mike-tutkowski/marvin_methods
CLOUDSTACK-9373: Class methods over-shawdowing instance methodsWe have some methods in base.py that are named the same.

Per my findings below, Python methods in a class should not be named the same even if one is a class method and the other is an instance method.

The solution discussed on dev@ is to remove the instance versions (reason listed in e-mail text, which is listed in JIRA ticket).

https://issues.apache.org/jira/browse/CLOUDSTACK-9373

* pr/1528:
  CLOUDSTACK-9373: Removing a few instance methods where there are class methods that are overshadowing them

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:08:53 -04:00
Will Stevens
7e41747c33 Merge pull request #816 from mike-tutkowski/addremovehosts2
Notify listeners when a host has been added to a cluster, is about to be removed from a cluster, or has been removed from a cluster

This PR addresses the following JIRA ticket:

https://issues.apache.org/jira/browse/CLOUDSTACK-8813

The problem is that there needs to be notifications sent when a host is added to, about to be removed from, and removed from a cluster.

Such notifications can be used for many purposes. For example, it can allow storage plug-ins to update ACLs on their storage systems. Also, it can allow us to clean up IQNs from ESXi hosts that are no longer needed.

* pr/816:
  CLOUDSTACK-8813: Notify listeners when a host has been added to a cluster, is about to be removed from a cluster, or has been removed from a cluster

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:07:36 -04:00
Will Stevens
143265c49f Merge pull request #1502 from shapeblue/outofband-master
CLOUDSTACK-9299: Out-of-band Management for CloudStackSupport access to a hosts 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, please install `ipmitool` (using yum/apt/brew) and `ipmisim`:
https://pypi.python.org/pypi/ipmisim

The default ipmitool location is assumed in /usr/bin, if this is different in your env please fix the global setting, see FS for details on various global settings.

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

/cc @jburwell @swill @abhinandanprateek @murali-reddy @borisstoyanov

* pr/1502:
  maven: ignore utils/testsmallfileinactive for rat checking
  CLOUDSTACK-9378: Fix for #1497
  HypervisorUtilsTest: increate timeout to 8seconds
  travis: Use patched version of ipmitool for tests
  CLOUDSTACK-9299: Out-of-band Management for CloudStack

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:06:13 -04:00
Will Stevens
103d62ee02 Merge release branch 4.8 to master
* 4.8:
  CLOUDSTACK-9287 - Improve test by checking if pvt gw is removed and fix typos
  Handle private gateways more reliably
  CLOUDSTACK-9287 - Fix RVR public interface
  CLOUDSTACK-9287 - Add integration test to cover the private gateway related changes
  CLOUDSTACK-9287 - Refactor the interface state configuration
  CLOUDSTACK-9287 - Check if the nic profile has already been removed from a certain router
  CLOUDSTACK-9287 - Bring up the private gw interface on state change to master
  CLOUDSTACK-9287 - Make sure private gw interface is not used for default gw
  CLOUDSTACK-9287 - Add integration test to cover the private gw interface/mac address issues
  CLOUDSTACK-9287 - Put private gateway interface down on backup router
  CLOUDSTACK-9287 - Generate new mac address if router is redundant and nic profile exists
  Add private gateway IP to router initialization config
  apply static routes on change to master state
2016-05-12 11:04:53 -04:00
Will Stevens
dbbc37ecc7 Merge release branch 4.7 to 4.8
* 4.7:
  CLOUDSTACK-9287 - Improve test by checking if pvt gw is removed and fix typos
  Handle private gateways more reliably
  CLOUDSTACK-9287 - Fix RVR public interface
  CLOUDSTACK-9287 - Add integration test to cover the private gateway related changes
  CLOUDSTACK-9287 - Refactor the interface state configuration
  CLOUDSTACK-9287 - Check if the nic profile has already been removed from a certain router
  CLOUDSTACK-9287 - Bring up the private gw interface on state change to master
  CLOUDSTACK-9287 - Make sure private gw interface is not used for default gw
  CLOUDSTACK-9287 - Add integration test to cover the private gw interface/mac address issues
  CLOUDSTACK-9287 - Put private gateway interface down on backup router
  CLOUDSTACK-9287 - Generate new mac address if router is redundant and nic profile exists
  Add private gateway IP to router initialization config
  apply static routes on change to master state
2016-05-12 11:03:57 -04:00
Will Stevens
3fab75772f Merge pull request #1474 from remibergsma/47_private_gw_initial_config
Handle private gateways more reliablyWhen initialising a VPC router we need to know which IP/device corresponds to a private gateway. This is to solve a problem when stop/starting a VPC router (which gets the private gateway config as a guest network and as a result breaks the functionality). You read it right, the private gateway is sent as type=guest after reboot and type=public initially.

Before this change, you could add a private gw to a running router but you couldn't restart it (it would mix up the tiers). Now the private gateway is detected properly and it works just fine.

Booting without private gateway:
```
root@r-167-VM:~# cat /etc/cloudstack/cmdline.json
{
    "config": {
        "baremetalnotificationapikey": "V2l1u3wKJVan01h8kq63-5Y5Ia3VLEW1v_Z6i-31QIRJXlt5vkqaqf6DVcdK0jP3u79SW6X9pqJSLSwQP2c2Rw",
        "baremetalnotificationsecuritykey": "OXI16srCrxFBi-xOtEwcYqwLlMfSFTlTg66YHtXBBqR7HNN1us3HP5zWOKxfVmz4a3C1kUNLPrUH13gNmZlu4w",
        "disable_rp_filter": "true",
        "dns1": "8.8.8.8",
        "domain": "cs2cloud",
        "eth0ip": "169.254.0.42",
        "eth0mask": "255.255.0.0",
        "host": "192.168.22.61",
        "name": "r-167-VM",
        "port": "8080",
        "privategateway": "None",
        "redundant_router": "false",
        "template": "domP",
        "type": "vpcrouter",
        "vpccidr": "10.0.0.0/24"
    },
    "id": "cmdline"
```

Booting with private gateway:
```
root@r-167-VM:~# cat /etc/cloudstack/cmdline.json
{
    "config": {
        "baremetalnotificationapikey": "V2l1u3wKJVan01h8kq63-5Y5Ia3VLEW1v_Z6i-31QIRJXlt5vkqaqf6DVcdK0jP3u79SW6X9pqJSLSwQP2c2Rw",
        "baremetalnotificationsecuritykey": "OXI16srCrxFBi-xOtEwcYqwLlMfSFTlTg66YHtXBBqR7HNN1us3HP5zWOKxfVmz4a3C1kUNLPrUH13gNmZlu4w",
        "disable_rp_filter": "true",
        "dns1": "8.8.8.8",
        "domain": "cs2cloud",
        "eth0ip": "169.254.2.227",
        "eth0mask": "255.255.0.0",
        "host": "192.168.22.61",
        "name": "r-167-VM",
        "port": "8080",
        "privategateway": "10.201.10.1",
        "redundant_router": "false",
        "template": "domP",
        "type": "vpcrouter",
        "vpccidr": "10.0.0.0/24"
    },
    "id": "cmdline"
```

And:
```
cat cmdline
vpccidr=10.0.0.0/24 domain=cs2cloud dns1=8.8.8.8 privategateway=10.201.10.1 template=domP name=r-167-VM eth0ip=169.254.2.227 eth0mask=255.255.0.0 type=vpcrouter disable_rp_filter=true baremetalnotificationsecuritykey=OXI16srCrxFBi-xOtEwcYqwLlMfSFTlTg66YHtXBBqR7HNN1us3HP5zWOKxfVmz4a3C1kUNLPrUH13gNmZlu4w baremetalnotificationapikey=V2l1u3wKJVan01h8kq63-5Y5Ia3VLEW1v_Z6i-31QIRJXlt5vkqaqf6DVcdK0jP3u79SW6X9pqJSLSwQP2c2Rw host=192.168.22.61 port=8080
```

Logs:
```
2016-02-24 20:08:45,723 DEBUG [c.c.n.r.VpcVirtualNetworkApplianceManagerImpl] (Work-Job-Executor-4:ctx-458d4c52 job-1402/job-1403 ctx-d5355fca) (logid:5772906c) Set privategateway field in cmd_line.json to 10.201.10.1
```

* pr/1474:
  Handle private gateways more reliably
  Add private gateway IP to router initialization config

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:02:55 -04:00
Will Stevens
919660d093 Merge pull request #1472 from remibergsma/47_fix_static_router_master_change
Apply static routes on change to master stateRefactored static routes for private gateways so they also get loaded when the router switches to master state. Otherwise they're lost and connections drop after fail over.

* pr/1472:
  apply static routes on change to master state

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:01:55 -04:00
Will Stevens
309a60ea71 Merge pull request #1483 from remibergsma/pr1413-wilder-47
CLOUDSTACK-9287 - Fix unique mac address per rVPC routerThis is work by @wilderrodrigues, see PR #1413 It contains important fixes and I think it needs to be included so I send the PR again.

* pr/1483:
  CLOUDSTACK-9287 - Improve test by checking if pvt gw is removed and fix typos
  CLOUDSTACK-9287 - Fix RVR public interface
  CLOUDSTACK-9287 - Add integration test to cover the private gateway related changes
  CLOUDSTACK-9287 - Refactor the interface state configuration
  CLOUDSTACK-9287 - Check if the nic profile has already been removed from a certain router
  CLOUDSTACK-9287 - Bring up the private gw interface on state change to master
  CLOUDSTACK-9287 - Make sure private gw interface is not used for default gw
  CLOUDSTACK-9287 - Add integration test to cover the private gw interface/mac address issues
  CLOUDSTACK-9287 - Put private gateway interface down on backup router
  CLOUDSTACK-9287 - Generate new mac address if router is redundant and nic profile exists

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:00:40 -04:00
Paul Angus
11e3582fdf Remove extraneous log directory and add catalina.out log rotation 2016-05-12 08:41:39 +01:00
Rohit Yadav
d4cb05b8f9 utils: Disable NioTest
Disable the NioTest, it is far to dependent on the network configuration of the
machine running the test. Cherry-picked change from a historic commit where
this test was disabled.

(cherry picked from commit 881a6e164ece8e34154555b71e97c9f1763674f5)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-12 11:50:50 +05:30
Mike Tutkowski
1ad0da0390 CLOUDSTACK-9373: Removing a few instance methods where there are class methods that are overshadowing them 2016-05-11 23:57:09 -06:00
Rohit Yadav
12fff7d8bd maven: ignore utils/testsmallfileinactive for rat checking
This fixes several Jenkins failures as previous runs don't cleanup this
file created by one of the unit tests.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-12 11:16:12 +05:30
Rohit Yadav
6135f6d98f CLOUDSTACK-9378: Fix for #1497
Reorder cleanup items so cleanup won't fail

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-12 11:05:40 +05:30
Rohit Yadav
e122bbfbfc HypervisorUtilsTest: increate timeout to 8seconds
Increases timeout to a larger value to avoid failures in VM environments such as
TravisCI.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-12 11:05:40 +05:30
Rohit Yadav
4d5e8df2f9 travis: Use patched version of ipmitool for tests
- For out-of-band management feature (CLOUDSTACK-9299) use patched version of
  ipmitool that would work on trusty travis machines
- The ipmitool used is from xenial/16.04 release with patch from RedHat
  https://bugzilla.redhat.com/show_bug.cgi?id=1286035
- Installs ipmitool from xenial repositories to get all the dependencies
  and then install patched deb version
- Skip test if the known failure occurs

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-12 11:05:40 +05:30
Rohit Yadav
07564469e9 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-12 11:05:40 +05:30
Mike Tutkowski
dad9e5d868 CLOUDSTACK-8813: Notify listeners when a host has been added to a cluster, is about to be removed from a cluster, or has been removed from a cluster 2016-05-11 08:02:46 -06:00
Will Stevens
bee2bdc299 Merge pull request #1489 from shapeblue/dynamicroles-master
CLOUDSTACK-8562: Dynamic Role-Based API Checker for CloudStack### 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

* pr/1489:
  maven: Fix jstl version usage
  CLOUDSTACK-8562: Deprecate commands.properties
  CLOUDSTACK-8562: DB-Backed Dynamic Role Based API Access Checker
  CLOUDSTACK-9361: Centrally handle API validations

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-11 02:03:50 -04:00
Will Stevens
dc5b52937b Merge release branch 4.8 to master
* 4.8:
  When no zone name is available display a default
2016-05-11 01:32:02 -04:00
Will Stevens
72811b4058 Merge release branch 4.7 to 4.8
* 4.7:
  When no zone name is available display a default
2016-05-11 01:31:21 -04:00