1876 Commits

Author SHA1 Message Date
Abhinandan Prateek
3b89cbe733 CLOUDSTACK-9350: KVM-HA- Fix CheckOnHost for Local storage
- Also skip HA on VMs that are using local storage
2016-04-29 12:38:33 +05:30
Will Stevens
12d8e53dd5 Merge pull request #1454 from shapeblue/host-maint
CLOUDSTACK-9323: Fix cancel host maintenance canFix cancel host maintenance so that if maintenance is cancelled the host come back to normal state gracefully.

Added marvin tests for host maintennace.

* pr/1454:
  CLOUDSTACK-9323: Fix Cancel maintenance so that if maintenance is cancelled the host come back to normal state gracefully. Added marvin tests for host maintennace.

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-04-28 16:05:10 -04:00
Will Stevens
a5ee4432e7 Merge release branch 4.8 to master
* 4.8:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated test_volumes.py to include a test for detaching and reattaching a root volume from a vm. I also had to update base.py to allow attach_volume to have the parameter deviceid to be passed as needed.
2016-04-28 16:04:20 -04:00
Will Stevens
d11194abec Merge release branch 4.7 to 4.8
* 4.7:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated test_volumes.py to include a test for detaching and reattaching a root volume from a vm. I also had to update base.py to allow attach_volume to have the parameter deviceid to be passed as needed.
2016-04-28 16:03:46 -04:00
Will Stevens
4db5e48f80 Merge pull request #1510 from shapeblue/4.9-mvn-version-safeupgradeonly
4.9 mvn version safeupgradeonlyUpgrades maven dependencies versions that can be safely upgraded without breaking console-proxy/crypto usage.

Bisected changes from: https://github.com/apache/cloudstack/pull/1397

cc @swill @DaanHoogland

* pr/1510:
  maven: fix dependency version support by JDK7
  further maven dependency updates from Daan
  framework/quota: fix checkstyle issue
  maven: Upgrade dependency versions

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-04-28 15:59:17 -04:00
Will Stevens
939e448227 Merge pull request #1458 from cloudsadhu/cloudsadhulocal
BUG-ID:CLOUDSTACK-9331:added code in marvin frame&new config file for advBaremetal support  Added code  in marvin framework&new config file  to support baremetal advanced testcases

* pr/1458:
  BUG-ID:CLOUDSTACK-9331:added code in marvin frame&new config file to support baremetal advanced testcases

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-04-25 15:55:09 -04:00
Will Stevens
9b525f51a2 Merge pull request #1452 from prashanthvarma/master
CLOUDSTACK-9322: Support for Internal LB fuctionality with Nuage VSP SDN Plugin including Marvin test coverageTask: https://issues.apache.org/jira/browse/CLOUDSTACK-9322

PR contents:
1) UI changes to support LB provider InternalLbVm during VPC offering creation.
2) Bug fix for CLOUDSTACK-9320.
3) Nuage VSP SDN Plugin related enhancements for VPC network functionality.
4) Marvin test coverage for Internal LB support on master with Nuage VSP SDN Plugin.
5) Enhancements on our exiting Marvin test code (nuagevsp plugins directory).
6) PEP8 & PyFlakes compliance with our Marvin test code.

Test run:
CloudStack$ nosetests --with-marvin --marvin-config=nuage_ant.cfg test/integration/plugins/nuagevsp/ -a tags=nuagevsp

Test results:
Test user data and password reset functionality with Nuage VSP SDN plugin ... === TestName: test_nuage_UserDataPasswordReset | Status : SUCCESS ===
ok
Test Nuage VSP VPC Offering with different combinations of LB service providers ... === TestName: test_01_nuage_internallb_vpc_Offering | Status : SUCCESS ===
ok
Test Nuage VSP VPC Network Offering with and without Internal LB service ... === TestName: test_02_nuage_internallb_vpc_network_offering | Status : SUCCESS ===
ok
Test Nuage VSP VPC Networks with and without Internal LB service ... === TestName: test_03_nuage_internallb_vpc_networks | Status : SUCCESS ===
ok
Test Nuage VSP VPC Internal LB functionality with different combinations of Internal LB rules ... === TestName: test_04_nuage_internallb_rules | Status : SUCCESS ===
ok
Test Nuage VSP VPC Internal LB functionality by performing (wget) traffic tests within a VPC ... === TestName: test_05_nuage_internallb_traffic | Status : SUCCESS ===
ok
Test Nuage VSP VPC Internal LB functionality with different LB algorithms by performing (wget) traffic tests ... === TestName: test_06_nuage_internallb_algorithms_traffic | Status : SUCCESS ===
ok
Test Nuage VSP VPC Internal LB functionality with restarts of VPC network components by performing (wget) ... === TestName: test_07_nuage_internallb_vpc_network_restarts_traffic | Status : SUCCESS ===
ok
Test Nuage VSP VPC Internal LB functionality with InternalLbVm appliance operations by performing (wget) ... === TestName: test_08_nuage_internallb_appliance_operations_traffic | Status : SUCCESS ===
ok
Test Basic VPC Network Functionality with Nuage VSP SDN plugin ... === TestName: test_nuage_vpc_network | Status : SUCCESS ===
ok
Test Nuage VSP SDN plugin with basic Isolated Network functionality ... === TestName: test_nuage_vsp | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 11 tests in 12094.705s

