[RESULT][VOTE] Apache CloudStack 4.5.2

2015-08-23 Thread Rohit Yadav
Hi all,

After 72 hours, the vote for CloudStack 4.5.2 [1] *passes* with
5 PMC + 0 non-PMC votes.

+1 (PMC / binding)
5 person (Wido, Bruno, Rajani, Remi, Rohit)

+1 (non binding)
0 person

0
none

-1
none

Thanks to everyone participating.

I will now prepare the release announcement to go out after 24 hours
to give the mirrors time to catch up.

[1] http://markmail.org/message/6ewn6rxyoasqo6or

Regards.


Re: [VOTE] Release Apache CloudStack CloudMonkey 5.3.2 (Round 2)

2015-08-23 Thread Rohit Yadav
Hi all,

The 72 hours voting window has finished and we lack enough votes to pass this 
candidate. The voting thread will be indefinitely open now, unless we find a 
major issue or blocker.

Please consider testing and voting this candidate. Thanks.

On 20-Aug-2015, at 12:20 pm, Rajani Karuturi 
mailto:raj...@apache.org>> wrote:

+1 (binding)

built from source, could deply vm, create disk, attack disk, list vms etc.

~Rajani

On Wed, Aug 19, 2015 at 2:55 PM, Rohit Yadav 
mailto:rohit.ya...@shapeblue.com>>
wrote:

+1 (binding)

Tested to deploy KVM zones using an existing cloudmonkey/bash script, and
tested to register ssh public keys.


On 19-Aug-2015, at 2:39 pm, Rohit Yadav 
mailto:rohityada...@gmail.com>> wrote:

Hi All,

I've created a 5.3.2 release of CloudMonkey, with the following
artifacts up for a vote:

Git Branch and Commit SH:

https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=shortlog;h=refs/heads/master
Commit: 653dcca9e008e20fee83f0b40f388611ad931d15

List of changes:

https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=blob_plain;f=CHANGES.md;hb=master

Source release (checksums and signatures are available at the same
location):
https://dist.apache.org/repos/dist/dev/cloudstack/cloudmonkey-5.3.2/

PGP release keys (signed using 0EE3D884):
https://dist.apache.org/repos/dist/release/cloudstack/KEYS

The vote will be open for 72 hours.

For sanity in tallying the vote, can PMC members please be sure to
indicate "(binding)" with their vote?

[ ] +1  approve
[ ] +0  no opinion
[ ] -1  disapprove (and reason why)

Regards.


Regards,
Rohit Yadav
Software Architect, ShapeBlue




M. +91 88 262 30892 | rohit.ya...@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab




Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build

CSForge – rapid IaaS deployment framework 
CloudStack Consulting 
CloudStack Software Engineering

CloudStack Infrastructure Support

CloudStack Bootcamp Training Courses


This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Shape Blue Ltd or related companies. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error. Shape Blue Ltd is a
company incorporated in England & Wales. ShapeBlue Services India LLP is a
company incorporated in India and is operated under license from Shape Blue
Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil
and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is
a company registered by The Republic of South Africa and is traded under
license from Shape Blue Ltd. ShapeBlue is a registered trademark.


Regards,
Rohit Yadav
Software Architect, ShapeBlue


[cid:9DD97B41-04C5-45F0-92A7-951F3E962F7A]


M. +91 88 262 30892 | 
rohit.ya...@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab




Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build
CSForge – rapid IaaS deployment framework
CloudStack Consulting
CloudStack Software 
Engineering
CloudStack Infrastructure 
Support
CloudStack Bootcamp Training Courses

This email and any attachments to it may be confidential and are intended 
solely for the use of the individual to whom it is addressed. Any views or 
opinions expressed are solely those of the author and do not necessarily 
represent those of Shape Blue Ltd or related companies. If you are not the 
intended recipient of this email, you must neither take any action based upon 
its contents, nor copy or show it to anyone. Please contact the sender if you 
believe you have received this email in error. Shape Blue Ltd is a company 
incorporated in England & Wales. ShapeBlue Services India LLP is a company 
incorporated in India and is operated under license from Shape Blue Ltd. Shape 
Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is 
operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a company 
registered by The Republic of South Africa and is traded under license from 
Sh

