28552 Commits

Author SHA1 Message Date
Wilder Rodrigues
08b983fe02 CLOUDSTACK-8952 - Remove the '--vrrp' search criteria form the CsProcess constructor call
- There is no such process, which makes the CsProcess.find return false and restart keepalived all the time.
2015-10-17 12:20:39 +02:00
Rajani Karuturi
9363be3397 Merge pull request #934 from karuturi/CLOUDSTACK-8923
[4.6][BLOCKER] CLOUDSTACK-8923: Create storage network IP range failedThis is a regression from commit 0cd8c06f7dceaf999acf202862c5d1d580e7aa0e
try-with-resource used at https://github.com/apache/cloudstack/blob/master/server/src/com/cloud/network/StorageNetworkManagerImpl.java#L107 is closing the transaction.
At later point when the transaction is actually committed, it doesn't find the transaction and hence the exception.

testing:
manually tested that create storage network api succeeds.

```
cloudmonkey > create storagenetworkiprange gateway=192.168.200.67 netmask=255.255.255.0 startip=192.168.200.200 endip=192.168.200.202 podid=544e3be0-9bc6-428f-9237-bf777053ab2e
\

accountid = 120b521c-725c-11e5-9244-7278fd1d2943
cmd = org.apache.cloudstack.api.command.admin.network.CreateStorageNetworkIpRangeCmd
created = 2015-10-15T09:31:22+0000
jobid = c86c4968-bc6e-4255-aa11-39221eb2277f
jobprocstatus = 0
jobresult:
storagenetworkiprange:
id = df491e87-7a00-4b5e-9bfe-e811fe78c9cd
endip = 192.168.200.202
gateway = 192.168.200.67
netmask = 255.255.255.0
startip = 192.168.200.200
jobresultcode = 0
jobresulttype = object
jobstatus = 1
userid = 120b6414-725c-11e5-9244-7278fd1d2943
```

```
cloudmonkey > list storagenetworkiprange
count = 1
storagenetworkiprange:
id = df491e87-7a00-4b5e-9bfe-e811fe78c9cd
endip = 192.168.200.202
gateway = 192.168.200.67
netmask = 255.255.255.0
networkid = a0f7faf9-83a1-4af5-b420-d8a78f2f59d8
podid = 544e3be0-9bc6-428f-9237-bf777053ab2e
startip = 192.168.200.200
zoneid = 34b9a0a1-758c-442b-9bc6-7bce03157d4c
```

* pr/934:
  CLOUDSTACK-8923: Create storage network IP range failed

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-10-16 17:24:38 +05:30
Rajani Karuturi
79b7391c22 CLOUDSTACK-8923: Create storage network IP range failed
transaction.getConnection() was wrapped in try-with-resource.
This caused transaction to get closed even before its committed.
2015-10-16 09:42:48 +05:30
Remi Bergsma
2ce5a0c964 Merge pull request #931 from ekholabs/fix/loadbalancer
CLOUDSTACK-8947 - Load Balancer not working with Isolated NetworksThis PR fixes the Load Balance feature by adding iptables rules for the public IP and port of the LB.

In order to cover the changes, I improved and executed the smoke/test_loadbalance.py. In addition, I also executed many other tests to make sure the main network/VM functionalities are working as expected.

Test report will follow.

* pr/931:
  CLOUDSTACK-8947 - Do not rely on the machine hostname to verify the test
  CLOUDSTACK-8947 - Fail fast!
  CLOUDSTACK-8947 - Adding some logging to better understand whay is happening with the Processes
  CLOUDSTACK-8947 - Adding some logging to better understand what's happening with the rules
  CLOUDSTACK-8947 - Configure the firewall when the load balancer is setup
  CLOUDSTACK-8947 - Avoid multiple entries in the FW_EGRESS_RULES table
  CLOUDSTACK-8947 - Open the input chain to IP when loadbalancer is configured
  CLOUDSTACK-8947 - FW_EGRESS should be added only to filter table

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-14 18:30:32 +02:00
Wilder Rodrigues
bb3d1cde60 CLOUDSTACK-8947 - Do not rely on the machine hostname to verify the test
- The machine hostname might be different depending on the template. So do not rely on it.
   - Using the "uname" command instead.
