28321 Commits

Author SHA1 Message Date
Bharat Kumar
18dbc0c4cb CLOUDSTACK-8725 RVR functionality is broken in case of isolated networks, conntrackd fails to start.
Rebased with master. This closes #692
2015-08-31 11:54:11 +05:30
Rajani Karuturi
8bc0294014 Revert "Merge pull request #714 from rafaelweingartner/master-lrg-cs-hackday-003"
This reverts commit cd7218e241a8ac93df7a73f938320487aa526de6, reversing
changes made to f5a7395cc2ec37364a2e210eac60720e9b327451.

Reason for Revert:

noredist build failed with the below error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project cloud-plugin-hypervisor-vmware: Compilation failure
[ERROR] /home/jenkins/acs/workspace/build-master-noredist/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java:[484,12] error: non-static variable logger cannot be referenced from a static context
[ERROR] -> [Help 1]

even the normal build is broken as reported by @koushik-das on dev list
http://markmail.org/message/nngimssuzkj5gpbz
2015-08-31 11:27:57 +05:30
Daan Hoogland
cd7218e241 Merge pull request #714 from rafaelweingartner/master-lrg-cs-hackday-003
Changed variable s_logger to non-static and fixed its name in com.cloud.utils.component.ComponentLifecycleBase and its subclassesHi guys,
We have noticed that every single class that is a subclass of ComponentLifecycleBase instantiate their on logger manually and uses a nonstandard name. We fixed that by changing the variable in ComponentLifecycleBase to protected and non-static and instantiated it using the method getClass from Object class. Therefore, we can reduce the code in a few hundred lines and use a more intuitive name for the logger variable.

During that process we found a static method that used the s_logger variable in classes:
com.cloud.network.element.VirtualRouterElement
org.apache.cloudstack.network.element.InternalLoadBalancerElement

To fix that we had to create a new class com.cloud.network.element.HAProxyLBRule, instantiate it with @Componente and inject into the aforementioned classes.

The class that we create is com.cloud.network.element.HAProxyLBRule and has the following methods:
com.cloud.network.element.HAProxyLBRule.containsOnlyNumbers(String, String)
com.cloud.network.element.HAProxyLBRule.validateHAProxyLBRule(LoadBalancingRule)

Sadly we could not write test cases to it; hence we did not fully understand those methods. However, if anyone out there understands it, we would appreciate some code to be added to it.

As minor this change may seem; we believe that it enhances a little bit the ACS code by using standard name to logger variable.

* pr/714:
  Solved jira ticket: CLOUDSTACK-8750

Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-08-29 22:04:04 +02:00
Rafael Weingartner
3818257a68 Solved jira ticket: CLOUDSTACK-8750 2015-08-28 22:35:08 -03:00
Rajani Karuturi
f5a7395cc2 Merge pull request #752 from ustcweizhou/BasicRestClientTest-fakelocalhost
use fakelocalhost in BasicRestClientTestBasicRestClientTest will fail if the port 443 is open on localhost.
use fakelocalhost instead of localhost can fix it.
Please see the latest discussion in https://github.com/apache/cloudstack/pull/737

* pr/752:
  use fakelocalhost in BasicRestClientTest

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-08-28 22:12:42 +05:30
Koushik Das
724bb821a0 Merge pull request #629 from kansal/Coverity-18963
Coverity Issue: Null pointer dereferencing fixed

Signed-off-by: Koushik Das <koushik@apache.org>
2015-08-28 20:06:28 +05:30
Rajani Karuturi
ffd0b3bd0e Merge pull request #759 from ustcweizhou/CLOUDSTACK-8783
CLOUDSTACK-8783: specify ciphersuite SSL_DH_anon_WITH_3DES_EDE_CBC_SHA in MockServerTest.javaThe ciphersuite could be different on os.
Sometimes the MockServerTest fails due to the ciphersuite does not work (for instance misconfiguration).
SSL_DH_anon_WITH_3DES_EDE_CBC_SHA has 168-bit encryption and anonymous auth, which is suitable for SSL testing.