Build failed in Jenkins: simulator-4.5-singlerun #264

2015-08-23 Thread jenkins
See 

--
Started by upstream project "build-4.5-simulator" build number 319
originally caused by:
 Started by upstream project "build-4.5" build number 516
 originally caused by:
  Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on simulator in workspace 

 > /usr/bin/git rev-parse --is-inside-work-tree # timeout=400
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/cloudstack.git # timeout=400
Fetching upstream changes from 
https://git-wip-us.apache.org/repos/asf/cloudstack.git
 > /usr/bin/git --version # timeout=400
 > /usr/bin/git fetch --tags --progress 
 > https://git-wip-us.apache.org/repos/asf/cloudstack.git 
 > +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from 
https://git-wip-us.apache.org/repos/asf/cloudstack.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:735)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:983)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1016)
at hudson.scm.SCM.checkout(SCM.java:484)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1258)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
at hudson.model.Run.execute(Run.java:1759)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags 
--progress https://git-wip-us.apache.org/repos/asf/cloudstack.git 
+refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: error:  while accessing 
https://git-wip-us.apache.org/repos/asf/cloudstack.git/info/refs

fatal: HTTP request failed

at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:324)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
at ..remote call to simulator(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
at hudson.remoting.Channel.call(Channel.java:752)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
at sun.reflect.GeneratedMethodAccessor375.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
at sun.proxy.$Proxy46.execute(Unknown Source)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:733)
... 11 more
ERROR: Error fetching remote repo 'origin'
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing JUnit
[xUnit] [INFO] - [JUnit] - No test report file(s) were found with the pattern 
'xunit.xml' relative to 
' for the 
testing framework 'JUnit'.  Did you enter a pattern relative to the correct 
directory?  Did you generate the result report(s) for 'JUnit'?
[xUnit] [ERROR] - No test reports found for the metric 'JUnit' with the 
resolved pattern 'xunit.xml'. Configuration error?.
[xUnit] [INFO] - Failing BUILD.
[xUnit] [INFO] -

Re: [VOTE] Release Apache CloudStack CloudMonkey 5.3.2 (Round 2)

2015-08-23 Thread Milamber

Hello,

+1 (binding)

Some basics tests (list, create vm, static nat, fw rule, stop vm, etc.) 
on CS 4.5.1, KVM.


Thanks to the RM.

Milamber

On 23/08/2015 16:08, Rohit Yadav wrote:

Hi all,

The 72 hours voting window has finished and we lack enough votes to 
pass this candidate. The voting thread will be indefinitely open now, 
unless we find a major issue or blocker.


Please consider testing and voting this candidate. Thanks.

On 20-Aug-2015, at 12:20 pm, Rajani Karuturi > wrote:


+1 (binding)

built from source, could deply vm, create disk, attack disk, list vms 
etc.


~Rajani

On Wed, Aug 19, 2015 at 2:55 PM, Rohit Yadav 
mailto:rohit.ya...@shapeblue.com>>

wrote:


+1 (binding)

Tested to deploy KVM zones using an existing cloudmonkey/bash 
script, and

tested to register ssh public keys.


On 19-Aug-2015, at 2:39 pm, Rohit Yadav > wrote:


Hi All,

I've created a 5.3.2 release of CloudMonkey, with the following
artifacts up for a vote:

Git Branch and Commit SH:

https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=shortlog;h=refs/heads/master
Commit: 653dcca9e008e20fee83f0b40f388611ad931d15

List of changes:

https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=blob_plain;f=CHANGES.md;hb=master

Source release (checksums and signatures are available at the same
location):
https://dist.apache.org/repos/dist/dev/cloudstack/cloudmonkey-5.3.2/

PGP release keys (signed using 0EE3D884):
https://dist.apache.org/repos/dist/release/cloudstack/KEYS

The vote will be open for 72 hours.

For sanity in tallying the vote, can PMC members please be sure to
indicate "(binding)" with their vote?

[ ] +1  approve
[ ] +0  no opinion
[ ] -1  disapprove (and reason why)