2015-10-14 07:44:39 +02:00
Wilder Rodrigues
384b6c7cd4 CLOUDSTACK-8947 - Fail fast!
- If we canno SSH after 5 retries, it means it's not working. Do not wait for 60 attempts
2015-10-14 07:44:39 +02:00
Wilder Rodrigues
f35a16c19e CLOUDSTACK-8947 - Adding some logging to better understand whay is happening with the Processes 2015-10-14 07:44:39 +02:00
Wilder Rodrigues
80b51a7972 CLOUDSTACK-8947 - Adding some logging to better understand what's happening with the rules 2015-10-14 07:44:39 +02:00
Wilder Rodrigues
59bd935f3e CLOUDSTACK-8947 - Configure the firewall when the load balancer is setup
- Only restart HAproxy if it's not running yet
2015-10-14 07:44:38 +02:00
Wilder Rodrigues
4a177031b0 CLOUDSTACK-8947 - Avoid multiple entries in the FW_EGRESS_RULES table 2015-10-14 07:44:38 +02:00
Wilder Rodrigues
052c0dc4c9 CLOUDSTACK-8947 - Open the input chain to IP when loadbalancer is configured
- Also remove the chain rule when it is removed.
2015-10-14 07:44:38 +02:00
Wilder Rodrigues
cbd6464b88 CLOUDSTACK-8947 - FW_EGRESS should be added only to filter table 2015-10-14 07:44:37 +02:00
Remi Bergsma
be419211ec Merge pull request #923 from ekholabs/fix/default_routes_CLOUDSTACK-8934
CLOUDSTACK-8934 - Default routes not configured for rVPC and RVRThis PR fixes the default routes for redundant VPCs and isolated networks. New tests were introduced in order to make sure that the routers are working properly.

During the tests, I found out that the Firewall Egress was not working properly when creating the network offering with default allow. The bug has been fixed and tests for redundant and non-redundant isolated networks were added.

Test reports will follow in a separate comment.

* pr/923:
  CLOUDSTACK-8934 - Fix the AclIP class to make it configure the default FW policy
  CLOUDSTACK-8934 - Fix default EGRESS rules for isolated networks
  CLOUDSTACK-8934 - Adding tests to cover default routes on IsoNest and RVR nets
  CLOUDSTACK-8934 - Add default gateway when the public interface is up again

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-13 22:38:34 +02:00
Rajani Karuturi
f0cd632d54 Merge pull request #915 from milamberspace/PR-906-912-BugZoneWizardAndAdvSearchPopup
Pr 906 912 bug zone wizard and adv search popup

* pr/915:
  PR 906 (CLOUDSTACK-8930) and PR 912 combined. Bugs on localization buttons in zone wizard final step and Advanced search popup
  CLOUDSTACK-8930: Showing blank screen when click 'Next' link in final step of Add Zone wizard.

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-10-11 19:25:03 +05:30
Wilder Rodrigues
cd8c3e97f5 CLOUDSTACK-8934 - Fix the AclIP class to make it configure the default FW policy 2015-10-11 14:57:33 +02:00
Wilder Rodrigues
b4dc392bfd CLOUDSTACK-8934 - Fix default EGRESS rules for isolated networks
- The default is Accept and will be changed based on the configuration of the offering.

CLOUDSTACK-8934 - The default egress is set as Deny in the router.

   - We had to change it on the Java side in order to make the apply it once the default is defined as allowed on the net offering
2015-10-11 14:57:32 +02:00
Wilder Rodrigues
5d1cdc6440 CLOUDSTACK-8934 - Adding tests to cover default routes on IsoNest and RVR nets 2015-10-11 14:57:31 +02:00
Wilder Rodrigues
45642b8382 CLOUDSTACK-8934 - Add default gateway when the public interface is up again 2015-10-11 14:57:12 +02:00
Remi Bergsma
fddf59f885 Merge pull request #889 from wido/CLOUDSTACK-8879
CLOUDSTACK-8879: Depend in rados-java 0.2.0This should fix the CloudStack Agent from crashing when it has to
handle more then 16 RBD snapshots on one Volume.

