28263 Commits

Author SHA1 Message Date
Miguel Ferreira
98dd771702 Add Marvin test for Nicira NVP plugin 2015-08-25 14:50:30 +02:00
Miguel Ferreira
abb824e3db Create Nicira NVP devices and enable plugin at deploy 2015-08-25 14:50:29 +02:00
Remi Bergsma
2772e4da82 Merge pull request #738 from michaelandersen/vpc_defaultroute_fix
CLOUDSTACK-8685: Fix for missing defaultroute on VPC router https://issues.apache.org/jira/browse/CLOUDSTACK-8685

Refactored CsRoute and CsAddress to:
 - add methods to add and verify the defaultroute
 - renamed methods flush, add, and routeTable to flush_table, add_route, add_table respectively.

Added some suboptimal unit tests to TestCsRoutes

* pr/738:
  Fixed defaultroute on VPC routers in CsRoute and CsAddress Refactored CsRoute
  pep8 cleanup

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-25 10:37:27 +02:00
Remi Bergsma
c0fde9a12b Merge pull request #731 from remibergsma/centos7-kvm
CLOUDSTACK-8443: Support CentOS 7 as KVM hypervisorThis adds support for CentOS 7 as a KVM hypervisor. As discussed in the Jira issue, the root cause of the issue was the `cloudstack-setup-agent` script that added this line to `/etc/libvirt/qemu.conf`:

`cgroup_controllers=["cpu"]`

On CentOS 6 this 'works', but since by default no cgroups are mounted, this setting is ignored by `libvirtd`. On CentOS 7 is does not work, because the `cpu` and `cpuacct` are 'co-mounted'. This simpy means you cannot use one without the order. The config line above instructs `libvirtd` to only use the `cpu` cgroup, which it can't.

There was code added to make sure the `cpu` cgroup was not co-mounted. It did this with a shell script, but after a reboot it was gone. It wasn't reliable and not even a solution at all. I went ahead and removed the code, because the co-mounted cgroups work fine. The real issue was the config line we put in `/etc/libvirt/qemu.conf` so much better to fix that instead.

The default for `libvirtd` is to use only cgroups that are mounted. When you remove the 'cgroup_controllers' line, the default kicks in. According to the `qemu.conf` file, the default is:

`cgroup_controllers = ["cpu", "devices", "memory", "blkio", "cpuacct", "net_cls"]`

Then again, if it's not mounted, it's not used. So, that's a nice way to control it.
This works just fine for both RHEL/CentOS 6 and RHEL/CentOS 7.

Along the debugging, I came across some small issues here and there which I also fixed in this PR.

If you test this, be sure to build RPMs from this branch and install those on the KVM hypervisor.

At Schuberg Philis we run KVM hypervisors on CentOS 7 for months with these fixes. Now I took the time to fix the issues in CloudStack, rather than work around them.

@bhaisaab @karuturi could you please review this? Thanks!

Please note:
The next step is to fix CLOUDSTACK-8625 (Systemd profile for KVM Agent) as currently a sysvinit script is still used. Although it works, we do not have any systemd benefits. As it is a separate issue, I'll try to address it in a separate PR.

* pr/731:
  CLOUDSTACK-8443: detect CentOS 7.x as RHEL 7 alike
  CLOUDSTACK-8443: mention the correct logfile
  CLOUDSTACK-8443: display the right hypervisor type
  CLOUDSTACK-8443: don't try to fix co-mounted cgroups

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-25 10:32:27 +02:00
Remi Bergsma
a527d27299 Merge pull request #734 from remibergsma/git-pr-errormsg
Git PR merge script improvementsProcessed feedback from @bhaisaab and (a colleague of) @karuturi

- make the help message better (I also updated Confluence)
- make sure we can use it on other repo's as well (Documentation and such)

Tested it and works fine for me.

* pr/734:
  fixed hardcoded merge message location
  fix bug where the countdown would be on multiple lines
  make it work with any Apache repository mirrored on GitHub
  Improve error/help message in case of missing git remote

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-24 22:15:36 +02:00
Remi Bergsma
1e6df1b775 fixed hardcoded merge message location
This would be empty if run from another directory, resulting
in a merge message with only a 'signed-off by' line.
2015-08-24 16:16:16 +02:00
Remi Bergsma
9a24109f95 fix bug where the countdown would be on multiple lines
Example of problem:

ATTENTION: Merging pull request #731 from remibergsma/centos7-kvm into 'master' branch in 5 seconds. CTRL+c to abort..
-n 5
-n 4
-n 3
-n 2
-n 1
-n 0

