9448 Commits

Author SHA1 Message Date
Remi Bergsma
a1d2c531f6 Merge pull request #1007 from ustcweizhou/dedicated-ip-for-domain
[4.7] CLOUDSTACK-8958: add dedicated ips to domain (account for now)For now, we dedicate ip pool to account, however, other accounts in the same domain cannot fetch the ip from this ip pool.
By dedicating ip pool to domain, accounts in the domain can fetch the public ip from same ip pool.

* pr/1007:
  CLOUDSTACK-8958: throw an exception if project account cannot be found
  CLOUDSTACK-8958: add dedicated ips to domain (account for now)

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-29 09:39:25 +01:00
Remi Bergsma
9710046fb9 Merge pull request #1100 from rafaelweingartner/master-lrg-cs-hackday-005
Removal of DefaultUserAuthenticator empty class.The DefaultUserAuthenticator is an empty class, extending from the
AdapterBase and implementing the UserAuthenticator interface. The class
is not being used as a marker and it's sole use is to be extended by
other UserAuthenticators. Noticing that the class had no purpose, I
removed it and made it's children extend from it's superclass and
implement it's interface instead. Also, I removed the @Local tags from
those classes, since EJB is not used anymore.

* pr/1100:
  Removal of DefaultUserAuthenticator empty class

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-29 09:15:50 +01:00
Daan Hoogland
8a5fc16f32 rats 2015-11-28 21:20:07 +01:00
Remi Bergsma
2ae3e0c961 Merge release branch 4.6 to master
* 4.6:
  Fix event UUIDS missing on event bus
  Add select template dropdown when reinstall VM
  CLOUDSTACK-9068: Listing Port Forwarding Rules take too much time to load
2015-11-28 15:12:49 +01:00
weingartner
98594b709b Removal of DefaultUserAuthenticator empty class
The DefaultUserAuthenticator is an empty class, extending the
AdapterBase and implementing the UserAuthenticator interface. The class
is only being used as a marker and it's sole use is to be extended by
other UserAuthenticators. Noticing that the class had no purpose, I
removed it and made it's children extend from it's superclass and
implement it's interface instead. Also, I removed the @Local tags from
those classes, since EJB is not used anymore.
2015-11-27 21:29:50 -02:00
jeff
7d44e90c8d Fix event UUIDS missing on event bus
The fixing of CLOUDSTACK-8816 introduced a regression that removed the
first class entities in the event bus description property. This is
because everything was changed to use the Class as a key... Everything
but the populateFirstClassEntities method in ActionEventUtils.
2015-11-26 11:19:57 +00:00
Remi Bergsma
a2a72887d2 Merge pull request #1021 from koushik-das/CLOUDSTACK-8485
CLOUDSTACK-8485: listAPIs are taking too long to return results- Removed regex. based search/replace of sensitive data on API response introduced as part of commit b0c6d4734724358df97b6fa4d8c5beb0f447745e
- Added new response serializer to skip sensitive data from getting logged based on annotation present in resposne object fields
- Added annotation (@LogLevel(Log4jLevel.Off)) to sensitive response object fields

Ran the following tests on simulator:

test_vm_life_cycle.py

Test advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS ===
ok
Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===
ok
Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===
ok
Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===
ok
Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===
ok
Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===
ok
Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===
ok
Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===
ok
Test migrate VM ... === TestName: test_08_migrate_vm | Status : SUCCESS ===
ok
Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 10 tests in 306.429s

OK

test_volumes.py

Download a Volume attached to a VM ... === TestName: test_03_download_attached_volume | Status : SUCCESS ===
ok
Delete a Volume attached to a VM ... === TestName: test_04_delete_attached_volume | Status : SUCCESS ===
ok
Detach a Volume attached to a VM ... === TestName: test_05_detach_volume | Status : SUCCESS ===
ok
Delete a Volume unattached to an VM ... === TestName: test_09_delete_detached_volume | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 4 tests in 184.132s