* pr/889:
  CLOUDSTACK-8879: Depend in rados-java 0.2.0

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-09 13:52:28 +01:00
Remi Bergsma
ca9e934e96 Merge pull request #908 from ekholabs/fix/rVPC_routes_CLOUDSTACK-8915
CLOUDSTACK-8915 - Cannot SSH into VMs deployed Redundant VPC routersIn order to reproduce the problem, I did the following

* Create a Redundant VPC
* Add a tier
* Add a new VM to the tier
* Add an ACL, open port 22 and associate the ACL with the tier
* Acquire a pub IP
* Add a PF rule to port 22 towards the VM
* Try to SSH to the VM through the Pub IP

It failed with "No route to host".

This PR contains the following:

* Fix for the keepalived (vrrp) configuration;
* Refactor the default router code for both isolated and [r]VPC routers
* Revert CsRedundant changes
* Add default route tests
* Add logging to tests - so we see what's happening during test execution.

* pr/908:
  CLOUDSTACK-8915 - Making sure cleanup resources passes
  CLOUDSTACK-8915 - Fix the assertion used for the default routes test
  CLOUDSTACK-8915 - Copy the conntrackd configuration every time _redundant_on() function is called
  CLOUDSTACK-8915 - This test is still under construction
  CLOUDSTACK-8915 - Adding logging to tests
  CLOUDSTACK-8915 - Improve routers tests
  CLOUDSTACK-8915 - Reverting changes from commit id 1a02773b556a0efa277cf18cd099fc62a4e27706
  CLOUDSTACK-8915 - Reverting changes from commit id 18dbc0c4cbe506ad698bc513c901dc2d0e48159f
  CLOUDSTACK-8915 - VRRP needs a cidr in order to work properly
  CLOUDSTACK-8915 - Rearrenging a bit the default route code in order to make it more clear
  CLOUDSTACK-8915 - Add the default route only on address that have not been configured yet.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-09 00:47:52 +01:00
Wilder Rodrigues
7ed81a6990 CLOUDSTACK-8915 - Making sure cleanup resources passes
- Due to an issue with VPC routers (CLOUDSTACK-8935) we are not able to destroy networks before destroying the routers
   - Added a forcestop/destroy routers inside the tearDown to make sure it passes. The issue will be addressed in a separate PR
   - Make sure the routers list is cleaned after destroy_routers() is called
   - Populate routers list after the router is recreated
2015-10-07 11:14:23 +02:00
Milamber
e64025a2b8 PR 906 (CLOUDSTACK-8930) and PR 912 combined. Bugs on localization buttons in zone wizard final step and Advanced search popup 2015-10-07 07:50:04 +01:00
Nitin Kumar Maharana
2651956cf4 CLOUDSTACK-8930: Showing blank screen when click 'Next' link in final step of Add Zone wizard. 2015-10-07 07:47:00 +01:00
Wilder Rodrigues
b1fb1539e9 CLOUDSTACK-8915 - Fix the assertion used for the default routes test 2015-10-06 16:41:15 +02:00
Wilder Rodrigues
9fe040e96d CLOUDSTACK-8915 - Copy the conntrackd configuration every time _redundant_on() function is called
- Also refactored the copy() function under CsHelper.py
2015-10-06 16:41:15 +02:00
Wilder Rodrigues
a0c93e7778 CLOUDSTACK-8915 - This test is still under construction
- It will help to increase coverage of VR use: PF; LB and FW
2015-10-06 16:41:14 +02:00
Wilder Rodrigues
5f79916eea CLOUDSTACK-8915 - Adding logging to tests 2015-10-06 16:41:14 +02:00
Wilder Rodrigues
7c7c0149b2 CLOUDSTACK-8915 - Improve routers tests
- Add egress tests in order to check if VMs can reach the outside world
   - Increase the wait when testing redundant routers: they fight to become master
   - Make sure the clean up is done properly