Should be compatible with more environments if printf is used instead.
2015-08-24 16:00:48 +02:00
Remi Bergsma
fed5c2b06a make it work with any Apache repository mirrored on GitHub 2015-08-24 16:00:30 +02:00
Remi Bergsma
0a320c18d4 CLOUDSTACK-8443: detect CentOS 7.x as RHEL 7 alike 2015-08-24 15:51:14 +02:00
Remi Bergsma
b29ffa2cfe CLOUDSTACK-8443: mention the correct logfile 2015-08-24 15:51:14 +02:00
Remi Bergsma
778b828af0 CLOUDSTACK-8443: display the right hypervisor type 2015-08-24 15:51:13 +02:00
Remi Bergsma
87fdb521f0 CLOUDSTACK-8443: don't try to fix co-mounted cgroups
This setting works on CentOS 6 / RHEL 6 but does nothing, as
"cpu" cgroup is not mounted. On CentOS 7 / RHEL 7 systemd does
mount cgroups and "cpu" is co-mounted with "cpuacc". Hence, if
we specify "cpu" then this results in an error because it can
only use them both, or none.

By removing the setting, we rely on the default of qemu, which
is:
cgroup_controllers = ["cpu", "devices", "memory", "blkio", "cpuacct", "net_cls"]

Only if they are really mounted, they will be used. So, this will
work on both version 6 and 7.

The 'fix script' didn't work well, as after a reboot you'd still have qemu
throwing errors. Now we can handle the co-mountedcgroups.
2015-08-24 15:49:40 +02:00
Michael Andersen
a9eb4ba5c9 Fixed defaultroute on VPC routers in CsRoute and CsAddress
Refactored CsRoute
2015-08-24 13:35:29 +02:00
Michael Andersen
bb93a61ee7 pep8 cleanup 2015-08-24 13:35:01 +02:00
Remi Bergsma
23b9365996 Improve error/help message in case of missing git remote 2015-08-24 11:52:03 +02:00
Miguel Ferreira
82df5b156b Add UUIDs to constructors (fixing syntax error from 2a6c7f3)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #722
2015-08-24 14:12:49 +05:30
Miguel Ferreira
20be6c24f7 Formatting class CitrixRequestWrapperTest
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-24 14:12:49 +05:30
Rohit Yadav
38c9dea9c1 CLOUDSTACK-8748: VM UUID accessible in CreateVMSnapshotCommand and RevertToVMSnapshotCommand
This patch makes it possible to expose VM UUID to subsystems, this can be
useful for implementing VM Snapshots for KVM in future.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-24 14:12:49 +05:30
Koushik Das
e7ddbd4980 Signed-off-by: Koushik Das <koushik@apache.org> 2015-08-24 10:10:19 +05:30
Remi Bergsma
6d57a86cb9 Merge pull request #726 from borisroman/NicVORegression
Fix for the NicVO.java regression.Renamed set*() methods to correct naming.

* pr/726:
  Fix for the NicVO.java regression.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-21 23:16:42 +02:00
Rajani Karuturi
aea9d4b2af Merge pull request #723 from radu-stefanache/typo_fixes
More typosSome more typos that I've found .

* pr/723:
  More typos

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-08-21 17:56:02 +05:30
Boris Schrijver
4b88eabef1 Fix for the NicVO.java regression.
Renamed set*() methods to correct naming.
2015-08-21 14:03:00 +02:00
radu-stefanache
c7a3ad4dc0 More typos 2015-08-20 13:04:29 +01:00
Remi Bergsma
614ee494ee Merge pull request #700 from rafaelweingartner/master-lrg-cs-hackday-001
Removed duplicate code in CitrixResourceBase and its subclassesRemoved unnecessary duplicated code by having the body of the getPatchFiles method only in the CitrixResourceBase superclass. Given that all of its implementations consisted of the same code except for the path which contains the necessary file for that implementation. An abstract method getPatchFilePath was created in the CitrixResourceBase superclass so that each implementation may return the path containing the specific file needed by that implementation.

Test cases were created for each implementation, simple as they may be. One assert is made to verify that the path returned by each implementation corresponds to the path that was previously specified on each getPatchFiles implementation.

* pr/700:
  Removed duplicate code in CitrixResourceBase.getPatchFiles

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-20 11:20:00 +02:00
Remi Bergsma
9229f35942 Merge pull request #721 from miguelaferreira/git-merge-scripts
Add scripts to merge PRs and release fixes forwardAs it is now, additions to CloudStack need to go through a GitHub PR and, if accepted, merged to the Apache remote (not in GitHub). This means that merging a PR for CloudStack is a bit more involved than merging a normal GitHub PR. In addition to that, a PR that fixes something in an older release needs to be merged against a release branch, and then forward merged up to master (if applicable).

To help with these two kinds of merges, @remibergsma, @karuturi, @DaanHoogland and myself, have created two scripts (contributed in this PR).

One script (**git-pr**) helps in merging a PR from GitHub to the Apache remote. The script will read the PR info using GitHub's API and will create a merge commit that contains the same commit message a normal GitHub PR merge commit, plus, as extra info, a list of commits that are being merged.