OK

test_network.py

Test for delete account ... === TestName: test_delete_account | Status : SUCCESS ===
ok
Test for Associate/Disassociate public IP address for admin account ... === TestName: test_public_ip_admin_account | Status : SUCCESS ===
ok
Test for Associate/Disassociate public IP address for user account ... === TestName: test_public_ip_user_account | Status : SUCCESS ===
ok
Test for release public IP address ... === TestName: test_releaseIP | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 4 tests in 783.726s

OK

test_routers.py

Test router internal advanced zone ... SKIP: Marvin configuration has no host credentials                            to check router services
Test restart network ... === TestName: test_03_restart_network_cleanup | Status : SUCCESS ===
ok
Test router basic setup ... === TestName: test_05_router_basic | Status : SUCCESS ===
ok
Test router advanced setup ... === TestName: test_06_router_advanced | Status : SUCCESS ===
ok
Test stop router ... === TestName: test_07_stop_router | Status : SUCCESS ===
ok
Test start router ... === TestName: test_08_start_router | Status : SUCCESS ===
ok
Test reboot router ... === TestName: test_09_reboot_router | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 7 tests in 42.958s

OK (SKIP=1)

test_global_settings.py

test update configuration setting at zone level scope ... === TestName: test_UpdateConfigParamWithScope | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 1 test in 0.127s

OK

test_resource_detail.py

Test volume detail ... === TestName: test_01_updatevolumedetail | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 1 test in 11.492s

OK

* pr/1021:
  CLOUDSTACK-8485: listAPIs are taking too long to return results - Removed regex. based search/replace of sensitive data on API response introduced as part of commit b0c6d4734724358df97b6fa4d8c5beb0f447745e - Added new response serializer to skip sensitive data from getting logged based on annotation present in resposne object fields - Added new parameter 'isSensitive' to @Param for marking a field as sensitive in response objects

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-23 12:56:25 +01:00
Remi Bergsma
36d0bfdecf Merge pull request #1018 from DaanHoogland/CID-1338016
CID 1338016: multi catch instead of pokemon

* pr/1018:
  CID 1338016: multi catch instead of pokemon

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-23 11:34:24 +01:00
Remi Bergsma
a6b6f4104d Merge pull request #1102 from rafaelweingartner/master-lrg-cs-hackday-006
Removed unnecessary @Local annotations and their respective importsFollowing @rafaelweingartner 's findings in PR #714 that many spring beans contained an @Local annotation, we've decided to remove said annotations and their imports from the ComponentLifecycleBase class and its subclasses seeking a reduction of a few hundred lines of useless code.