Regards.


Regards,
Rohit Yadav
Software Architect, ShapeBlue




M. +91 88 262 30892 | rohit.ya...@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab




Find out more about ShapeBlue and our range of CloudStack related 
services


IaaS Cloud Design & Build

CSForge – rapid IaaS deployment framework 


CloudStack Consulting 
CloudStack Software Engineering

CloudStack Infrastructure Support

CloudStack Bootcamp Training Courses


This email and any attachments to it may be confidential and are 
intended
solely for the use of the individual to whom it is addressed. Any 
views or

opinions expressed are solely those of the author and do not necessarily
represent those of Shape Blue Ltd or related companies. If you are 
not the

intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the 
sender
if you believe you have received this email in error. Shape Blue Ltd 
is a
company incorporated in England & Wales. ShapeBlue Services India 
LLP is a
company incorporated in India and is operated under license from 
Shape Blue
Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in 
Brasil
and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty 
Ltd is

a company registered by The Republic of South Africa and is traded under
license from Shape Blue Ltd. ShapeBlue is a registered trademark.



Regards,
Rohit Yadav
Software Architect, ShapeBlue




M. +91 88 262 30892 | rohit.ya...@shapeblue.com 


Blog: bhaisaab.org  | Twitter: @_bhaisaab




Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build 


CSForge – rapid IaaS deployment framework 
CloudStack Consulting 
CloudStack Software Engineering 

CloudStack Infrastructure Support 

CloudStack Bootcamp Training Courses 



This email and any attachments to it may be confidential and are 
intended solely for the use of the individual to whom it is addressed. 
Any views or opinions expressed are solely those of the author and do 
not necessarily represent those of Shape Blue Ltd or related 
companies. If you are not the intended recipient of this email, you 
must neither take any action based upon its contents, nor copy or show 
it to anyone. Please contact the sender if you believe you have 
received this email in error. Shape Blue Ltd is a company incorporated 
in England & Wales. ShapeBlue Services India LLP is a company 
incorporated in India and is operated under license from Shape Blue 
Ltd. Shape Blue Brasil Consultoria Ltda is a company incorp

[GitHub] cloudstack pull request: CLOUDSTACK-8443: Support CentOS 7 as KVM ...

2015-08-23 Thread remibergsma
GitHub user remibergsma opened a pull request:

https://github.com/apache/cloudstack/pull/731

CLOUDSTACK-8443: Support CentOS 7 as KVM hypervisor

This 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.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/remibergsma/cloudstack centos7-kvm

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/731.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #731


commit e8fcaa8736d4f870d28fdb8617402c78b0fe0a0a
Author: Remi Bergsma 
Date:   2015-08-20T20:31:55Z

CLOUDSTACK-8443: no need to specify cgroup_controllers

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.

commit 3ec82a598c6aed0f72fc15b35de32575168e40ab
Author: Remi Bergsma 
Date:   2015-08-20T20:51:53Z

CLOUDSTACK-8443: remove setting up cgroup_controllers

commit 8196cc82542b9b2038ae3c5db88358249b3ce5ad
Author: Remi Bergsma 
Date:   2015-08-20T20:53:31Z

CLOUDSTACK-8443: don't try to fix co-mounted cgroups

This didn't work well, as after a reboot you'd still have qemu
throwing errors. We'll make sure we can handle the co-mounted
cgroups.

commit 7d7778faa79823342c0468318ec26d8e3df84a9f
Author: Remi Bergsma 
Date:   2015-08-22T20:54:01Z

CLOUDSTACK-8443: display the right hypervisor type

commit 313988c76a9524159b8a12a569a818f0b715c14e
Author: Remi Bergsma 
Date:   2015-08-23T10:44:34Z

CLOUDSTACK-8443: mention the correct logfile

commit 3696fd37d34a3db962c6785530aefb3574dd874f
Author: Remi Bergsma 
Date:   2015-08-22T20:30:46Z

CLOUDSTACK-8443: detect CentOS 7.x as RHEL 7 alike




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Quota master