2015-10-06 16:41:14 +02:00
Wilder Rodrigues
260ff836b6 CLOUDSTACK-8915 - Reverting changes from commit id 1a02773b556a0efa277cf18cd099fc62a4e27706
- That's not the place to fix the default routes for redundant VPC,
   - Adding tests to cover PF and FW in isolated networks
     * Will still add some tests for egress as well
2015-10-06 16:41:14 +02:00
Wilder Rodrigues
3d34e4a52c CLOUDSTACK-8915 - Reverting changes from commit id 18dbc0c4cbe506ad698bc513c901dc2d0e48159f
- If the file is always copied, it will result in restarting keepalived everytime which makes the routers transit between master/backup
2015-10-06 16:41:13 +02:00
Wilder Rodrigues
094d29d7cd CLOUDSTACK-8915 - VRRP needs a cidr in order to work properly
- The cidr was replaced by the single IP, which broke the feature.
   - Wait during transition from master to backup otherwise the test fails due to wronge state
2015-10-06 16:41:13 +02:00
Wilder Rodrigues
0c752eab60 CLOUDSTACK-8915 - Rearrenging a bit the default route code in order to make it more clear 2015-10-06 16:41:13 +02:00
Wilder Rodrigues
c17fb0ff28 CLOUDSTACK-8915 - Add the default route only on address that have not been configured yet.
- In case of rVPC we experienced the wrong route being added to the VPC tiers
2015-10-06 16:41:12 +02:00
Rajani Karuturi
99059e2212 Merge pull request #909 from DaanHoogland/RESMO-CLOUDSTACK-8848
CLOUDSTACK-8848 ensure power state is up to date for missing PowerState handlingadded a null guard to @resmo's #885 A unit test or two would be nice as well but as this is a blocker I want to get it to review asap.
@koushik-das @wilderrodrigues @anshul1886 @karuturi @remibergsma you all commented on the original, please have a look. @bhaisaab welcome to comment as well.

* pr/909:
  CLOUDSTACK-8848: added null pointer guard to new public method
  CLOUDSTACK-8848: ensure power state is up to date when handling missing VMs in powerReport

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-10-05 11:36:15 +05:30
Daan Hoogland
b128e567c4 CLOUDSTACK-8848: added null pointer guard to new public method 2015-10-05 07:27:28 +02:00
Remi Bergsma
78f74295e1 Merge pull request #901 from karuturi/CLOUDSTACK-8808
CLOUDSTACK-8808: Successfully registered VHD template is downloaded again due to missing virtualsize property in template.propertiesWe have multiple file processors to process different types of image
formats. The processor interface has two methods getVirtualSize() and
process().

1.  getVirtualSize() as the name says, returns the virtual size of
the file and is used at get the size while copying files from NFS to s3
2.  process() returns FormatInfo struct which has fileType, size,
virutalSize, filename.  on successfully downloading a template, each
file is passed to all the processors.process() and whichever returns a
FormatInfo, that will be used to create template.properties file.  If
process() throws an InternalErrorException, template installation fails.
But, if process() returns null, template registration is successful with
template.properties missing some attributes like virtualSize, file
format etc. which results in this bug on restart of ssvm/cloud
service/management server.

failing the template download if virutalsize or some other properties
cannot be determined.

The following changes are done:
getVirtualSize() to always return size(if it can calculate, get virtual
size else return file size). This would mean the following changes

1. QCOW2Processor.getVirtualSize() to return file size if virtual
size calculation fails
2. VHDProcessor.getVirtualSize() to return file size if virtual size
calculation fails

process() to throw InternalErrorException if virtual size calculation
fails or any other exceptions occur. This would mean the following
changes

1. OVAProcessor to throw InternalErrorException if untar fails
2. QCOW2Processor to throw InternalErrorException if virtual size
calculation fails
3. VHDProcessor to throw InternalErrorException if virtual size
calculation fails