* pr/759:
  CLOUDSTACK-8783: specify ciphersuite SSL_DH_anon_WITH_3DES_EDE_CBC_SHA in MockServerTest.java

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-08-28 17:55:56 +05:30
Rajani Karuturi
cab57b248c Merge pull request #758 from miguelaferreira/put-back-CglibThrowableRenderer
Putting CglibThrowableRenderer.java back after it was removed in 83fd8f6Also removing the entry 'log/' from .gitignore since that was the culprit for the removal of the file.

This was detected in #714

* pr/758:
  Putting CglibThrowableRenderer.java back after it was removed in 83fd8f6

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-08-28 17:26:58 +05:30
Kshitij Kansal
fe7df96804 Coverity Issue: NUll Pointer dereferncing fixed and commits squashed. 2015-08-28 16:05:01 +05:30
Wei Zhou
0f70833dd8 CLOUDSTACK-8783: specify ciphersuite SSL_DH_anon_WITH_3DES_EDE_CBC_SHA in MockServerTest.java 2015-08-28 12:25:00 +02:00
Miguel Ferreira
4c1a5f7657 Putting CglibThrowableRenderer.java back after it was removed in 83fd8f6
Also removing the entry 'log/' from .gitignore since that was the
culprit for the removal of the file.
2015-08-28 11:18:44 +02:00
Wido den Hollander
a7418751c1 Merge pull request #757 from ustcweizhou/MariaDB-crash
Fix schema-421to430.sql issue after MariaDB upgrade@remibergsma @wido Can you test it?

* pr/757:
  Fix schema-421to430.sql issue after MariaDB upgrade

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-08-28 09:56:17 +02:00
Wei Zhou
99786516d7 Fix schema-421to430.sql issue after MariaDB upgrade 2015-08-27 16:21:22 +02:00
Remi Bergsma
da9cc334aa Merge pull request #746 from pdion891/fix-PR737
fix debian package after addition of license header in pom.xmlPR#737 add lines  in pom.xml which break debian build.
This fix debian package build issue.

* pr/746:
  fix debian package after addition of license header in pom.xml

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-27 14:12:30 +02:00
Koushik Das
e401d39d0b Merge pull request #741 from koushik-das/code_cleanup
messages: Removed unused agent command AttachVolumeCommand and corresponding answer AttachVolumeAnswer

These types are not used anywhere in the orchestration layer.

Signed-off-by: Koushik Das <koushik@apache.org>
2015-08-27 17:13:25 +05:30
Rohit Yadav
61da853465 Merge pull request #749 from shapeblue/master-br-i18n-fix
messages: fix string in pt_BR translation fileThe string error caused JS error that failed translation on the UI

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

* pr/749:
  messages: fix string in pt_BR translation file

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-27 14:11:21 +05:30
Wei Zhou
5e792e33ec use fakelocalhost in BasicRestClientTest 2015-08-27 10:32:57 +02:00
Rohit Yadav
54cbf6f9f3 messages: fix string in pt_BR translation file
The string error caused JS error that failed translation on the UI

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-27 10:46:36 +05:30
Remi Bergsma
8221ebd15f Merge pull request #740 from shapeblue/CLOUDSTACK-8766-master
CLOUDSTACK-8766: Fix infinite scrolling pagination for zonal template listing

Uses listViewDataProvider to implement pagination on listTemplates API
requests in the UI, when a template's zone tab is viewed.

(cherry picked from commit 95c76efc3944aab9a620559a026fe37e53d8f53d)

This from the other PR, for master branch.

* pr/740:
  CLOUDSTACK-8766: Fix infinite scrolling pagination for zonal template listing

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-27 01:08:11 +02:00
Remi Bergsma
eb60ac976b Merge pull request #747 from schubergphilis/fix/broken_profiler_unit_test
Removing unit test that was failing to cover the resolution of the nano time   - The difference between 2 consecutive calls to System.nanoTime() returns a resolution that depends on the OS implementation. Due to that, the test was failing in an intermittent manner.
   - Today we decided to remove the test since it was not testing a direct feature of ACS

I did not create an issue on Jira because it's only about removing an unit test. There is no bug fix involved or feature developed.

@miguelaferreira @remibergsma @bhaisaab @DaanHoogland

Could you have a look at this change, please?

Cheers,
Wilder