OK

Test run logs:
[results.txt](https://github.com/apache/cloudstack/files/187587/results.txt)
[runinfo.txt](https://github.com/apache/cloudstack/files/187588/runinfo.txt)

Test config file:
[nuage_ant.txt](https://github.com/apache/cloudstack/files/222711/nuage_ant.txt)

Note: Attached the Marvin config file as .txt instead of .cfg.

PEP8 & PyFlakes Compliance:
CloudStack$ pep8 --max-line-length=150 test/integration/plugins/nuagevsp/*.py
CloudStack$ pyflakes test/integration/plugins/nuagevsp/nuageTestCase.py
CloudStack$ pyflakes test/integration/plugins/nuagevsp/test_nuage_password_reset.py
CloudStack$ pyflakes test/integration/plugins/nuagevsp/test_nuage_vpc_internal_lb.py
CloudStack$ pyflakes test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
CloudStack$ pyflakes test/integration/plugins/nuagevsp/test_nuage_vsp.py
CloudStack$ pyflakes test/integration/plugins/nuagevsp/*.py

#CLOUDSTACK-9322

* pr/1452:
  CLOUDSTACK-9322 : Marvin tests for Internal Lb with Nuage VSP
  CLOUDSTACK-9320 : InternalLBVM is not getting destroyed when the last Internal Load Balancer rule is removed for the corresponding source IP address
  CLOUDSTACK-9322 : Changes to support InternalLbVm with Nuage VSP plugin

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-04-25 15:53:58 -04:00
Abhinandan Prateek
182ab648b5 CLOUDSTACK-9323: Fix Cancel maintenance so that if maintenance is cancelled the host come back to normal state gracefully.
Added marvin tests for host maintennace.
2016-04-25 15:28:32 +05:30
sadhu
5f16199813 BUG-ID:CLOUDSTACK-9331:added code in marvin frame&new config file to support baremetal advanced testcases 2016-04-23 11:42:28 +05:30
Daan Hoogland
101668994d further maven dependency updates from Daan
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-22 16:36:37 +05:30
Rohit Yadav
bb29b1d063 maven: Upgrade dependency versions
Updated most dependencies to latest minor releases, EXCEPT:

- Gson 2.x
- Major spring framework version
- Servlet version
- Embedded jetty version
- Mockito version (beta)
- Mysql lib minor version upgrade (breaks mysql-ha plugin)

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-22 16:20:16 +05:30
Mike Tutkowski
ba9a61a302 CLOUDSTACK-9354 - Fixing an issue in Marvin around creating a template from a snapshot (if “is public” is not provided, there was a problem) 2016-04-19 14:13:24 -06:00
David Mabry
0b7cc087f8 Let hypervisor type KVM and Simulator detach root volumes.
Updated test_volumes.py to include a test for detaching and reattaching a root volume from a vm. I also had to update base.py to allow attach_volume to have the parameter deviceid to be passed as needed.
2016-04-18 15:40:36 -05:00
Rohit Yadav
41e3b61245 travis: increase build verbosity
Outputs for modules that fail or succeed with unit tests results

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-09 03:12:12 +05:30
Rohit Yadav
87b431c0f3 travis: Fix simulator tests and optimize default global configs
- Migrate to trusty based Travis VMs
- Increase tests across five build matrices
- Fix xunit-reader output, include time
- Fix pip/python usage, pkg installation
- Build CloudStack in parallel with -T4
- Deploy database with optimized global settings

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-07 02:19:52 +05:30
sanjeevn
8daaa30fc8 [CLOUDSTACK-9337]Enhance vcenter.py to created data center in vcenter server automatically
(Programmatically)
2016-04-05 17:43:28 +05:30
Prashanth Manthena
de86c0cb17 CLOUDSTACK-9322 : Marvin tests for Internal Lb with Nuage VSP 2016-03-29 11:24:54 +02:00
Sowmya
3c8d3d0ee1 Add nuagevsp userdata testcase (Cloudstack-9095) & Refactor existing testcases 2016-03-08 18:13:24 -08:00
Remi Bergsma
3d9919ecfb Revert "Merge pull request #1011 from shwetaag/coreos"
This reverts commit 56859c99041c66d417bf0af9a93b1d6e1e79005b, reversing
changes made to cd71e05b1ef5fcae018f35dec30abbec1ea012f1.
2016-02-10 10:28:18 +01:00
sanjeev
56859c9904 Merge pull request #1011 from shwetaag/coreos
CLOUDSTACK-9012 :automation of cores feature test pathhttps://issues.apache.org/jira/browse/CLOUDSTACK-9012
Automated a full scenario of coreos guest OS support:
it includes registering coreos templates present at http://dl.openvm.eu/cloudstack/coreos/x86_64/
1. based on hypervisor types of zone
2. creating ssh key pair
3. creating a sample user data
4. creating a coreos virtual machine using this ssh keypair and userdata
5. verifying ssh access to coreo os machine using keypair and core username
6. verifying userdata is applied on virtual machine and the service asked in sample data is actually running
7. Verifying userdata in router vm as well

* pr/1011:
  added suggested changes to coreos automation
  automation of cores feature test path

Signed-off-by: sanjeev <sanjeev@apache.org>
2016-02-10 11:03:52 +05:30
shweta agarwal
94281f952d added suggested changes to coreos automation 2016-02-04 16:57:08 +05:30
Rohit Yadav
06fe7844db Merge pull request #1240 from shapeblue/master-9161
CLOUDSTACK-9161: fix the quota marvin test  1. Create a dummy user, as existing user may already have stale quota
  data
  2. fix the tests to use the dummy user
  3. a boundary condition was revealed and fixed for a new user where
  quota service has never run and created bootstrap entries

* pr/1240:
  CLOUDSTACK-9161: fix the quota marvin test

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-01-27 12:03:28 +01:00
Remi Bergsma
43ab98d823 Updating pom.xml version numbers for release 4.9.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-26 15:12:20 +01:00
Remi Bergsma
32fcc47117 Updating pom.xml version numbers for release 4.8.1-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-26 09:39:00 +01:00
Remi Bergsma
a4ac9d3fff Updating pom.xml version numbers for release 4.7.2-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-26 09:33:56 +01:00
Remi Bergsma
62f218b7bd Updating pom.xml version numbers for release 4.8.0
Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-20 23:43:35 +01:00
Remi Bergsma
ad420bb1df Merge pull request #1041 from pritisarap12/CLOUDSTACK-9041-Modifying-template-creation-from-snapshot-function-in-base.py
CLOUDSTACK-9041: Modifying template creation from snapshot function In create_from_snapshot function of Template class there is no parameter to accept if the template is public hence default it is creating private templates
Hence adding this parameter.

* pr/1041:
  CLOUDSTACK-9041: Modifying template creation from snapshot function in base.py

Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-17 13:37:03 +01:00
Remi Bergsma
75b68c6829 Merge release branch 4.7 to master
* 4.7:
  Fix unable to setup more than one Site2Site VPN Connection
  FIX S2S VPN rVPC: Check only redundant routers in state MASTER
  PEP8 of integration/smoke/test_vpc_vpn
  Add S2S VPN test for Redundant VPC
  Make integration/smoke/test_vpc_vpn Hypervisor independant
  FIX VPN: non-working ipsec commands
  [UI] MADNESS
  [DB] Add force_encap field to s2s_customer_gateway table
  [ROUTER] Add forceencaps field to python router ipsec config method
  [TEST] unittest needs rework
  [MARVIN] Add forceencap field to VpnCustomerGateway class in marvin base
  [CORE] Add Force UDP Encapsulation option to Site2Site VPN
  CLOUDSTACK-9186: Root admin cannot see VPC created by Domain admin user
  CLOUDSTACK-9192: UpdateVpnCustomerGateway is failing
  CLOUDSTACK-6485 prevent ip asignment of private gw iface
  CLOUDSTACK-9204 Do not error when staticroute is already gone
  make both check lines consistent
  CLOUDSTACK-9181 Prevent syntax error in checkrouter.sh
  CLOUDSTACK-9202 Bump ssh timeout
2016-01-16 19:54:41 +01:00
Michael Andersen
0b54871fa3 [MARVIN] Add forceencap field to VpnCustomerGateway class in marvin base 2016-01-07 19:27:42 +01:00
Miguel Ferreira
3dba689f31 Add helper method to migrate router vms 2015-12-24 16:07:06 -03:00
Miguel Ferreira
88774a93e8 Only set L2 Gateway in NSX device if defined 2015-12-24 16:07:06 -03:00
nvazquez
4ac2737754 CLOUDSTACK-9074: Marvin tests for NSX Shared Networks Support 2015-12-24 16:07:06 -03:00
Rohit Yadav
1a194e6745 README: happy holidays!
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-12-23 13:27:40 +05:30
Remi Bergsma
8f5a2920e8 Updating pom.xml version numbers for release 4.8.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-21 22:09:31 +01:00
Remi Bergsma
5b112408c7 Updating pom.xml version numbers for release 4.7.1-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-21 19:55:04 +01:00
Abhinandan Prateek
ccd0f22061 CLOUDSTACK-9161: fix the quota marvin test
1. Create a dummy user, as existing user may already have stale quota
  data
  2. fix the tests to use the dummy user
  3. a boundary condition was revealed and fixed for a new user where
  quota service has never run and created bootstrap entries

Quota Marvin: If the quota plugin is not enabled skip tests

Quota Service: Enable quota plugin in zone setup configuration

Quota: Moving test_quota.py the test to test/integration/plugins
    In most automated environment this test case will not run as it
    requires a mangement server restart to enable the plugin. Due to
    this requirement moving it to plugin folder. This condition is
    already documented in the test case.
2015-12-16 16:22:31 +05:30
Remi Bergsma
2f26a859a9 Updating pom.xml version numbers for release 4.7.0
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-13 21:09:53 +01:00
Remi Bergsma
c1533a1918 Merge pull request #1239 from remibergsma/fix-debian-changelog
build_asf.sh: fix debian changelog alteringThe script already adds a new entry so we shouldn't replace the
previous one. That is done only in the next version script.

As discussed with @DaanHoogland

* pr/1239:
  build_asf.sh: fix debian changelog altering

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-13 20:47:51 +01:00
Remi Bergsma
97b5e12704 build_asf.sh: fix debian changelog altering
The script already adds a new entry so we shouldn't replace the
previous one. That is done only in the next version script.
2015-12-13 20:41:56 +01:00
Remi Bergsma
9862b2c780 Merge pull request #1217 from milamberspace/L10N-update-before-4.7.0RC1
L10N update before 4.7.0 RC1Some sentences (mainly for the new quota plugin) needs to be translated before the 4.7.0 release candidate (planned for 14th december)
https://www.transifex.com/ke4qqq/CloudStack_UI/47xmessagesproperties/

Stats:
German (Germany)            100%
French (France)             100%
Portuguese (Brazil)          98%
Norwegian Bokml (Norway)    98%
Dutch (Netherlands)          98%
Chinese (China)              97%
Japanese (Japan)             97%
Hungarian                    96%
(only languages over 90%)

Ping me after adding the L10N strings into transifex, I will update this PR.

Thanks

cc @remibergsma @agneya2001 @DaanHoogland @nvazquez @barunhalder1234 @K0zka

* pr/1217:
  Update L10N resource files with 4.7 strings from Transifex (20151211)

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-13 19:41:44 +01:00
Remi Bergsma
e7030285a2 Merge pull request #1219 from DaanHoogland/CLOUDSTACK-9139
CLOUDSTACK-9139 make zwps default when defined on zone levelWhen a marvin definition contains a primary storage definition at zone level it will default to zone scope. A test run is underway.
using marvin config:
```
{
    "zones": [
        {
            "name": "MCCT-SHARED-1",
            "guestcidraddress": "10.1.1.0/24",
            "dns1": "8.8.8.8",
            "physical_networks": [
                {
                    "broadcastdomainrange": "Zone",
                    "vlan": "100-200",
                    "name": "mcct-pnet",
                    "traffictypes": [
                        {
                            "typ": "Guest"
                        },
                        {
                            "typ": "Management"
                        },
                        {
                            "typ": "Public"
                        }
                    ],
                    "providers": [
                        {
                            "broadcastdomainrange": "ZONE",
                            "name": "VirtualRouter"
                        },
                        {
                            "broadcastdomainrange": "ZONE",
                            "name": "VpcVirtualRouter"
                        },
                        {
                            "broadcastdomainrange": "ZONE",
                            "name": "InternalLbVm"
                        }
                    ],
                    "isolationmethods": [
                             "VLAN"
                    ]
                }
            ],
            "ipranges": [
                {
                    "startip": "192.168.23.2",
                    "endip": "192.168.23.20",
                    "netmask": "255.255.255.0",
                    "vlan": "50",
                    "gateway": "192.168.23.1"
                }
            ],
            "networktype": "Advanced",
            "pods": [
                {
                    "endip": "192.168.22.150",
                    "name": "MCCT-POD",
                    "startip": "192.168.22.130",
                    "netmask": "255.255.255.0",
                    "clusters": [
                    ],
                    "clusters": [
                        {
                            "clustername": "MCCT-KVM-1",
                            "hypervisor": "KVM",
                            "hosts": [
                                {
                                    "username": "root",
                                    "url": "http://kvm1",
                                    "password": "password"
                                },
                                {
                                    "username": "root",
                                    "url": "http://kvm2",
                                    "password": "password"
                                }
                            ],
                            "clustertype": "CloudManaged"
                        }
                    ],
                    "gateway": "192.168.22.1"
                }
            ],
            "internaldns1": "8.8.4.4",
            "secondaryStorages": [
                {
                    "url": "nfs://192.168.22.1:/data/storage/secondary/MCCT-SHARED-1",
                    "provider" : "NFS"
                }
            ],
            "primaryStorages": [
                {
                    "url": "nfs://192.168.22.1:/data/storage/primary/MCCT-KVM-1",
                    "name": "MCCT-KVM-1-primary",
                    "hypervisor": "kvm"
                }
            ]
        }
    ],
    "dbSvr": {
        "dbSvr": "localhost",
        "passwd": "cloud",
        "db": "cloud",
        "port": 3306,
        "user": "cloud"
    },
    "logger":
        {
            "LogFolderPath": "/tmp/"
        },
    "globalConfig": [
        {
            "name": "network.gc.wait",
            "value": "60"
        },
        {
            "name": "storage.cleanup.interval",
            "value": "300"
        },
        {
            "name": "vm.op.wait.interval",
            "value": "5"
        },
        {
            "name": "default.page.size",
            "value": "10000"
        },
        {
            "name": "network.gc.interval",
            "value": "60"
        },
        {
            "name": "workers",
            "value": "10"
        },
        {
            "name": "account.cleanup.interval",
            "value": "600"
        },
        {
            "name": "guest.domain.suffix",
            "value": "cloud"
        },
        {
            "name": "expunge.delay",
            "value": "60"
        },
        {
            "name": "vm.allocation.algorithm",
            "value": "firstfitleastconsumed"
        },
        {
            "name": "expunge.interval",
            "value": "60"
        },
        {
            "name": "expunge.workers",
            "value": "3"
        },
        {
            "name": "check.pod.cidrs",
            "value": "true"
        },
        {
            "name": "secstorage.allowed.internal.sites",
            "value": "192.168.22.0/24"
        },
        {
            "name": "direct.agent.load.size",
            "value": "1000"
        }
    ],
    "mgtSvr": [
        {
            "mgtSvrIp": "localhost",
            "passwd": "password",
            "user": "root",
            "port": 8096,
            "hypervisor": "KVM",
            "useHttps": "False",
            "certCAPath":  "NA",
            "certPath":  "NA"
        }
    ]
}
```
deploys succesful:
```
Deploy data center..

==== Log Folder Path: /tmp//MarvinLogs//DeployDataCenter__Dec_11_2015_16_27_55_AM5LVR. All logs will be available here ====

==== Deploy DC Started ====

=== Data Center Settings are dumped to /tmp//MarvinLogs//DeployDataCenter__Dec_11_2015_16_27_55_AM5LVR/dc_entries.obj===

====Deploy DC Successful=====
Fri Dec 11 16:32:02 GMT 2015
```

![screen shot 2015-12-11 at 17 37 12](https://cloud.githubusercontent.com/assets/2486961/11749410/e7d99db4-a02d-11e5-9a5b-e5d554a45945.png)

* pr/1219:
  CLOUDSTACK-9139 make zwps default when defined on zone level

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-12 21:02:08 +01:00
Milamber
6947afee3a Update L10N resource files with 4.7 strings from Transifex (20151211) 2015-12-12 18:57:10 +00:00
Remi Bergsma
bdaa60fd6c Merge release branch 4.6 to master
* 4.6:
  Show actual diff in commits after merge
  CLOUDSTACK-9113: skip vm with inconsistent state when getVmStats/getVmDiskStats
2015-12-12 14:03:43 +01:00
Remi Bergsma
52edbbb6cc Show actual diff in commits after merge 2015-12-12 11:22:32 +01:00
Wilder Rodrigues
590af145b0 CLOUDSTACK-9135 - Makes possible to add multiple providers per service
- Same is done in the Java side. Check the createVpcOffering() method in the VpcManagerImpl class
2015-12-11 15:02:55 +01:00
Daan Hoogland
9b89dfd643 CLOUDSTACK-9139 make zwps default when defined on zone level 2015-12-11 13:23:14 +01:00
Abhinandan Prateek
987fcbd441 CLOUDSTACK-8592: Implement Quota service
Quota service while allowing for scalability will make sure that the cloud is
not exploited by attacks, careless use and program errors. To address this
problem, we propose to employ a quota-enforcement service that allows resource
usage within certain bounds as defined by policies and available quotas for
various entities.  Quota service extends the functionality of usage server to
provide a measurement for the resources used by the accounts and domains using a
common unit referred to as cloud currency in this document. It can be configured
to ensure that your usage won’t exceed the budget allocated to accounts/domain
in cloud currency.  It will let user know how much of the cloud resources he is
using. It will help the cloud admins, if they want, to ensure that a user does
not go beyond his allocated quota. Per usage cycle if a account is found to be
exceeding its quota then it is locked. Locking an account means that it will not
be able to initiat e a new resource allocation request, whether it is more
storage or an additional ip. Needless to say quota service as well as any action
on the account is configurable.

Changes from Github code review:

- Added marvin test for quota plugin API
- removed unused commented code
- debug messages in debug enabled check
- checks for nulls, fixed access to member variables and feature
- changes based on PR comments
- unit tests for UsageTypes
- unit tests for all Cmd classes
- unit tests for all service and manager impls
- try-catch-finally or try-with-resource in dao impls for failsafe db switching
- remove dead code
- add missing quota calculation case (regression fixed)
- replace tabs with spaces in pom.xmls
- quota: though default value for quota_calculated is 0, the usage server
  makes it null while entering usage entries. Flipping the condition so
  as to acocunt for that.
- quotatypes: fix NPE in quota type
- quota framework test fixes
- made statement period configurable
- changed default email templates to reflect the fact that exhausted quota may not result in a locked account
- added quotaUpdateCmd that refreshes quota balances and sends alerts and statements
- report quotaSummary command returns quota balance, quota usage and state for all account
- made UI framework changes to allow for text area input in edit views
- process usage entries that have greater than 0 usage
- orocess quota entries only if tariff is non zero
- if there are credit entries but no balance entry create a dummy balance entry
- remove any credit entries that are before the last balance entry
  when displaying balance statement
- on a rerun the last balance is now getting added

FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Quota+Service+-+FS
PR: https://github.com/apache/cloudstack/pull/768

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-12-07 23:02:48 +05:30
Daan Hoogland
bbe891bfc3 Merge pull request #1086 from ustcweizhou/update-nic-ipaddr
CLOUDSTACK-9051: update nic IP address of stopped vmThis provides the feature to change ip address of NIC on a stopped vm by API and UI.

* pr/1086:
  CLOUDSTACK-9051: reprogram network as a part of vm nic ip update
  CLOUDSTACK-9051: add unit tests for UpdateVmNicIp
  CLOUDSTACK-9051: update nic IP address of stopped vm

Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-12-06 19:37:04 +01:00
Remi Bergsma
7e902cd505 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9075 - Uses the same vlan since it should have been already released
  CLOUDSTACK-9075 - Adds VPC static routes test
  CLOUDSTACK-9075 - Covers Private GW ACL with Redundant VPCs
  CLOUDSTACK-9075 - Add method to get list of Physical Networks per zone
  CLOUDSTACK-6276 Removing unused parameter in integration test for projects
  CLOUDSTACK-6276 Removing unused parameter in integration test
  CLOUDSTACK-6276 Fixing affinity groups for projects
2015-12-03 20:42:41 +01:00
Remi Bergsma
9a21873c4a Merge pull request #1134 from pdube/CLOUDSTACK-6276
CLOUDSTACK-6276 Fixing affinity groups for projectsWith some contributions from @resmo and @ustcweizhou.
This closes https://github.com/apache/cloudstack/pull/508

To test manually (need at least 2 hosts):
Create a project
Create an affinity group in that project
Deploy a vm with that affinity group
Deploy a second vm with that affinity group
They should be on different hosts

Ran old and new tests for affinity groups on the simulator

Test create affinity group as admin in project ... === TestName: test_01_admin_create_aff_grp_for_project | Status : SUCCESS ===
ok
Test create affinity group as domain admin for projects ... === TestName: test_02_doadmin_create_aff_grp_for_project | Status : SUCCESS ===
ok
Test create affinity group as user for projects ... === TestName: test_03_user_create_aff_grp_for_project | Status : SUCCESS ===
ok
Test create affinity group that exists (same name) for projects ... === TestName: test_4_user_create_aff_grp_existing_name_for_project | Status : SUCCESS ===
ok
#Delete Affinity Group by id. ... === TestName: test_01_delete_aff_grp_by_id | Status : SUCCESS ===
ok
#Delete Affinity Group by id should fail for user not in project ... === TestName: test_02_delete_aff_grp_by_id_another_user | Status : SUCCESS ===
ok
test DeployVM in anti-affinity groups ... === TestName: test_01_deploy_vm_anti_affinity_group | Status : SUCCESS ===
ok
test DeployVM in anti-affinity groups with more vms than hosts. ... === TestName: test_02_deploy_vm_anti_affinity_group_fail_on_not_enough_hosts | Status : SUCCESS ===
ok
List affinity group for a vm for projects ... === TestName: test_01_list_aff_grps_for_vm | Status : SUCCESS ===
ok
List multiple affinity groups associated with a vm for projects ... === TestName: test_02_list_multiple_aff_grps_for_vm | Status : SUCCESS ===
ok
List affinity groups by id for projects ... === TestName: test_03_list_aff_grps_by_id | Status : SUCCESS ===
ok
List Affinity Groups by name for projects ... === TestName: test_04_list_aff_grps_by_name | Status : SUCCESS ===
ok
List Affinity Groups by non-existing id for projects ... === TestName: test_05_list_aff_grps_by_non_existing_id | Status : SUCCESS ===
ok
List Affinity Groups by non-existing name for projects ... === TestName: test_06_list_aff_grps_by_non_existing_name | Status : SUCCESS ===
ok
List affinity group should list all for a vms associated with that group for projects ... === TestName: test_07_list_all_vms_in_aff_grp | Status : SUCCESS ===
ok
Update the list of affinityGroups by using affinity groupids ... === TestName: test_01_update_aff_grp_by_ids | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 16 tests in 581.706s

OK

Deploy vm as Admin in Affinity Group belonging to regular user (should fail) ... === TestName: test_01_deploy_vm_another_user | Status : SUCCESS ===
ok
Create Affinity Group as admin for regular user ... === TestName: test_02_create_aff_grp_user | Status : SUCCESS ===
ok
List Affinity Groups as admin for all the users ... === TestName: test_03_list_aff_grp_all_users | Status : SUCCESS ===
ok
List Affinity Groups belonging to admin user ... === TestName: test_04_list_all_admin_aff_grp | Status : SUCCESS ===
ok
List Affinity Groups belonging to regular user passing account id and domain id ... === TestName: test_05_list_all_users_aff_grp | Status : SUCCESS ===
ok
List Affinity Groups belonging to regular user passing group id ... === TestName: test_06_list_all_users_aff_grp_by_id | Status : SUCCESS ===
ok
Delete Affinity Group belonging to regular user ... === TestName: test_07_delete_aff_grp_of_other_user | Status : SUCCESS ===
ok
Test create affinity group as admin ... === TestName: test_01_admin_create_aff_grp | Status : SUCCESS ===
ok
Test create affinity group as domain admin ... === TestName: test_02_doadmin_create_aff_grp | Status : SUCCESS ===
ok
Test create affinity group as user ... === TestName: test_03_user_create_aff_grp | Status : SUCCESS ===
ok
Test create affinity group that exists (same name) ... === TestName: test_04_user_create_aff_grp_existing_name | Status : SUCCESS ===
ok
Test create affinity group with existing name but within different account ... === TestName: test_05_create_aff_grp_same_name_diff_acc | Status : SUCCESS ===
ok
Test create affinity group of non-existing type ... === TestName: test_06_create_aff_grp_nonexisting_type | Status : SUCCESS ===
ok
Delete Affinity Group by name ... === TestName: test_01_delete_aff_grp_by_name | Status : SUCCESS ===
ok
Delete Affinity Group as admin for an account ... === TestName: test_02_delete_aff_grp_for_acc | Status : SUCCESS ===
ok
Delete Affinity Group which has vms in it ... === TestName: test_03_delete_aff_grp_with_vms | Status : SUCCESS ===
ok
Delete Affinity Group with id which does not belong to this user ... === TestName: test_05_delete_aff_grp_id | Status : SUCCESS ===
ok
Delete Affinity Group by name which does not belong to this user ... === TestName: test_06_delete_aff_grp_name | Status : SUCCESS ===
ok
Delete Affinity Group by id. ... === TestName: test_08_delete_aff_grp_by_id | Status : SUCCESS ===
ok
Root admin should be able to delete affinity group of other users ... === TestName: test_09_delete_aff_grp_root_admin | Status : SUCCESS ===
ok
Deploy VM without affinity group ... === TestName: test_01_deploy_vm_without_aff_grp | Status : SUCCESS ===
ok
Deploy VM by aff grp name ... === TestName: test_02_deploy_vm_by_aff_grp_name | Status : SUCCESS ===
ok
Deploy VM by aff grp id ... === TestName: test_03_deploy_vm_by_aff_grp_id | Status : SUCCESS ===
ok
test DeployVM in anti-affinity groups ... === TestName: test_04_deploy_vm_anti_affinity_group | Status : SUCCESS ===
ok
Deploy vms by affinity group id ... === TestName: test_05_deploy_vm_by_id | Status : SUCCESS ===
ok
Deploy vm in affinity group of another user by name ... === TestName: test_06_deploy_vm_aff_grp_of_other_user_by_name | Status : SUCCESS ===
ok
Deploy vm in affinity group of another user by id ... === TestName: test_07_deploy_vm_aff_grp_of_other_user_by_id | Status : SUCCESS ===
ok
Deploy vm in multiple affinity groups ... === TestName: test_08_deploy_vm_multiple_aff_grps | Status : SUCCESS ===
ok
Deploy multiple vms in multiple affinity groups ... === TestName: test_09_deploy_vm_multiple_aff_grps | Status : SUCCESS ===
ok
Deploy VM by aff grp name and id ... === TestName: test_10_deploy_vm_by_aff_grp_name_and_id | Status : SUCCESS ===
ok
List affinity group for a vm ... === TestName: test_01_list_aff_grps_for_vm | Status : SUCCESS ===
ok
List multiple affinity groups associated with a vm ... === TestName: test_02_list_multiple_aff_grps_for_vm | Status : SUCCESS ===
ok
List affinity groups by id ... === TestName: test_03_list_aff_grps_by_id | Status : SUCCESS ===
ok
List Affinity Groups by name ... === TestName: test_04_list_aff_grps_by_name | Status : SUCCESS ===
ok
List Affinity Groups by non-existing id ... === TestName: test_05_list_aff_grps_by_non_existing_id | Status : SUCCESS ===
ok
List Affinity Groups by non-existing name ... === TestName: test_06_list_aff_grps_by_non_existing_name | Status : SUCCESS ===
ok
List affinity group should list all for a vms associated with that group ... === TestName: test_07_list_all_vms_in_aff_grp | Status : SUCCESS ===
ok
Update the list of affinityGroups by using affinity groupids ... === TestName: test_01_update_aff_grp_by_ids | Status : SUCCESS ===
ok
Update the list of affinityGroups by using affinity groupnames ... === TestName: test_02_update_aff_grp_by_names | Status : SUCCESS ===
ok
Update the list of affinityGroups for vm which is not associated ... === TestName: test_03_update_aff_grp_for_vm_with_no_aff_grp | Status : SUCCESS ===
ok
Update the list of Affinity Groups to empty list ... SKIP: Skip - Failing - work in progress
Update the list of Affinity Groups on running vm ... === TestName: test_05_update_aff_grp_on_running_vm | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 42 tests in 976.432s

OK (SKIP=1)

* pr/1134:
  CLOUDSTACK-6276 Removing unused parameter in integration test for projects
  CLOUDSTACK-6276 Removing unused parameter in integration test
  CLOUDSTACK-6276 Fixing affinity groups for projects

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-03 20:10:16 +01:00