Testing:
added unittests for the changes in the file processors.
manual test:
setup: host xenserver 6.5, management server centos 6.7
template: disk created using the process specified by andy at https://issues.apache.org/jira/browse/CLOUDSTACK-8808?focusedCommentId=14933368
tried to register the template and it failed with an error. Template never moved to Ready state.
![screen shot 2015-09-30 at 3 53 34 pm](https://cloud.githubusercontent.com/assets/186833/10190608/76bcce92-678b-11e5-8f52-b449d149300b.png)

* pr/901:
  CLOUDSTACK-8808: Successfully registered VHD template is downloaded again due to missing virtualsize property in template.properties

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-02 16:09:35 +02:00
Remi Bergsma
996c2f6dde Merge pull request #900 from sanju1010/scale_vm
CLOUDSTACK-8924: Removed duplicate test from test_scale_vm.pyPlease go through CS-8924 for more details.

* pr/900:
  CLOUDSTACK-8924: Removed duplicate test from test_scale_vm.py

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-01 13:26:41 +02:00
Rajani Karuturi
1056171aca CLOUDSTACK-8808: Successfully registered VHD template is downloaded
again due to missing virtualsize property in template.properties

We have multiple file processors to process different types of image
formats. The processor interface has two methods getVirtualSize() and
process().

    1. getVirtualSize() as the name says, returns the virtual size of
the file and is used at get the size while copying files from NFS to s3
    2. process() returns FormatInfo struct which has fileType, size,
virutalSize, filename.  on successfully downloading a template, each
file is passed to all the processors.process() and whichever returns a
FormatInfo, that will be used to create template.properties file.  If
process() throws an InternalErrorException, template installation fails.
But, if process() returns null, template registration is successful with
template.properties missing some attributes like virtualSize, file
format etc. which results in this bug on restart of ssvm/cloud
service/management server.

failing the template download if virutalsize or some other properties
cannot be determined.

The following changes are done:
getVirtualSize() to always return size(if it can calculate, get virtual
size else return file size). This would mean the following changes

    1. QCOW2Processor.getVirtualSize() to return file size if virtual
size calculation fails
    2. VHDProcessor.getVirtualSize() to return file size if virtual size
calculation fails

process() to throw InternalErrorException if virtual size calculation
fails or any other exceptions occur. This would mean the following
changes

    1. OVAProcessor to throw InternalErrorException if untar fails
    2. QCOW2Processor to throw InternalErrorException if virtual size
calculation fails
    3. VHDProcessor to throw InternalErrorException if virtual size
calculation fails
2015-09-30 15:43:51 +05:30
sanjeev
33bdfc773a CLOUDSTACK-8924: Removed duplicate test from test_scale_vm.py 2015-09-30 15:23:30 +05:30
Rene Moser
542880ae76 CLOUDSTACK-8848: ensure power state is up to date when handling missing VMs in powerReport
There 2 things which has been changed.

* We look on power_state_update_time instead of update_time. Didn't make sense to me at all to look at update_time.
* Due DB update optimisation, powerState will only be updated if < MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT. That is why we can not rely on these information unless we make sure these are up to date.
2015-09-27 22:14:03 +02:00
Remi Bergsma
3ded3e9000 Merge pull request #887 from schubergphilis/vr_fixes_combined
[BLOCKER] Combined PRs that fix VR issuesTonight I worked with @wilderrodrigues to figure out what is wrong with the virtual router. As we couldn't test single PRs any more (because of other issues with them causing tests to fail) we added all VR related PRs in a separate branch and started testing from there.

We combined the following PRs into this PR:
#836 #851 #867 #870 #881 #882 #842

After that, one issue remains: the VPC does not get a default gateway. Which is strange, because we already solved it in PR #738. When I look back, it was fixed again in PR #784. It could very well be that either one fixed one specific case, but also breaking the other. We need to investigate this, and make sure there will be a fix that works both for VPCs and VRs.

When we manually add the default gateway on the VPC, most tests pass and also spinning up two VPCs with one tier each, having a VM and them using s2s to VPN them together works fine. See for more details the report Wilder sent earlier.

Tomorrow we'll try to figure out how to fix the default gateway and merge this. Then we should have a base to work from again. Any PR that fixes another blocker, should at least then be rebased against the fixed master so we can run the tests against the PR branch. I'm not saying everything is fixed, I'm just saying that we can spin up a cloud that has working VMs.

When, in the mean time, someone has the time to checkout this branch and make the default route work for both VPC and VR that would be awesome. After that we should double check and verify the test results.

Pinging @karuturi to let her know the current status.

Regards,
Wilder / Remi

* pr/887:
  Fixing the index out of bounds error in the check_if_link_up() function
  small cleanups
  Fixing the defaut route for VPC routers
  Formatting the get_gateway() method in the CsDatabag.py file
  Fixing the dhcpsrvr iptables file
  Formatting the router_proxy.sh script
  CLOUDSTACK-8881: Fixed Static and PF configuration issue
  CLOUDSTACK-8905: Fixed hooking egress rules
  CLOUDSTACK-8891: Fixed default iptables rules on VR  for guest traffic
  Configured dnsmasq to listen on all interfaces so that vpn  client gets dns
  CLOUDSTACK-8864: Not able to add TCP port forwarding rule in VPN for specific ports
  CLOUDSTACK-8863: VM doesn't reconnect to internet post VR RESTART/STOP-START/RECREATE
  CLOUDSTACK-8843: Fixed issue in default iptables rules on shared network VR

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-09-27 14:09:48 +02:00
Wilder Rodrigues
09e05f2a06 Fixing the index out of bounds error in the check_if_link_up() function 2015-09-26 20:43:15 +02:00
Remi Bergsma
d83995e23c small cleanups 2015-09-26 20:33:21 +02:00
Wilder Rodrigues
a8fa3374da Fixing the defaut route for VPC routers 2015-09-26 20:30:49 +02:00
Wilder Rodrigues
595fa50b3b Formatting the get_gateway() method in the CsDatabag.py file 2015-09-25 16:11:32 +02:00
Wilder Rodrigues
3cfc4cff80 Fixing the dhcpsrvr iptables file
- Instead of changing the router type in a local variable, lets have a dedicated file for the dhcpsrvr routers
   - The file is called iptables-dhcpsrvr, just like we have iptables-vpcrouter and iptables-router
2015-09-25 16:10:43 +02:00
Wilder Rodrigues
e72a79c1ce Formatting the router_proxy.sh script 2015-09-25 16:09:27 +02:00
Remi Bergsma
415631ab58 Revert "Merge pull request #884 from wido/test-tmp-dir"
This reverts commit 6841ba61da5e407f7a16c4a575d1a4e8c8345970, reversing
changes made to 13b29bac5a1778e295df7e9fb21c502fcf017183.

Master is currently frozen, no merges without RM approval.
http://mail-archives.apache.org/mod_mbox/cloudstack-dev/201509.mbox/browser

It also broke the build:
[INFO] Apache CloudStack Framework - Jobs ................ SUCCESS [3.448s]
[INFO] Apache CloudStack Cloud Engine Internal Components API  SUCCESS [2.528s]
[INFO] Apache CloudStack Server .......................... FAILURE [24.769s]
[INFO] Apache CloudStack Usage Server .................... SKIPPED
2015-09-25 11:41:03 +02:00
Wido den Hollander
d413b2c375 CLOUDSTACK-8879: Depend in rados-java 0.2.0
This should fix the CloudStack Agent from crashing when it has to
handle more then 16 RBD snapshots on one Volume.
2015-09-25 11:01:03 +02:00
Wido den Hollander
6841ba61da Merge pull request #884 from wido/test-tmp-dir
Use java.io.tmpdir instead of hardcoded /tmpSmall fix to have the tests also work on other platforms

* pr/884:
  Use java.io.tmpdir instead of hardcoded /tmp

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-09-25 10:13:03 +02:00