The other script (**git-fwd-merge**) will create a specific merge commit message that indicates a forward merge, and lists the commits being merged.

This Apache wiki [page](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61311655) describes how to use these two scripts, and points to an even more detailed [page](https://github.com/schubergphilis/cloudstack-git-tree-manipulation/wiki) that explains the merge scenarios step-by-step.

By the way, beacause both scripts follow the naming convention for git tools, as long as they are in your "path" you can execute them as simply as "git pr" and "git fwd-merge". But be aware that, in order to use these scripts, you should make sure to remove any aliases that can cause a name clash.

* pr/721:
  Add git merge scripts

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-20 07:32:10 +02:00
Remi Bergsma
044e685c92 Revert "CLOUDSTACK-8748: VM UUID accessible in CreateVMSnapshotCommand and RevertToVMSnapshotCommand"
This reverts commit 180afe52e555f2610e81ccee1b2f1551b7b7f5e8.

This broke the build on master:
master build broken with the below error http://jenkins.buildacloud.org/job/build-master-slowbuild/2101/consoleText

   ```
   [INFO] -------------------------------------------------------------
   [ERROR] COMPILATION ERROR :
   [INFO] -------------------------------------------------------------
   [ERROR] /home/jenkins/acs/workspace/build-master-slowbuild/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixRequestWrapperTest.java:[1581,51] error: constructor CreateVMSnapshotCommand in class CreateVMSnapshotCommand cannot be applied to given types;
   [ERROR]   required: String,String,VMSnapshotTO,List<VolumeObjectTO>,String
     found: String,VMSnapshotTO,List<VolumeObjectTO>,String
     reason: actual and formal argument lists differ in length
   /home/jenkins/acs/workspace/build-master-slowbuild/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixRequestWrapperTest.java:[1623,53] error: no suitable constructor found for RevertToVMSnapshotCommand(String,VMSnapshotTO,List<VolumeObjectTO>,String)
   [INFO] 2 errors
   [INFO] -------------------------------------------------------------
   ```

This was PR #717 towards 4.5
2015-08-20 07:21:27 +02:00
Rohit Yadav
180afe52e5 CLOUDSTACK-8748: VM UUID accessible in CreateVMSnapshotCommand and RevertToVMSnapshotCommand
This patch makes it possible to expose VM UUID to subsystems, this can be
useful for implementing VM Snapshots for KVM in future.

This was PR #717 towards 4.5

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

(cherry picked from commit 0062ff2672e257f2a4290e054e23ef4333a34983)
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-19 19:24:56 +02:00
Rohit Yadav
3fd35dd4a7 CLOUDSTACK-8749: KVM - cleanup linklocal interface based on names
This tries to avoid cleaning by a device name.

This closes #718

(cherry picked from commit 74f697a2dd6e2630fa1fa5949e41c7d539015fbf)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-19 21:43:24 +05:30
Remi Bergsma
b913c881a4 Merge pull request #719 from remibergsma/centos7-cgroup-cmount
Apply RHEL 7 fix for comounted cgroups to CentOS 7 KVM hypervisors as wellThe RHEL 7 version string is hard coded and misses CentOS 7.

* pr/719:
  RHEL 7 and CentOS 7 need the same fix
  fixing white space and formatting

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-19 17:46:52 +02:00
Miguel Ferreira
9211202bab Add git merge scripts 2015-08-19 17:22:45 +02:00
Remi Bergsma
d1cb4c7d50 RHEL 7 and CentOS 7 need the same fix 2015-08-19 16:30:24 +02:00
Remi Bergsma
14013d5d1b fixing white space and formatting 2015-08-19 16:24:44 +02: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
Rajani Karuturi
48bed3f340 Merge pull request #699 from milamberspace/L10N-update-updateMaster-20150814
Update L10N resource files on master branch with 4.6 translation strings from Transifex (20150814)

* pr/699:
  Update L10N resource files on master branch with 4.6 translation strings from Transifex (20150814)

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-08-19 14:05:17 +05:30
Rajani Karuturi
ef563c5526 Merge pull request #712 from milamberspace/CLOUDSTACK-8744-AnotherMissingL10N-4-master
CLOUDSTACK-8744 Add missing localization (l10n) for several parts in the UI

- l10n for the SSH Key Pairs behavior
- l10n for Autoscaling / LB sections
- l10n for Reset password
- l10n on some strings for the installation Wizard
- l10n on some strings in VPN/VPC section
- l10n on Service offerings sections
- improve some FR translations

* pr/712:
  CLOUDSTACK-8744 Add missing localization (l10n) for several parts in the UI - l10n for the SSH Key Pairs behavior - l10n for Autoscaling / LB sections - l10n for Reset password - l10n on some strings for the installation Wizard - l10n on some strings in VPN/VPC section - l10n on Service offerings sections - improve some FR translations

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-08-19 14:03:58 +05:30
Rajani Karuturi
ef783d9b1d Merge pull request #707 from borisroman/CLOUDSTACK-8736
Refactored Nic.java for readability.Only changed names and reorganized them! No functional implementation change.

See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.

* pr/707:
  Renamed internal variables of NicProfile.java to adhere to the naming convention.
  Refactored Nic.java for readability.

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-08-19 10:50:10 +05:30
Devdeep Singh
fedef2e6ca 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.
2015-08-19 10:06:54 +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
Remi Bergsma
3006b1614d Merge pull request #704 from resmo/feature/CLOUDSTACK-8740
CLOUDSTACK-8740: add custom.css to make custom UI styles easier

* pr/704:
  CLOUDSTACK-8740: add custom.css to make custom UI styles easier

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-18 17:57:11 +02:00
Remi Bergsma
4325574270 Merge pull request #703 from ksowmya/disablestorage_pep8
Disablestorage pep8CLOUDSTACK-8738: Added Maintenance mode related fixes into base.py for test_disablestoragepool.
Also fixed pep8 issues in script, most of them for E501 (long lines) with max-line-length set to default

Test Result:
Test Steps: ... === TestName: test_01_disable_enable_pool_1_host | Status : SUCCESS ===
ok
Test Steps: ... === TestName: test_01_disable_enable_pool_2_CLUSTER | Status : SUCCESS ===
ok
Test Steps: ... SKIP: No ZONE  storage pools found
Test Steps: ... === TestName: test_02_vm_operations_on_disabled_pool_1_host | Status : SUCCESS ===
ok
Test Steps: ... === TestName: test_02_vm_operations_on_disabled_pool_2_CLUSTER | Status : SUCCESS ===
ok
Test Steps: ... SKIP: No ZONE wide storage pools found
Test Steps: ... === TestName: test_01_cross_cluster_attach_disk | Status : SUCCESS ===
ok

* pr/703:
  Fixed pep8 issues
  CLOUDSTACK-8738: Added the two methods for enable and cancel maintenance mode on StoragePool

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-18 16:37:02 +02:00
Remi Bergsma
29f9e1db49 Merge pull request #711 from radu-stefanache/radu-stefanache-patch-1
Typo correctionCannnot != Cannot

* pr/711:
  Typo correction

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-18 16:20:38 +02:00
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
Milamber
267994fa0b CLOUDSTACK-8744 Add missing localization (l10n) for several parts in the UI
- l10n for the SSH Key Pairs behavior
- l10n for Autoscaling / LB sections
- l10n for Reset password
- l10n on some strings for the installation Wizard
- l10n on some strings in VPN/VPC section
- l10n on Service offerings sections
- improve some FR translations
2015-08-18 11:16:14 +01:00
Wido den Hollander
64a2cbdae6 Merge pull request #708 from radu-stefanache/master
Fixed typoSpotted this using Elasticsearch .

* pr/708:
  Typo correction

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-08-18 12:03:24 +02:00
Radu Stefanache
931e20c7f6 Typo correction
Cannnot != Cannot
2015-08-18 10:57:41 +01:00
Wido den Hollander
8a1d632273 Merge pull request #709 from borisroman/CLOUDSTACK-8742
Removed double encoding of Public Key from JS.See Cloudstack issue CLOUDSTACK-8742 & CLOUDSTACK-8649 for information.

* pr/709:
  Removed double encoding of Public Key from JS.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-08-18 11:43:36 +02:00
Boris Schrijver
f9e21da5dd Removed double encoding of Public Key from JS.
See Cloudstack issue CLOUDSTACK-8742 for information.
2015-08-17 22:56:17 +02:00
weingartner
ec8976f802 Removed duplicate code in CitrixResourceBase.getPatchFiles
@cristofolini comments:
Removed unnecessary duplicated code by having the body of the
getPatchFiles method only in the
CitrixResourceBase superclass. Given that all of its implementations
consisted of the same code
except for the path which contains the necessary file for that
implementation. An abstract method
getPatchFilePath was created in the CitrixResourceBase superclass so
that each implementation may
return the path containing the specific file needed by that
implementation.

Test cases were created for each implementation, simple as they may be.
One assert is made to verify
that the path returned by each implementation corresponds to the path
that was previously specified
on each getPatchFiles implementation.

removed trailing whitespace
2015-08-17 13:26:25 -03:00
Wido den Hollander
bc51a42fc2 Merge pull request #705 from borisroman/CLOUDSTACK-8736
Refactored NicProfile.java for readability.Only changed names and reorganized them! No functional implementation change.

See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.

* pr/705:
  Refactored NicProfile.java for readability.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-08-17 15:24:06 +02:00