2015-08-23 Thread abhinandanprateek
Github user abhinandanprateek commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/689#discussion_r37716584
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
 ---
@@ -0,0 +1,419 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License.
+package org.apache.cloudstack.api.response;
+
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.user.Account;
+import com.cloud.user.AccountVO;
+import com.cloud.user.User;
+import com.cloud.user.dao.AccountDao;
+import com.cloud.user.dao.UserDao;
+import com.cloud.utils.db.TransactionLegacy;
+
+import org.apache.cloudstack.api.command.QuotaBalanceCmd;
+import org.apache.cloudstack.api.command.QuotaEmailTemplateListCmd;
+import org.apache.cloudstack.api.command.QuotaEmailTemplateUpdateCmd;
+import org.apache.cloudstack.api.command.QuotaStatementCmd;
+import org.apache.cloudstack.api.command.QuotaTariffListCmd;
+import org.apache.cloudstack.api.command.QuotaTariffUpdateCmd;
+import org.apache.cloudstack.quota.QuotaService;
+import org.apache.cloudstack.quota.constant.QuotaConfig;
+import org.apache.cloudstack.quota.constant.QuotaTypes;
+import org.apache.cloudstack.quota.dao.QuotaBalanceDao;
+import org.apache.cloudstack.quota.dao.QuotaCreditsDao;
+import org.apache.cloudstack.quota.dao.QuotaEmailTemplatesDao;
+import org.apache.cloudstack.quota.dao.QuotaTariffDao;
+import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
+import org.apache.cloudstack.quota.vo.QuotaCreditsVO;
+import org.apache.cloudstack.quota.vo.QuotaEmailTemplatesVO;
+import org.apache.cloudstack.quota.vo.QuotaTariffVO;
+import org.apache.cloudstack.quota.vo.QuotaUsageVO;
+import org.apache.cloudstack.region.RegionManager;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+@Component
+@Local(value = QuotaResponseBuilderImpl.class)
+public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
+private static final Logger s_logger = 
Logger.getLogger(QuotaResponseBuilderImpl.class.getName());
+
+@Inject
+private QuotaTariffDao _quotaTariffDao;
+@Inject
+private QuotaBalanceDao _quotaBalanceDao;
+@Inject
+private QuotaCreditsDao _quotaCreditsDao;
+@Inject
+private QuotaEmailTemplatesDao _quotaEmailTemplateDao;
+
+@Inject
+private UserDao _userDao;
+@Inject
+private QuotaService _quotaService;
+@Inject
+AccountDao _accountDao;
+@Inject
+private RegionManager _regionMgr;
+
+@Override
+public QuotaTariffResponse createQuotaTariffResponse(QuotaTariffVO 
tariff) {
+final QuotaTariffResponse response = new QuotaTariffResponse();
+response.setUsageType(tariff.getUsageType());
+response.setUsageName(tariff.getUsageName());
+response.setUsageUnit(tariff.getUsageUnit());
+response.setUsageDiscriminator(tariff.getUsageDiscriminator());
+response.setTariffValue(tariff.getCurrencyValue());
+response.setEffectiveOn(tariff.getEffectiveOn());
+response.setDescription(tariff.getDescription());
+response.setCurrency(QuotaConfig.QuotaCurrencySymbol.value());
+return response;
+}
+
+@Override
+public QuotaBalanceResponse 
createQuotaBalanceResponse(List quotaBalance, Date startDate, 
Date endDate) {
+if (quotaBalance.size() == 0) {
+new InvalidParameterValueException("The request period d

[GitHub] cloudstack pull request: Quota master

2015-08-23 Thread abhinandanprateek
Github user abhinandanprateek commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/689#discussion_r37716634
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
 ---
@@ -0,0 +1,419 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements.  See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership.  The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License.  You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied.  See the License for the
+//specific language governing permissions and limitations
+//under the License.
+package org.apache.cloudstack.api.response;
+
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.user.Account;
+import com.cloud.user.AccountVO;
+import com.cloud.user.User;
+import com.cloud.user.dao.AccountDao;
+import com.cloud.user.dao.UserDao;
+import com.cloud.utils.db.TransactionLegacy;
+
+import org.apache.cloudstack.api.command.QuotaBalanceCmd;
+import org.apache.cloudstack.api.command.QuotaEmailTemplateListCmd;
+import org.apache.cloudstack.api.command.QuotaEmailTemplateUpdateCmd;
+import org.apache.cloudstack.api.command.QuotaStatementCmd;
+import org.apache.cloudstack.api.command.QuotaTariffListCmd;
+import org.apache.cloudstack.api.command.QuotaTariffUpdateCmd;
+import org.apache.cloudstack.quota.QuotaService;
+import org.apache.cloudstack.quota.constant.QuotaConfig;
+import org.apache.cloudstack.quota.constant.QuotaTypes;
+import org.apache.cloudstack.quota.dao.QuotaBalanceDao;
+import org.apache.cloudstack.quota.dao.QuotaCreditsDao;
+import org.apache.cloudstack.quota.dao.QuotaEmailTemplatesDao;
+import org.apache.cloudstack.quota.dao.QuotaTariffDao;
+import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
+import org.apache.cloudstack.quota.vo.QuotaCreditsVO;
+import org.apache.cloudstack.quota.vo.QuotaEmailTemplatesVO;
+import org.apache.cloudstack.quota.vo.QuotaTariffVO;
+import org.apache.cloudstack.quota.vo.QuotaUsageVO;
+import org.apache.cloudstack.region.RegionManager;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+@Component
+@Local(value = QuotaResponseBuilderImpl.class)
+public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
+private static final Logger s_logger = 
Logger.getLogger(QuotaResponseBuilderImpl.class.getName());
+
+@Inject
+private QuotaTariffDao _quotaTariffDao;
+@Inject
+private QuotaBalanceDao _quotaBalanceDao;
+@Inject
+private QuotaCreditsDao _quotaCreditsDao;
+@Inject
+private QuotaEmailTemplatesDao _quotaEmailTemplateDao;
+
+@Inject
+private UserDao _userDao;
+@Inject
+private QuotaService _quotaService;
+@Inject
+AccountDao _accountDao;
+@Inject
+private RegionManager _regionMgr;
+
+@Override
+public QuotaTariffResponse createQuotaTariffResponse(QuotaTariffVO 
tariff) {
+final QuotaTariffResponse response = new QuotaTariffResponse();
+response.setUsageType(tariff.getUsageType());
+response.setUsageName(tariff.getUsageName());
+response.setUsageUnit(tariff.getUsageUnit());
+response.setUsageDiscriminator(tariff.getUsageDiscriminator());
+response.setTariffValue(tariff.getCurrencyValue());
+response.setEffectiveOn(tariff.getEffectiveOn());
+response.setDescription(tariff.getDescription());
+response.setCurrency(QuotaConfig.QuotaCurrencySymbol.value());
+return response;
+}
+
+@Override
+public QuotaBalanceResponse 
createQuotaBalanceResponse(List quotaBalance, Date startDate, 
Date endDate) {
+if (quotaBalance.size() == 0) {
+new InvalidParameterValueException("The request period d

[GitHub] cloudstack pull request: Quota master

2015-08-23 Thread abhinandanprateek
Github user abhinandanprateek commented on the pull request:

https://github.com/apache/cloudstack/pull/689#issuecomment-134027847
  
@jburwell  @DaanHoogland There is a underlying connection pool to save on 
expensive db connection operations. Moreover this cost should be similar to 
opening and closing transactions without switching DB.
I think we should divide the DB transaction issue into two:
1. The expense of the operation and how it can be avoided. My initial 
thoughts are that this is trivial and non issue.
2. The way a DB switch is affected, is there a better pattern ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: [cloudstack] Changed variable s_logger to non-static and fixed its name in “com.cloud.utils.component.ComponentLifecycleBase” and its subclasses (#714)

2015-08-23 Thread Rajani Karuturi
Hi Rafael,
I assigned the issue while doing some jira cleanup. I saw some PRs in the
comments. I thought you werent able to assign it yourslef as you didnt have
the required permissions. Hence, I gave them and assigned the ticket to
you. sorry for the trouble.

~Rajani

On Sat, Aug 22, 2015 at 2:22 AM, Daan Hoogland 
wrote:

> H Rafael, I saw Rajani assigning the ticket to Pedro and as he created it I
> thought he would be informed of it so he can undo if needed.
>
> Thanks for the report. Due to the extensiveness I can not determine the
> full implication but as it seems the largest part (132/167) are spring
> instantiated singletons I am alright with investigating further.
>
> You can reopen or create a new PR. Equal to me but for your own tracking
> reopening the last one might be convenient.
>
> As far as I know the @Local are remnants of an abandoned architectural
> path. Investigation needed. You will find some corpses and babies in
> closets on this quest! good hunting and thanks for picking it up.
>
> On Fri, Aug 21, 2015 at 9:54 PM, Rafael Weingartner <
> notificati...@github.com> wrote:
>
> > Hi @DaanHoogland , after we opened the
> > Jira Ticket, someone ended up assigning them to us!? So, we decided to
> take
> > a lead and analyzed the impact that the proposed changed may cause. It
> > turns out that most of the classes of that hierarchic are singletons,
> > therefore it would not have an impact on memory consumption. The result
> of
> > the analysis is the following:
> >
> > Beans instantiated with @Component :
> > 1.
> >
> /cloudstack/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
> > 2.
> >
> /cloudstack/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
> > 3.
> >
> /cloudstack/plugins/api/rate-limit/src/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java
> > 4.
> >
> /cloudstack/server/src/com/cloud/agent/manager/authn/impl/BasicAgentAuthManager.java
> > 5.
> >
> /cloudstack/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
> > 6.
> >
> /cloudstack/plugins/network-elements/brocade-vcs/src/com/cloud/network/element/BrocadeVcsElement.java
> > 7.
> >
> /cloudstack/server/src/com/cloud/hypervisor/CloudZonesStartupProcessor.java
> > 8. /cloudstack/server/src/com/cloud/alert/ClusterAlertAdapter.java
> > 9.
> >
> /cloudstack/engine/orchestration/src/com/cloud/cluster/agentlb/ClusterBasedAgentLoadBalancerPlanner.java
> > 10. /cloudstack/server/src/com/cloud/alert/ConsoleProxyAlertAdapter.java
> > 11.
> >
> /cloudstack/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
> > 12.
> >
> /cloudstack/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailVpcElementImpl.java
> > 13.
> >
> /cloudstack/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ManagementNetworkGuru.java
> > 14.
> >
> /cloudstack/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
> > 15. /cloudstack/server/src/com/cloud/resource/DummyHostDiscoverer.java
> > 16.
> >
> /cloudstack/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/element/ElasticLoadBalancerElement.java
> > 17.
> >
> /cloudstack/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
> > 18.
> >
> /cloudstack/server/src/com/cloud/agent/manager/allocator/impl/RecreateHostAllocator.java
> > 19.
> >
> /cloudstack/plugins/network-elements/globodns/src/com/globo/globodns/cloudstack/element/GloboDnsElement.java
> > 20.
> >
> /cloudstack/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetGuestNetworkGuru.java
> > 21.
> >
> /cloudstack/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
> > 22.
> >
> /cloudstack/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java
> > 23.
> >
> /cloudstack/plugins/network-elements/midonet/src/com/cloud/network/element/MidoNetElement.java
> > 24.
> >
> /cloudstack/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
> > 25.
> >
> /cloudstack/plugins/network-elements/opendaylight/src/main/java/org/apache/cloudstack/network/opendaylight/OpendaylightElement.java
> > 26.
> >
> /cloudstack/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java
> > 27. /cloudstack/server/src/com/cloud/ha/RecreatableFencer.java
> > 28.
> >
> /cloudstack/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthManagerImpl.java
> > 29.
> >
> /cloudstack/server/src/com/cloud/alert/SecondaryStorageVmAlertAdapter.java
> > 30.
> >
> /cloudstack/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
> > 31. /cloudstack/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.jav

[GitHub] cloudstack pull request: CLOUDSTACK-8727: API call listVirtualMach...

2015-08-23 Thread kansal
Github user kansal commented on the pull request:

https://github.com/apache/cloudstack/pull/685#issuecomment-134027948
  
@kishankavala @DaanHoogland Can you please review it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8733: Host stuck in rebalancin...

2015-08-23 Thread koushik-das
Github user koushik-das commented on the pull request:

https://github.com/apache/cloudstack/pull/698#issuecomment-134030313
  
Merging as 2 LGTMs


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8757:FTP modules are not loade...

2015-08-23 Thread shwetaag
Github user shwetaag commented on the pull request:

https://github.com/apache/cloudstack/pull/729#issuecomment-134030869
  
@remibergsma : i have added details to the bug . Copy pasting for your 
reference 
To have Active FTP working in isolated networks VRs need the have the 
following modules loaded (In order to map the FTP Data and FTP CMD to the same 
frontend IP):

modprobe nf_conntrack_ftp
modprobe nf_nat_ftp

in some versions of Cloudstack we noted that these modules are not loaded 
on CS Routers by default  . So this test case is for verifying that these 
modules are loaded by default in VR and if not report an error


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8733: Host stuck in rebalancin...

2015-08-23 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cloudstack/pull/698


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8756:Incorrect guest os mappin...

2015-08-23 Thread shwetaag
Github user shwetaag commented on the pull request:

https://github.com/apache/cloudstack/pull/728#issuecomment-134034345
  
@remibergsma   the issue was of incorrect mapping of centos guest os 
(grater than 5.9 ) in cloud stack .CS was sending wrong info to Vcenter to 
launch VMs and centos VMs guest os is set to others .
This will cause CentOS( 5.9 or any other greater version)  unable to be 
provided on VMware certain operations like attach and detach iso.
so this test case is about verifying that attach and detach iso is working 
fine with vmware VMs  especially when using centos guest os


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8754: VM migration triggered b...

2015-08-23 Thread koushik-das
Github user koushik-das commented on the pull request:

https://github.com/apache/cloudstack/pull/725#issuecomment-134038561
  
@DaanHoogland I have verified using the simulator based on the repro steps 
mentioned in the bug. I found some issues in the simulator while testing this 
issue end-to-end, will push the simulator fixes as a separate PR.

Also I had done a (de)serialization test for VmWorkMigrateForScale. But I 
don't want to have it as unit test unless I see a valid justification (or some 
better way to test it).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Replace some profiler.getDuration with pr...

2015-08-23 Thread karuturi
Github user karuturi commented on the pull request:

https://github.com/apache/cloudstack/pull/730#issuecomment-134047200
  
The changes look good to me :+1: from my end.
But, I would like @wilderrodrigues to review this as the profiler was 
refactored by him in commit 5557ad55880f981c2621a4f411b80e4301469104 (the 
behavior of getDuration hasnt changed in the refactoring but want to double 
check)

@ustcweizhou, looks like clustered management server behavior would be 
affected due to this as the interpretation of config value 
`cluster.heartbeat.interval` has changed from ns to ms. Can you please log a 
defect with the actual issue and link it here?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: [VOTE] Release Apache CloudStack CloudMonkey 5.3.2 (Round 2)

2015-08-23 Thread Rohit Yadav
Thanks Bruno for voting.

Looks like we’ve enough votes to pass this round for the minor release CM 5.3.2.

On 23-Aug-2015, at 11:29 pm, Milamber 
mailto:milam...@apache.org>> wrote:

Hello,

+1 (binding)

Some basics tests (list, create vm, static nat, fw rule, stop vm, etc.) on CS 
4.5.1, KVM.

Thanks to the RM.

Milamber

On 23/08/2015 16:08, Rohit Yadav wrote:
Hi all,

The 72 hours voting window has finished and we lack enough votes to pass this 
candidate. The voting thread will be indefinitely open now, unless we find a 
major issue or blocker.

Please consider testing and voting this candidate. Thanks.

On 20-Aug-2015, at 12:20 pm, Rajani Karuturi 
mailto:raj...@apache.org> > wrote:

+1 (binding)

built from source, could deply vm, create disk, attack disk, list vms etc.

~Rajani

On Wed, Aug 19, 2015 at 2:55 PM, Rohit Yadav 
mailto:rohit.ya...@shapeblue.com> 
>
wrote:

+1 (binding)

Tested to deploy KVM zones using an existing cloudmonkey/bash script, and
tested to register ssh public keys.


On 19-Aug-2015, at 2:39 pm, Rohit Yadav 
mailto:rohityada...@gmail.com> 
> wrote:

Hi All,

I've created a 5.3.2 release of CloudMonkey, with the following
artifacts up for a vote:

Git Branch and Commit SH:

https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=shortlog;h=refs/heads/master
Commit: 653dcca9e008e20fee83f0b40f388611ad931d15

List of changes:

https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=blob_plain;f=CHANGES.md;hb=master

Source release (checksums and signatures are available at the same
location):
https://dist.apache.org/repos/dist/dev/cloudstack/cloudmonkey-5.3.2/

PGP release keys (signed using 0EE3D884):
https://dist.apache.org/repos/dist/release/cloudstack/KEYS

The vote will be open for 72 hours.

For sanity in tallying the vote, can PMC members please be sure to
indicate "(binding)" with their vote?

[ ] +1  approve
[ ] +0  no opinion
[ ] -1  disapprove (and reason why)

Regards.


Regards,
Rohit Yadav
Software Architect, ShapeBlue




M. +91 88 262 30892 | rohit.ya...@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab




Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build

CSForge – rapid IaaS deployment framework 
CloudStack Consulting 
CloudStack Software Engineering

CloudStack Infrastructure Support

CloudStack Bootcamp Training Courses


This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Shape Blue Ltd or related companies. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error. Shape Blue Ltd is a
company incorporated in England & Wales. ShapeBlue Services India LLP is a
company incorporated in India and is operated under license from Shape Blue
Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil
and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is
a company registered by The Republic of South Africa and is traded under
license from Shape Blue Ltd. ShapeBlue is a registered trademark.


Regards,
Rohit Yadav
Software Architect, ShapeBlue




M. +91 88 262 30892 | 
rohit.ya...@shapeblue.com 

Blog: bhaisaab.org  | Twitter: 
@_bhaisaab




Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build 
CSForge – rapid IaaS deployment framework 
CloudStack Consulting 
CloudStack Software Engineering 

CloudStack Infrastructure Support 

CloudStack Bootcamp Training Courses 

This email and any attachments to it may be confidential and are intended 
solely for the use of the individual to whom it is addressed. Any views or 
opinions expressed are solely those of the author and do not necessarily 
represent those of Shape Blue Ltd or related companies. If you are not the 
intended recipient of this email, you must neither take any action based upon 
its contents, nor copy or show it to anyone. Please conta

[RESULT][VOTE] Apache CloudStack CloudMonkey 5.3.2

2015-08-23 Thread Rohit Yadav
Hi all,

After 72 hours, the vote for CloudStack CloudMonkey 5.3.2 [1] *passes* with
3 PMC + 0 non-PMC votes.

+1 (PMC / binding)
3 person (Bruno, Rajani, Rohit)

+1 (non binding)
0 person

0
none

-1
none

Thanks to everyone participating.

I will now prepare the release announcement to go out after 24 hours
to give the mirrors time to catch up.

[1] http://markmail.org/message/ichisejdp37t5f7q

Regards.


[GitHub] cloudstack pull request: CLOUDSTACK-8755: xs-tools.iso missing fro...

2015-08-23 Thread sanju1010
Github user sanju1010 commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/727#discussion_r37721518
  
--- Diff: test/integration/smoke/test_iso.py ---
@@ -600,6 +603,6 @@ def test_07_list_default_iso(self):
 # list ISO should list default ISOS (VM and xen tools)
 
 # ListIsos to list default ISOS (VM and xen tools)
-self.get_iso_details("xs-tools.iso")
 self.get_iso_details("vmware-tools.iso")
+self.get_iso_details("xs-tools.iso")
--- End diff --

This is a good use case for using map instead of calling the 
get_iso_details twice. Otherwise LGTM !!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---