* pr/747:
  Removing unit test that was covering the resolution of the nano time

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-26 22:50:06 +02:00
wilderrodrigues
d74d134698 Removing unit test that was covering the resolution of the nano time
- The difference between 2 consecultive calls to System.nanoTime() returns a resolution that depends on the OS implementation. Due to that, the test was failing in an inttermmitent manner
   - Today we decided to remove the test since it was not testing a direct feature of ACS
2015-08-26 20:00:59 +02:00
manasaVeloori
cc9c868590 verify that when createTemplate is ued to create templates with same name, all of them fet unique_name under vm_template table so that templates with same name does not get deleted during template sync
This closes #688
2015-08-26 17:43:14 +05:30
Pierre-Luc Dion
2dca038bf9 fix debian package after addition of license header in pom.xml 2015-08-26 08:03:55 -04:00
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
Rohit Yadav
e2a0d18a84 Merge pull request #696 from iwebhosting/rbd-live-resize
Default to notify only script to handle non-CLVM/QCOW cases.This relates to [CLOUDSTACK-8732](https://issues.apache.org/jira/browse/CLOUDSTACK-8732)

Before this commit the call to `getResizeScriptType` would throw an exception (earlier versions returned `null`, which was fine) - this caused the RBD case to fail. By changing the default to notify only we fix the case for any non-CLVM and non-QCOW cases, too.

This is RBD for now, but this should extend to new storage types supported by Libvirt natively in future.

This is my first attempted contribution: I can see a case for adding RBD logic to the actual getResizeScriptType call, too, but I felt that putting it `LibvirtResizeVolumeCommandWrapper.java` kept the special-casing of RBD (and comments about that) in one place.

### Caveat:

With Libvirt 1.2.2 this actually doesn't do the right thing - but it does do what the documentation *says* should be the right thing, so I'm going to test if this is a Libvirt bug which is fixed in a later version.

(To make it work I need to execute something like:

    virsh blockresize --path vda --size 100G i-7-44-VM

where vda is the path as far as the *guest* is concerned, and not an `rbd/` path - which *should* work, but doesn't.)

* pr/696:
  Default to notify only script to handle non-CLVM/QCOW cases.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 16:00:01 +05:30
Rajani Karuturi
46a5f4bc91 Merge pull request #745 from nlivens/CLOUDSTACK-8773
CLOUDSTACK-8773 : NPE in CheckRouterTask, when a DomainRouter happens to be expunged at the same time

* pr/745:
  CLOUDSTACK-8773 : NPE in CheckRouterTask, when a DomainRouter happens to be expunged at the same time

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-08-26 15:54:43 +05:30
Likitha Shetty
f499281625 CLOUDSTACK-8602. MigrateVirtualMachineWithVolume leaves old chain data for volume. Update chain info of a volume after migration.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #548
2015-08-26 15:15:53 +05:30
Likitha Shetty
cb50d1d827 CLOUDSTACK-8610. Unable to attach 7th Disk to Windows Server 2012 R2 instance. During disk attach, while trying to obtain the controller key for SCSI controller, look for device with the generic SCSI controller type i.e. VirtualSCSIController.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #554
2015-08-26 15:14:24 +05:30
Rohit Yadav
6e5d4a60da Merge pull request #665 from pritisarap12/CLOUDSTACK-8716-Verify-creation-of-snapshot-from-volume-when-the-task-is-performed-repeatedly-in-zone-wide-primary-Storage
CLOUDSTACK-8716: Verify creation of snapshot from volume when the task is performed repeatedly in zone wide primary StorageOn VMWare with a Zone wide primary storage and more than two clusters verify successful creation of snapshot multiple times.

* pr/665:
  CLOUDSTACK-8716: Verify creation of snapshot from volume when the task is performed repeatedly in zone wide primary Storage

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 15:11:27 +05:30
Rohit Yadav
8252dbd006 Merge pull request #675 from pritisarap12/CLOUDSTACK-8723-Verify-API-call-listUsageRecords-returns-usage-of-new-volume-created-after-restore-VM
CLOUDSTACK-8723: Verify API call "listUsageRecords" returns usage of new volume created after restore VMAfter restoring a running VM current ROOT disk gets destroyed and new ROOT disk gets created.
This testcase is to check if volume usage of this newly created volume is listed in listUsageRecords API.

* pr/675:
  CLOUDSTACK-8723: Verify API call "listUsageRecords" returns usage of new volume created after restore VM

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 15:11:11 +05:30
Remi Bergsma
002296ac4f Merge pull request #736 from ustcweizhou/CLOUDSTACK-8765
CLOUDSTACK-8765: fix vm migration failure due to different dev name on KVM

* pr/736:
  CLOUDSTACK-8765: fix vm migration failure due to different dev name on KVM

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-26 11:29:25 +02:00
Rohit Yadav
65e9ea9988 Merge pull request #729 from shwetaag/router
CLOUDSTACK-8757:FTP modules are not loaded in VRcheck bug 8757 for more details .

* pr/729:
  CLOUDSTACK-8757:FTP modules are not loaded in VR

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 14:47:19 +05:30
Nick Livens
c162897aef CLOUDSTACK-8773 : NPE in CheckRouterTask, when a DomainRouter happens to be expunged at the same time 2015-08-26 11:15:16 +02:00
Rohit Yadav
22fad9d515 Merge pull request #725 from koushik-das/CLOUDSTACK-8754
CLOUDSTACK-8754: VM migration triggered by dynamic scaling is failingThis is caused by serialization failure for VmWorkMigrateForScale object. Replaced DeployDestination member present in VmWorkMigrateForScale with serializable types.

Haven't added any unit test as couldn't find a clean way to do it. Simply adding a test to do (de)serialization won't help catch any new member addition to the type which breaks serializability.

* pr/725:
  CLOUDSTACK-8754: VM migration triggered by dynamic scaling is failing This is caused by serialization failure for VmWorkMigrateForScale object. Replaced DeployDestination member present in VmWorkMigrateForScale with serializable types.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 14:24:38 +05:30
Rohit Yadav
5d232ea3d9 Merge pull request #735 from shapeblue/kvm-linkbr-checks-master
CLOUDSTACK-8749: Add checks to prevent malformed/unexpected inputBased on @jburwell's comment on PR #718

* pr/735:
  CLOUDSTACK-8749: Add checks to prevent malformed/unexpected input

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 14:18:40 +05:30
Rohit Yadav
7e455fa2b7 CLOUDSTACK-8749: Add checks to prevent malformed/unexpected input
Based on @jburwell's comment on PR #718

This closes #735

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 13:34:21 +05:30
Rohit Yadav
462bb0654d CLOUDSTACK-8766: Fix infinite scrolling pagination for zonal template listing
Uses listViewDataProvider to implement pagination for listing templates and ISOs
in the zones tab. Dedupes isos and templates in the list views.

This closes #740

(cherry picked from commit 26700fbe766e06c3b953ee9ebae3f51ff1a08968)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 12:46:47 +05:30
Wei Zhou
858b6c0251 Merge pull request #730 from ustcweizhou/profiler-getDurationInMillis
CLOUDSTACK-8761: Replace some profiler.getDuration with profiler.getDurationInMillis after commit 5557ad55

This closes #730
2015-08-26 08:29:50 +02:00
Koushik Das
e1db6efc74 Removed unused agent command AttachVolumeCommand and corresponding answer AttachVolumeAnswer 2015-08-26 09:50:23 +05:30
Remi Bergsma
44ba14d17b Merge pull request #737 from miguelaferreira/feature/mferreira/ncx-follow-redirects-gardened-rebase
CLOUDSTACK-8758: Handle redirects in communication with NXS controller (a.k.a. Nicira NVP)When an NSX controller node is part of a cluster it will redirect API calls to the master controller. Because the ACS management server does not follow such redirects, if there is a change of master within a NSX cluster, the NSX device (a.k.a.  NiciraNvp) needs to be reconfigured (via the management server DB).

The goal of this PR is to enable ACS management server to follow HTTP redirects sent by NSX controllers. However, other changes were made to the cloud-utils module that provides the REST client that the NSX plugin uses.

Cosmetic changes:
* Upgrade maven module structure for cloud-utils and cloud-plugin-netowkr-nvp to comply with maven default
* Several refactorings on both modules to consistently format the code, remove unused code, declare final when possible, remove auto generated comments, etc

Other changes:
* Upgrade HTTP library used in REST client to version 4.5 of Apache HTTP Components
* Implement generic REST client that supports HTTP redirects
* Implement NSX specific REST client
* Simplify NSX api implementation
* Previously existing unit tests for both the REST client and NSX api were either maintained in the same test classes, moved to new test classes (because code under tests also moved), or removed (because code under tests was also removed)
* New Marvin tests for NSX controllers

Testing:
* Ran all unit tests present in the project
* Ran Java Integration tests for NSX api targeting both a master and a slave controller
* Ran new Marvin test for NSX controller
* Manual inspection of logs to confirm redirection is taking place

* pr/737:
  Use NSX specific RestClient in API implementation (NiciraNvpApi)
  Refactor NSX api implementation (NiciraNvpApi)
  Add NSX specific RestClient implementation
  Delegate HTTP protocol activity in RESTServiceConnector to RestClient
  Add basic RestClient implentation based on HTTP Components 4.5
  Code clean up in cloud-plugin-network-nvp project
  Code clean up in cloud-utils project
  Refactor cloud-plugin-network-nvp project into Maven default structure
  Refactor cloud-utils project into Maven default structure
  Fix unit-test library dependencies
  Add Marvin test for Nicira NVP plugin
  Create Nicira NVP devices and enable plugin at deploy

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-25 20:44:52 +02:00
Miguel Ferreira
09f7153378 Use NSX specific RestClient in API implementation (NiciraNvpApi)
- Simplify public API to return Lists instead of NiciraNvpLists
2015-08-25 17:36:17 +02:00
Miguel Ferreira
c6602ee151 Refactor NSX api implementation (NiciraNvpApi)
- Make internal method private
- Remove unused methods
- Refactor type deserialization adapter classes out
2015-08-25 17:36:16 +02:00
Miguel Ferreira
18e6b9ba78 Add NSX specific RestClient implementation
- Add -noverify JVM arg to surefire plugin, to allow Powermockito to
  de-encapsulate private methods
- Add dependency on cloud-utils test-jar to use custom HttpRequest
  matchers
2015-08-25 17:36:15 +02:00
Miguel Ferreira
de63b94f2d Delegate HTTP protocol activity in RESTServiceConnector to RestClient
- All HTTP protocol activities are now handled by RestClient
- This service is now only responsible for creating requests, and
  dispatching them to the client
- Provides a Simple API for creating, updating, retrieving and deleting
  objects
2015-08-25 17:36:14 +02:00
Miguel Ferreira
8a93bb8d2d Add basic RestClient implentation based on HTTP Components 4.5
- Upgrade version of HTTP Components to 4.5
- Add helper class to create Http clients
- Add helper class to build http requests
- Add enum with the different Http Methods
- Add constants class for HTTP related values
2015-08-25 17:36:13 +02:00
Miguel Ferreira
6e74ef8e40 Code clean up in cloud-plugin-network-nvp project
- Code formatting
- Declare final where possible
- Remove unused methods
- Remove throws declarations where not needed
- Remove generated comments (e.g. "TODO Auto-generated method stub")
2015-08-25 17:36:12 +02:00
Miguel Ferreira
5fc953eda2 Code clean up in cloud-utils project
- Code formatting
- Remove unused methods
2015-08-25 17:36:11 +02:00
Miguel Ferreira
93b0989dea Refactor cloud-plugin-network-nvp project into Maven default structure 2015-08-25 17:36:10 +02:00
Miguel Ferreira
83fd8f60f3 Refactor cloud-utils project into Maven default structure 2015-08-25 14:50:33 +02:00
Miguel Ferreira
3d27e9ed12 Fix unit-test library dependencies
- XML formatting
- Fix license header

- Reorder hamcrest, junit, mockito and powermock dependencies
  * Since several libraries include a subset of hamcrest classes,
    hamcrest should be declared first in the pom, inorder for its
    classes to be loaded first by the JVM
- Depdend on hamcrest-all and exclude hamcrest classes from other
  libraries
2015-08-25 14:50:31 +02:00