I had already opened a pull request for this (#853) but at some point my commit disappeared from the PR entirely, showing no new changes in code, which caused it to be merged automatically (with no changes).

* pr/1102:
  Removed unnecessary @Local annotations and their respective imports from the ComponentLifecycleBase class and its subclasses.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-23 11:25:43 +01:00
Remi Bergsma
3f6d7796f1 Merge pull request #929 from karuturi/CLOUDSTACK-8951
[4.7] CLOUDSTACK-8951: validation for config param "remote.access.vpn.psk.length"throwing error for value < 8 and value > 256
right now, 8, 256 are hardcoded in the code. They should be moved to a
constant and has to be reused everywhere.

will update with test cases/testing later.

* pr/929:
  CLOUDSTACK-8951: validation for "remote.access.vpn.psk.length"

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-23 11:22:42 +01:00
cirstofolini
1a64c247ad Removed unnecessary @Local annotations and their respective imports from the ComponentLifecycleBase class and its subclasses. 2015-11-21 18:31:11 -02:00
Remi Bergsma
63203cec18 Merge pull request #1065 from wenwenxiong/patch-1
update for comment in cancelMaintin on start VRchange comment
//if the instance is of type ssvm, call the ssvm manager
to
//if the instance is of type domain router vm, call the network manager

* pr/1065:
  update for comment in cancelMaintin on start VR

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-20 22:29:58 +01:00
Remi Bergsma
7665bdc815 Merge pull request #1083 from borisroman/CLOUDSTACK-9062
CLOUDSTACK-9062: Improve S3 implementation.The S3 implementation is far from finished, this commit focuses on the bases.

 - Upgrade AWS SDK to latest version.
 - Rewrite S3 Template downloader.
 - Rewrite S3Utils utility class.
 - Improve addImageStoreS3 API command.
 - Split various classes for convenience.
 - Various minor improvements and code optimizations.

A side effect of the new AWS SDK is that it, by default, uses the V4 signature. Therefore I added an option to specify the Signer, so it stays compatible with previous versions.

Please review thoroughly, both code inspection and (automated) integration tests. Currently no integration tests are available specifically for S3. Therefore the implementation is needed to be tested manually, for now...

What I tested:
 - Greenfield install -> will download latest systemvm template automatically to S3.
 - Upload a template/iso
 - Download a template/iso
 - Restart of management server -> list available templates -> doesn't download them again if available.

* pr/1083:
  CLOUDSTACK-9062: Improve S3 implementation.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-20 22:27:17 +01:00
Remi Bergsma
b3b56e2cd8 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9053 security upgrade as per COLLECTIONS-580
  CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networks
  CLOUDSTACK-9057 remove old system vm upgrade code
2015-11-20 20:53:58 +01:00
Koushik Das
e13df96348 CLOUDSTACK-8485: listAPIs are taking too long to return results
- Removed regex. based search/replace of sensitive data on API response introduced as part of commit b0c6d4734724358df97b6fa4d8c5beb0f447745e
- Added new response serializer to skip sensitive data from getting logged based on annotation present in resposne object fields
- Added new parameter 'isSensitive' to @Param for marking a field as sensitive in response objects
2015-11-20 16:40:53 +05:30
Boris Schrijver
5c0366c99e CLOUDSTACK-9062: Improve S3 implementation.
The S3 implementation is far from finished, this commit focusses on the bases.

 - Upgrade AWS SDK to latest version.
 - Rewrite S3 Template downloader.
 - Rewrite S3Utils utility class.
 - Improve addImageStoreS3 API command.
 - Split various classes for convenience.
 - Various minor improvements and code optimalisations.

A side effect of the new AWS SDK is that it, by default, uses the V4 signature. Therefore I added an option to specify the Signer, so it stays compatible with previous versions.
2015-11-19 15:29:10 +01:00
Remi Bergsma
95ae7963d5 Merge pull request #801 from nlivens/updated-nuage-vsp-plugin
CLOUDSTACK-8832 : Update Nuage VSP plugin to work with Nuage VSP release 3.2

* pr/801:
  CLOUDSTACK-8832 : Update Nuage VSP plugin to work with Nuage VSP release 3.2

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-18 12:09:09 +01:00
Rajani Karuturi
170a025787 CLOUDSTACK-8951: validation for "remote.access.vpn.psk.length"
throwing error for value < 8 and value > 256
right now, 8, 256 are hardcoded in the code. They should be moved to a
constant and has to be reused everywhere.
2015-11-17 14:34:57 +05:30
Daan Hoogland
2fb01b67ad CID 1338016: multi catch instead of pokemon 2015-11-16 18:33:32 +01:00
Wei Zhou
66fc7c62f4 CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networks 2015-11-16 11:46:26 +01:00
Wei Zhou
89ce8bd9e2 CLOUDSTACK-8958: throw an exception if project account cannot be found 2015-11-16 10:17:50 +01:00
Wei Zhou
37301ed454 CLOUDSTACK-8958: add dedicated ips to domain (account for now) 2015-11-16 10:17:40 +01:00
Remi Bergsma
1f53f2a93e Updating pom.xml version numbers for release 4.7.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-15 18:54:13 +01:00
Remi Bergsma
b38c3bed0c Updating pom.xml version numbers for release 4.6.1-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-13 21:27:57 +01:00
wenwenxiong
3fb23012f8 update for comment in cancelMaintin on start VR
change comment 
//if the instance is of type ssvm, call the ssvm manager
to
//if the instance is of type domain router vm, call the network manager
2015-11-13 18:10:14 +08:00
Remi Bergsma
e31ade03c6 Updating pom.xml version numbers for release 4.6.0
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-10 15:45:34 +01:00
Wei Zhou
cb9bf44538 [UI] Network names are not being displayed in Infra » VRs » router » NICS 2015-11-06 11:05:12 +01:00
Remi Bergsma
5f61041550 Merge pull request #1009 from rags22489664/master
CLOUDSTACK-9006 - ListTemplates API returns result in inconsistent order when called concurrentlyThe order of templates returned in the response is based on a field called sortkey and by default value for the field is set to 0.

With more than 1000 templates, we tried listing the templates with different page sizes concurrently, and we noticed the results being inconsistent.

Thus we added a secondary order by clause to list templates call on tempZonePair column to make sure the results are consistent.

The addOrderby method of Filter class was also not appending , if we added more orderby clauses.

* pr/1009:
  CLOUDSTACK-9006 - ListTemplates API returns result in inconsistent order when called concurrently
  CLOUDSTACK-9006 - ListTemplates API returns result in inconsistent order when called concurrently

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-04 11:48:08 +01:00
Remi Bergsma
2fd6fac214 Merge pull request #898 from bvbharatk/CLOUDSTACK-8902
CLOUDSTACK-8902 Restart Network fails in EIP/ELB zoneThe restart network was failing when using external loadbalencer. The failure was because of a number format exception. When BroadcastDomainType.getValue(guestConfig.getBroadcastUri() is executed this returns a string untagged. We were trying to parse this as long so there was a number pointer exception.

This happens only when the vlan uri is vlan://untagged. in other cases were there is a number instead of untagged (vlan tag) this used to succeed. Although we were trying to convert the number to long we were not really using it. we were converting the number to long and then back to string when creating the IpAddressTo. so I removed this unnecessary conversion in this case for fixing the issue at hand.

I did a manual restart of the network and checked for this number format exception in a EIP/ELB setup.

* pr/898:
  CLOUDSTACK-89027 Restart Network fails in EIP/ELB zone

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-04 11:37:51 +01:00
Remi Bergsma
20bbd342ce Merge pull request #1020 from bvbharatk/CLOUDSTACK-9016
CLOUDSTACK-9016 Fail to create VM instance within VPCbug link https://issues.apache.org/jira/browse/CLOUDSTACK-9016.

CS doe not allocate the ip of the form x.x.x.1 to a guest VM. We seem to incorrectly assume that the first ip in the subnet belongs to the gateway.

* pr/1020:
  CLOUDSTACK-9016: Deploy vm with gateway ip address in VPC
  CLOUDSTACK-9016 Fail to create VM instance within VPC

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-02 20:32:56 +01:00
Remi Bergsma
0c52f70b45 Merge pull request #995 from kansal/CLOUDSTACK-9002
CLOUDSTACk-9002: VM deployment is successful even when dhcp entry command fails - Fixed

Reason: The return value of the call to accept() function in the applyRules() function of BasicNetworkTopology.java was not checked for success or failure. As a result even if it fails, exception was not thrown and VM deployment went ahead without any errors.

Fix: Added the necessary checks.

* pr/995:
  CLOUDSTACk-9002: VM deployment is successful even when dhcp entry command fails - Fixed

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-02 14:18:21 +01:00
Remi Bergsma
3d213b66e7 Merge pull request #916 from kansal/CLOUDSTACK-8940
CLOUDSTACK-8940: Wrong value is inserted into nics table netmask field when creating a VM - Fixed

Problem: When creating a VM in shared network with no service, the value of netmask is added in the table in the CIDR format unlike other cases where it is added as normal string in the format xxx.xxx.xxx.xxx. The netmask column in the nics table has a length of 15 chars which gets violated if the CIDR exceeds it(Max CIDR length can be 18).

Fix: Before storing the netmask convert from CIDR to native format.

* pr/916:
  CLOUDSTACK-8940: Wrong value is inserted into nics table netmask field when creating a VM - Fixed

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-02 14:16:29 +01:00
Bharat Kumar
475fc38481 CLOUDSTACK-9016 Fail to create VM instance within VPC 2015-11-02 14:08:19 +05:30
Remi Bergsma
901d47c07e Merge pull request #818 from kansal/CLOUDSTACK-8844
Fixed: Network Update from RVR offering to Standalone offering failsProblem: Moving a RVR network offering to standalone makes the status of VR's as UNKNOWN and Redundant Router marked with YES.
Fix: The network's isRedundant was not getting updated.

* pr/818:
  CLOUDSTACK-8844: Network Update from RVR offering to Standalone offering fails - Fixed

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-30 17:02:34 +01:00
Remi Bergsma
930ef8dc7b Merge pull request #879 from pdube/CLOUDSTACK-8793
CLOUDSTACK-8793 Enable s2s VPN connection for projects

* pr/879:
  CLOUDSTACK-8793 Added project id to create vpn customer gateway, and to the impl of list vpn connections and list vpn customer gateways

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-30 08:35:06 +01:00
Kshitij Kansal
e24ecccdea CLOUDSTACK-8844: Network Update from RVR offering to Standalone offering fails - Fixed 2015-10-30 10:54:45 +05:30
ramamurtis
c90723f491 CLOUDSTACK-9006 - ListTemplates API returns result in inconsistent order when called concurrently 2015-10-30 09:44:59 +05:30
Remi Bergsma
c03956ebec Merge pull request #848 from iwebhosting/lbprotocol
Pass LbProtocol down to the HAProxyConfiguratorThis will let us specify a new load balancer protocol (tcp-proxy) which enables HAProxy's `send-proxy` functionality.

`send-proxy` / [the PROXY protocol][1] will send the real connection origin IP through to the servers behind HAProxy, without requiring any protocol specific changes (such as HTTP header rewriting).

[1]: http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt

This is also inline with what [Amazon ELB now supports][2].

[2]: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html

* pr/848:
  Pass LbProtocol down to the HAProxyConfigurator

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-29 20:15:20 +01:00
Remi Bergsma
093cccfce2 Merge pull request #945 from nitin-maharana/CloudStack-Nitin11
CLOUDSTACK-8962: Dedicated cluster is used for virtual routers that belong to non-dedicated account
Earlier the deployment planner was not handling the case of virtual routers.(In Explicit Dedication)
It was only handling for all instance VMs/user VMs.
Added code for checking the case of Virtual Routers.

* pr/945:
  CLOUDSTACK-8962: Dedicated cluster is used for virtual routers that belong to non-dedicated account

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-29 20:10:31 +01:00
Kshitij Kansal
ba26efcdf2 CLOUDSTACK-8940: Wrong value is inserted into nics table netmask field when creating a VM - Fixed 2015-10-29 17:04:58 +05:30
Patrick Dube
110f66ff13 CLOUDSTACK-8793 Added project id to create vpn customer gateway, and to the impl of list vpn connections and list vpn customer gateways 2015-10-28 09:58:37 -04:00
Aaron Brady
cacac14425 Pass LbProtocol down to the HAProxyConfigurator 2015-10-28 13:42:51 +00:00
Remi Bergsma
7d46b2ee56 Merge pull request #895 from SudharmaJain/cs-8911
CLOUDSTACK-8911: VM start job got stuck in loop looking for suitable host

VM instance creation job get stuck in the loop, when VMs require local storage there are host that reached max guest limit and remain hosts does have storage available.  This happens because the hosts that reach the max guest limit were not getting added to the avoid list and hence the cluster.

Verified the fix on my local setup.

Repro Steps:
1. Take an environment with single cluster and 2 hosts.
2. change the max guest limit for the hypervisor such that on one host max guest limit should reach.
3. change thresholds so that other host should not have enough storage. If required create a VM for sufficient bigger disk.
4. Now deploy a VM with local storage.
5. cluster will never be put in the avoid set and job will keep looking for suitable host.
6. once we increase the max guest limit, VM will deploy or will fail if there is a lack of storage.

* pr/895:
  CLOUDSTACK-8911: VM start job got stuck in loop looking for suitable host

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-28 11:29:32 +01:00
Kshitij Kansal
301ea330ce CLOUDSTACk-9002: VM deployment is successful even when dhcp entry command fails - Fixed 2015-10-28 11:51:25 +05:30
Remi Bergsma
535ab51b9a Merge pull request #849 from karuturi/CLOUDSTACK-8816-take2
Cloudstack-8816 some of the events do not have resource uuidsThe key objects in the context map are sometimes String and sometimes object. This causes missing uuids when an entity put in the context map with key entity.toString is queried with key entity

Testing:
manually tested by deploying a vm and checked that the created events in rabbitmq now has uuids.
events before and after the change are update at https://issues.apache.org/jira/browse/CLOUDSTACK-8816?focusedCommentId=14805239

unittests
```
$ mvn -pl :cloud-api test -Dtest=CallContextTest
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.cloudstack.context.CallContextTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.152 sec - in org.apache.cloudstack.context.CallContextTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.445 s
[INFO] Finished at: 2015-09-18T14:58:53+05:30
[INFO] Final Memory: 55M/448M
[INFO] ------------------------------------------------------------------------
```

* pr/849:
  CLOUDSTACK-8816 added missing events
  CLOUDSTACK-8816: fixed missing resource uuid in delete network cmd
  CLOUDSTACK-8816: fixed missing resource uuid in destroy vm event
  Cloudstack-8816: Fixed missing resource uuid in delete snapshot events
  CLOUDSTACK-8816: some of the events do not have resource uuids
  CLOUDSTACK-8816: some of the events do not have resource uuids

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-27 19:26:44 +01:00
Nick Livens
645f8758df CLOUDSTACK-8832 : Update Nuage VSP plugin to work with Nuage VSP release 3.2 2015-10-27 14:56:57 +01:00
Rajani Karuturi
fb4e6ed6ba Merge pull request #894 from sudhansu7/CLOUDSTACK-8917
CLOUDSTACK-8917 : Instance tab takes long time to load with 12K Vmsmodified sql that is used for retrieving vm count .

In load test environment listVirtualmachine takes 8-11 sec to load. This environment has around 12k active VMs. Total number of rows is 190K.

Performance bottleneck in listVirtualmachine command is fetching the count and distinct vms.
{noformat}
        // search vm details by ids
        Pair<List<UserVmJoinVO>, Integer> uniqueVmPair = _userVmJoinDao.searchAndCount(sc, searchFilter);
        Integer count = uniqueVmPair.second();
{noformat}

 This takes 95% of the total time.

To fetch the count and distinct vms we are using below sqls.

 Query 1:
{noformat}
SELECT DISTINCT(user_vm_view.id) FROM user_vm_view WHERE user_vm_view.account_type != 5  AND user_vm_view.display_vm = 1  AND user_vm_view.removed IS NULL  ORDER BY user_vm_view.id ASC  LIMIT 0, 20
 {noformat}

 Query 2:

select count(distinct id) from user_vm_view WHERE user_vm_view.account_type != 5  AND user_vm_view.display_vm = 1  AND user_vm_view.removed IS NULL

Query 2 is a problematic query.

If we rewrite the query as mentioned below then it will be ~2x faster.

select count(*) from (select distinct id from user_vm_view WHERE user_vm_view.account_type != 5  AND user_vm_view.display_vm = 1  AND user_vm_view.removed IS NULL) as temp;

Mysql Test result:

With 134 active Vms (total rows 349)
mysql> select count(*) from vm_instance;
+----------+
| count(*) |
+----------+
|      349 |
+----------+
1 row in set (0.00 sec)
mysql> select count(*) from user_vm_view;
+----------+
| count(*) |
+----------+
|      135 |
+----------+
1 row in set (0.02 sec)
mysql> select count(distinct id) from user_vm_view WHERE user_vm_view.account_type != 5  AND user_vm_view.display_vm = 1  AND user_vm_view.removed IS NULL;
+--------------------+
| count(distinct id) |
+--------------------+
|                134 |
+--------------------+
1 row in set (0.02 sec)

mysql> select count(*) from (select distinct id from user_vm_view WHERE user_vm_view.account_type != 5  AND user_vm_view.display_vm = 1  AND user_vm_view.removed IS NULL) as temp;
+----------+
| count(*) |
+----------+
|      134 |
+----------+
1 row in set (0.01 sec)

With 14326 active Vms (total rows 195660)

mysql> select count(*) from vm_instance;
+----------+
| count(*) |
+----------+
|   195660 |
+----------+
1 row in set (0.04 sec)
mysql> select count(*) from user_vm_view;
+----------+
| count(*) |
+----------+
|    41313 |
+----------+
1 row in set (4.55 sec)
mysql> select count(distinct id) from user_vm_view WHERE user_vm_view.account_type != 5  AND user_vm_view.display_vm = 1  AND user_vm_view.removed IS NULL;
+--------------------+
| count(distinct id) |
+--------------------+
|              14326 |
+--------------------+
1 row in set (7.39 sec)

mysql> select count(*) from (select distinct id from user_vm_view WHERE user_vm_view.account_type != 5  AND user_vm_view.display_vm = 1  AND user_vm_view.removed IS NULL) as temp;
+----------+
| count(*) |
+----------+
|    14326 |
+----------+
1 row in set (2.08 sec)

UI test Results:
Before:
![screen shot 2015-09-28 at 2 19 55 pm](https://cloud.githubusercontent.com/assets/1062642/10133848/66af7c40-65fe-11e5-9ef5-ec6489c0fc06.png)

After
![screen shot 2015-09-28 at 2 33 38 pm](https://cloud.githubusercontent.com/assets/1062642/10133852/6f512c9a-65fe-11e5-9ea1-890cf84d02b4.png)

* pr/894:
  CLOUDSTACK-8917 : Instance tab takes long time to load with 12K active VM (total vms: 190K)

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-10-27 12:17:55 +05:30
Rajani Karuturi
29dfeac857 CLOUDSTACK-8889: delete volume doesnt decrement primary store resource count
Primary Storage count for an account does not decrease when a Data Disk
is deleted belonging to the account unless the VM to which volume
belonged is destroyed

The resource counts are updated even before the disk is actually deleted
resulting in the same value.
Moved the resource counts updation to after the expunge operation as
thats when the disk is actually deleted.

all the tests in test/integration/component/test_ps_limits.py now pass
2015-10-26 17:40:27 +05:30
Remi Bergsma
f241455a63 Merge pull request #954 from ustcweizhou/CLOUDSTACK-8964
CLOUDSTACK-8964: Can't create template or volume from snapshot on KVM

* pr/954:
  CLOUDSTACK-8964: Can't create template or volume from snapshot

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-26 06:31:23 +01:00
Rajani Karuturi
2c0af1f867 CLOUDSTACK-8816 added missing events
added missing events for createUser, updateUser, createAccount apis.
2015-10-26 09:15:33 +05:30