[cloudstack-documentation] branch secgroup-ipv6 created (now a16bcd1)

2021-06-10 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a change to branch secgroup-ipv6
in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git.


  at a16bcd1   Inclusivity changes for CloudStack in the documentation - 
Rename default git branch name from 'master' to 'main' and replace some 
offensive words/terms as appropriate (#155)

No new revisions were added by this update.


[cloudstack-documentation] branch secgroup-ipv6 updated: security groups: Add a few lines about IPv6

2021-06-10 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch secgroup-ipv6
in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git


The following commit(s) were added to refs/heads/secgroup-ipv6 by this push:
 new efff642  security groups: Add a few lines about IPv6
efff642 is described below

commit efff6425146b5e6c255cbaaa3d503c3784c510d1
Author: Wido den Hollander 
AuthorDate: Thu Jun 10 11:28:40 2021 +0200

security groups: Add a few lines about IPv6
---
 source/adminguide/networking/security_groups.rst | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/source/adminguide/networking/security_groups.rst 
b/source/adminguide/networking/security_groups.rst
index 8ef58b8..a82ced9 100644
--- a/source/adminguide/networking/security_groups.rst
+++ b/source/adminguide/networking/security_groups.rst
@@ -86,6 +86,8 @@ advanced zone where KVM is the hypervisor. Using security 
groups in
 advanced zones rather than multiple VLANs allows a greater range of
 options for setting up guest isolation in a cloud.
 
+Both IPv4 and IPv6 are supported when using Security Groups.
+
 
 Limitations
 ^^^
@@ -155,8 +157,9 @@ Adding Ingress and Egress Rules to a Security Group
-  **CIDR**. (Add by CIDR only) To accept only traffic from IP
   addresses within a particular address block, enter a CIDR or a
   comma-separated list of CIDRs. The CIDR is the base IP address of
-  the incoming traffic. For example, 192.168.0.0/22. To allow all
-  CIDRs, set to 0.0.0.0/0.
+  the incoming traffic. For example, 192.168.0.0/22 or
+  2001:db8:100::/64. To allow all CIDRs, set to 0.0.0.0/0 (IPv4) or
+  ::/0 (IPv6).
 
-  **Account, Security Group**. (Add by Account only) To accept only
   traffic from another security group, enter the CloudStack account
@@ -198,8 +201,8 @@ Adding Ingress and Egress Rules to a Security Group
-  **CIDR**. (Add by CIDR only) To send traffic only to IP addresses
   within a particular address block, enter a CIDR or a
   comma-separated list of CIDRs. The CIDR is the base IP address of
-  the destination. For example, 192.168.0.0/22. To allow all CIDRs,
-  set to 0.0.0.0/0.
+  the destination. For example, 192.168.0.0/22 or 2001:db8:200::/64.
+  To allow all CIDRs, set to 0.0.0.0/0 (IPv4) or ::/0 (IPv6).
 
-  **Account, Security Group**. (Add by Account only) To allow
   traffic to be sent to another security group, enter the CloudStack


[cloudstack-primate] branch tools-docker created (now 7a39c38)

2021-01-13 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a change to branch tools-docker
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git.


  at 7a39c38  tools/docker: Change directory to docker.sh's directory

This branch includes the following new commits:

 new 7a39c38  tools/docker: Change directory to docker.sh's directory

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[cloudstack-primate] 01/01: tools/docker: Change directory to docker.sh's directory

2021-01-13 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch tools-docker
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git

commit 7a39c38fe9a620633ce1a1116120336f4fffdd73
Author: Wido den Hollander 
AuthorDate: Wed Jan 13 13:31:01 2021 +0100

tools/docker: Change directory to docker.sh's directory

By switching to this directory we can use relative paths regardless
of how people execute the script.

cd tools
./docker.sh

OR

./tools/docker.sh

OR

/path/to/git-repo/tools/docker.sh
---
 tools/docker.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/docker.sh b/tools/docker.sh
index 21406b6..6b8ecdb 100755
--- a/tools/docker.sh
+++ b/tools/docker.sh
@@ -19,6 +19,8 @@
 set -e
 set -x
 
+cd $(dirname $0)
+
 GIT_TAG="$(git tag --points-at | head -n 1)"
 if [ -n "${GIT_REV}" ]; then
LABEL_GIT_TAG="--label \"org.opencontainers.image.version=${GIT_TAG}\""



[cloudstack] 02/02: Start services after enabling them using systemd

2017-08-14 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit ac2d47421fbccd9cd12847333b5c68e7b25826bd
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Mon Aug 14 15:01:21 2017 +0200

Start services after enabling them using systemd

In addition remove /etc/init.d/cloud as this is no longer needed and done 
by systemd

Signed-off-by: Wido den Hollander <w...@widodh.nl>
---
 systemvm/patches/debian/config/etc/init.d/cloud| 155 -
 .../debian/config/etc/init.d/cloud-early-config|  22 ++-
 2 files changed, 8 insertions(+), 169 deletions(-)

diff --git a/systemvm/patches/debian/config/etc/init.d/cloud 
b/systemvm/patches/debian/config/etc/init.d/cloud
deleted file mode 100755
index 9b3a63b..000
--- a/systemvm/patches/debian/config/etc/init.d/cloud
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/bin/bash
-### BEGIN INIT INFO
-# Provides:  cloud
-# Required-Start:$local_fs cloud-early-config
-# Required-Stop: $local_fs
-# Default-Start: 3 4 5
-# Default-Stop:  0 1 6
-# Short-Description: Start up the CloudStack cloud service
-### END INIT INFO
-# 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.
-
-#set -x
-
-ENABLED=0
-[ -e /etc/default/cloud ] && . /etc/default/cloud
-
-CMDLINE=$(cat /var/cache/cloud/cmdline)
-
-if [ ! -z $CLOUD_DEBUG ];then
-  LOG_FILE=/var/log/cloud/cloud.out
-else
-  LOG_FILE=/dev/null
-fi
-
-TYPE="router"
-for i in $CMDLINE
-  do
-# search for foo=bar pattern and cut out foo
-FIRSTPATTERN=$(echo $i | cut -d= -f1)
-case $FIRSTPATTERN in 
-  type)
-  TYPE=$(echo $i | cut -d= -f2)
-  ;;
-esac
-done
-
-# Source function library.
-if [ -f /etc/init.d/functions ]
-then
-  . /etc/init.d/functions
-fi
-
-if [ -f ./lib/lsb/init-functions ]
-then
-  . /lib/lsb/init-functions
-fi
-
-_success() {
-  if [ -f /etc/init.d/functions ]
-  then
-success
-  else
-echo "Success"
-  fi
-}
-
-_failure() {
-  if [ -f /etc/init.d/functions ]
-  then
-failure
-  else
-echo "Failed"
-  fi
-}
-RETVAL=$?
-CLOUDSTACK_HOME="/usr/local/cloud"
-if [ -f  $CLOUDSTACK_HOME/systemvm/utils.sh ];
-then
-  . $CLOUDSTACK_HOME/systemvm/utils.sh
-else
-  _failure
-fi
-
-# mkdir -p /var/log/vmops
-
-start() {
-   local pid=$(get_pids)
-   if [ "$pid" != "" ]; then
-   echo "CloudStack cloud sevice is already running, PID = $pid"
-   return 0
-   fi
-
-   echo -n "Starting CloudStack cloud service (type=$TYPE) "
-   if [ -f $CLOUDSTACK_HOME/systemvm/run.sh ];
-   then
- if [ "$pid" == "" ]
- then
-   (cd $CLOUDSTACK_HOME/systemvm; nohup ./run.sh > $LOG_FILE 2>&1 & )
-   pid=$(get_pids)
-   echo $pid > /var/run/cloud.pid 
- fi
- _success
-   else
- _failure
-   fi
-   echo
-   echo 'start' > $CLOUDSTACK_HOME/systemvm/user_request
-}
-
-stop() {
-  local pid
-  echo -n  "Stopping CloudStack cloud service (type=$TYPE): "
-  for pid in $(get_pids)
-  do
-kill $pid
-  done
-  _success
-  echo
-  echo 'stop' > $CLOUDSTACK_HOME/systemvm/user_request
-}
-
-status() {
-  local pids=$(get_pids)
-  if [ "$pids" == "" ]
-  then
-echo "CloudStack cloud service is not running"
-return 1
-  fi
-  echo "CloudStack cloud service (type=$TYPE) is running: process id: $pids"
-  return 0
-}
-
-[ "$ENABLED" != 0 ] || exit 0 
-
-case "$1" in
-   start) start
- ;;
-stop) stop
- ;;
-status) status
- ;;
- restart) stop
-  start
- ;;
-   *) echo "Usage: $0 {start|stop|status|restart}"
- exit 1
- ;;
-esac
-
-exit $RETVAL
diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config 
b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
index 655266c..6eaed91 100755
--- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config
+++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config

[cloudstack] branch debian9-systemvmtemplate updated (d333603 -> ac2d474)

2017-08-14 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a change to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


from d333603  Disable most services by default and enable in 
cloud-early-config
 new 09c2b04  Ignore files from build of SSVM
 new ac2d474  Start services after enabling them using systemd

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore |   2 +
 systemvm/patches/debian/config/etc/init.d/cloud| 155 -
 .../debian/config/etc/init.d/cloud-early-config|  22 ++-
 3 files changed, 10 insertions(+), 169 deletions(-)
 delete mode 100755 systemvm/patches/debian/config/etc/init.d/cloud

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].


[cloudstack] 01/02: Ignore files from build of SSVM

2017-08-14 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 09c2b04d8dc8bd7636b982365382fad274a2f6b8
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Fri Aug 11 09:31:48 2017 +0200

Ignore files from build of SSVM

Signed-off-by: Wido den Hollander <w...@widodh.nl>
---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitignore b/.gitignore
index 29b4ffc..1a73724 100644
--- a/.gitignore
+++ b/.gitignore
@@ -97,3 +97,5 @@ systemvm/.pydevproject
 test/.pydevprojec
 plugins/hypervisors/kvm/.pydevproject
 scripts/.pydevproject
+*.qcow2
+*.raw

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.


[cloudstack] branch debian9-systemvmtemplate updated: Disable most services by default and enable in cloud-early-config

2017-08-10 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/debian9-systemvmtemplate by 
this push:
 new d333603  Disable most services by default and enable in 
cloud-early-config
d333603 is described below

commit d3336030b9d727117058acc2d4f4d66d747d0e96
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Thu Aug 10 16:40:22 2017 +0200

Disable most services by default and enable in cloud-early-config

Not sure though if enabling them is enough for systemd to still start them
on first boot

Signed-off-by: Wido den Hollander <w...@widodh.nl>
---
 .../debian/config/etc/init.d/cloud-early-config| 35 +-
 .../configure_systemvm_services.sh |  6 ++--
 2 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config 
b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
index 1d3a890..655266c 100755
--- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config
+++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
@@ -935,11 +935,8 @@ setup_router() {
   echo "$ETH0_IP $NAME" >> /etc/hosts
 
 
-  enable_svc dnsmasq 1
-  enable_svc haproxy 1
+  systemctl enable dnsmasq haproxy cloud-passwd-srvr
   enable_irqbalance 1
-  enable_svc cloud-passwd-srvr 1
-  enable_svc cloud 0
   disable_rpfilter_domR
   enable_fwding 1
   enable_rpsrfs 1
@@ -1028,12 +1025,9 @@ EOF
 
   setup_vpc_apache2
 
-  enable_svc dnsmasq 1
-  enable_svc haproxy 1
+  systemctl enable dnsmasq haproxy cloud-passwd-srvr
   enable_irqbalance 1
   enable_vpc_rpsrfs 1
-  enable_svc cloud 0
-  enable_svc cloud-passwd-srvr 1
   disable_rpfilter
   enable_fwding 1
   cp /etc/iptables/iptables-vpcrouter /etc/iptables/rules.v4
@@ -1078,11 +1072,8 @@ setup_dhcpsrvr() {
   [ $ETH0_IP ] && echo "$ETH0_IP $NAME" >> /etc/hosts
   [ $ETH0_IP6 ] && echo "$ETH0_IP6 $NAME" >> /etc/hosts
 
-  enable_svc dnsmasq 1
-  enable_svc haproxy 0
+  systemctl enable dnsmasq cloud-passwd-srvr
   enable_irqbalance 0
-  enable_svc cloud-passwd-srvr 1
-  enable_svc cloud 0
   enable_fwding 0
   systemctl disable nfs-common
 
@@ -1208,11 +1199,9 @@ CORS
 
   disable_rpfilter
   enable_fwding 0
-  enable_svc haproxy 0
+  systemctl disable haproxy dnsmasq cloud-passwd-srvr
+  systemctl enable cloud
   enable_irqbalance 0
-  enable_svc dnsmasq 0
-  enable_svc cloud-passwd-srvr 0
-  enable_svc cloud 1
   rm /etc/logrotate.d/cloud
   setup_ntp
 }
@@ -1233,13 +1222,10 @@ setup_console_proxy() {
 setup_sshd $ETH0_IP "eth0"
   fi
 
+  systemctl enable cloud
   disable_rpfilter
   enable_fwding 0
-  enable_svc haproxy 0
   enable_irqbalance 0
-  enable_svc dnsmasq 0
-  enable_svc cloud-passwd-srvr 0
-  enable_svc cloud 1
   systemctl disable nfs-common
   rm /etc/logrotate.d/cloud
 }
@@ -1263,11 +1249,7 @@ setup_elbvm() {
   fi
   
   enable_fwding 0
-  enable_svc haproxy 0
   enable_irqbalance 0
-  enable_svc dnsmasq 0
-  enable_svc cloud-passwd-srvr 0
-  enable_svc cloud 0
   systemctl disable nfs-common
   systemctl disable portmap
 }
@@ -1286,11 +1268,8 @@ setup_ilbvm() {
   setup_sshd $ETH1_IP "eth1"
   
   enable_fwding 0
-  enable_svc haproxy 1
+  systemctl enable haproxy
   enable_irqbalance 1
-  enable_svc dnsmasq 0
-  enable_svc cloud-passwd-srvr 0
-  enable_svc cloud 0
   systemctl disable nfs-common
   systemctl disable portmap
 }
diff --git 
a/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh 
b/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
index 171c4b0..1386465 100644
--- 
a/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
+++ 
b/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
@@ -107,8 +107,8 @@ EOF
 
   systemctl daemon-reload
   systemctl enable cloud-early-config
-  systemctl enable cloud-passwd-srvr
-  systemctl enable cloud
+  systemctl disable cloud-passwd-srvr
+  systemctl disable cloud
 }
 
 function do_signature() {
@@ -143,6 +143,8 @@ function configure_services() {
   systemctl disable x11-common
   systemctl disable console-setup
   systemctl disable haproxy
+  systemctl disable apache2
+  systemctl disable dnsmasq
 
   # Hyperv kvp daemon - 64bit only
   local arch=`dpkg --print-architecture`

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].


[cloudstack] branch debian9-systemvmtemplate updated: Accept DOS/MBR as file format for ISO images as well

2017-08-10 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/debian9-systemvmtemplate by 
this push:
 new 325b083  Accept DOS/MBR as file format for ISO images as well
325b083 is described below

commit 325b083f133d5023bd3b399d92c2af5ad34da7da
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Thu Aug 10 14:57:40 2017 +0200

Accept DOS/MBR as file format for ISO images as well

Under Debian 7 the 'file' command would return:

  debian-9.1.0-amd64-netinst.iso: ISO 9660 CD-ROM filesystem data UDF 
filesystem data

Under Debian 9 however it will return

  debian-9.1.0-amd64-netinst.iso: DOS/MBR boot sector

This would make the HTTPTemplateDownloader in the Secondary Storage VM 
refuse the ISO as
a valid template because it's not a correct format.

Changes this behavior so that it accepts both.

This allows us to use Debian 9 as a System VM template.

Signed-off-by: Wido den Hollander <w...@widodh.nl>
---
 .../java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java
 
b/utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java
index ed13360..e754a8e 100644
--- 
a/utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java
+++ 
b/utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java
@@ -81,7 +81,7 @@ public class ImageStoreUtil {
 return "";
 }
 
-if (output.contains("ISO 9660") && isCorrectExtension(uripath, "iso")) 
{
+if ((output.startsWith("ISO 9660") || output.startsWith("DOS/MBR")) && 
isCorrectExtension(uripath, "iso")) {
 s_logger.debug("File at path " + path + " looks like an iso : " + 
output);
 return "";
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].


[cloudstack] branch debian9-systemvmtemplate updated (6c8fbc9 -> 538f286)

2017-08-10 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a change to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


from 6c8fbc9  CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9
 new 18f725c  Load the nf_conntrack_ipv6 module for IPv6 connection 
tracking on SSVM
 new 538f286  Move systemd services to /etc and enable services after they 
have been installed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../systemvmtemplate/configure_conntrack.sh|  1 +
 .../configure_systemvm_services.sh | 24 +++---
 2 files changed, 13 insertions(+), 12 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].


[cloudstack] 01/02: Load the nf_conntrack_ipv6 module for IPv6 connection tracking on SSVM

2017-08-10 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 18f725ca6c363619439ad20f79d3cf04986a596d
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Thu Aug 10 13:51:11 2017 +0200

Load the nf_conntrack_ipv6 module for IPv6 connection tracking on SSVM

Signed-off-by: Wido den Hollander <w...@widodh.nl>
---
 tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh 
b/tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh
index 54ec41b..c898afc 100644
--- a/tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh
+++ b/tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh
@@ -35,6 +35,7 @@ function load_conntrack_modules() {
 
   cat >> /etc/modules << EOF
 nf_conntrack_ipv4
+nf_conntrack_ipv6
 nf_conntrack
 nf_conntrack_ftp
 nf_nat_ftp

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.


[cloudstack] 02/02: Move systemd services to /etc and enable services after they have been installed

2017-08-10 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 538f2865bd264d772bc77cd5893d29fa805cab72
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Thu Aug 10 14:36:52 2017 +0200

Move systemd services to /etc and enable services after they have been 
installed

Signed-off-by: Wido den Hollander <w...@widodh.nl>
---
 .../configure_systemvm_services.sh | 24 +++---
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git 
a/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh 
b/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
index f3bd52a..171c4b0 100644
--- 
a/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
+++ 
b/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
@@ -36,10 +36,10 @@ function install_cloud_scripts() {
   rsync -av ./cloud_scripts/ /
   chmod +x /opt/cloud/bin/* \
 /root/{clearUsageRules.sh,reconfigLB.sh,monitorServices.py} \
-/etc/init.d/{cloud,cloud-early-config,cloud-passwd-srvr,postinit} \
+/etc/init.d/{cloud-early-config,cloud-passwd-srvr,postinit} \
 /etc/profile.d/cloud.sh
 
-  cat > /lib/systemd/system/cloud-early-config.service << EOF
+  cat > /etc/systemd/system/cloud-early-config.service << EOF
 [Unit]
 Description=cloud-early-config: configure according to cmdline
 DefaultDependencies=no
@@ -57,7 +57,7 @@ TimeoutStartSec=5min
 
 EOF
 
-  cat > /lib/systemd/system/cloud.service << EOF
+  cat > /etc/systemd/system/cloud.service << EOF
 [Unit]
 Description=cloud: startup cloud service
 After=cloud-early-config.service network.target local-fs.target
@@ -66,14 +66,14 @@ After=cloud-early-config.service network.target 
local-fs.target
 WantedBy=multi-user.target
 
 [Service]
-Type=forking
-ExecStart=/etc/init.d/cloud start
-ExecStop=/etc/init.d/cloud stop
-RemainAfterExit=true
-TimeoutStartSec=5min
+Type=simple
+WorkingDirectory=/usr/local/cloud/systemvm
+ExecStart=/usr/local/cloud/systemvm/_run.sh
+Restart=always
+RestartSec=5
 EOF
 
-  cat > /lib/systemd/system/cloud-passwd-srvr.service << EOF
+  cat > /etc/systemd/system/cloud-passwd-srvr.service << EOF
 [Unit]
 Description=cloud-passwd-srvr: cloud password server
 After=network.target local-fs.target
@@ -89,7 +89,7 @@ RemainAfterExit=true
 TimeoutStartSec=5min
 EOF
 
-  cat > /lib/systemd/system/postinit.service << EOF
+  cat > /etc/systemd/system/postinit.service << EOF
 [Unit]
 Description=cloud post-init service
 After=cloud-early-config.service network.target local-fs.target
@@ -107,8 +107,8 @@ EOF
 
   systemctl daemon-reload
   systemctl enable cloud-early-config
-  systemctl disable cloud-passwd-srvr
-  systemctl disable cloud
+  systemctl enable cloud-passwd-srvr
+  systemctl enable cloud
 }
 
 function do_signature() {

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.


[cloudstack-www] branch master updated: Update GIT URLs to point to Gitbox

2017-04-17 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-www.git

The following commit(s) were added to refs/heads/master by this push:
   new  654e141   Update GIT URLs to point to Gitbox
654e141 is described below

commit 654e141126d94be54978039e268ce93a59ffbe94
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Mon Apr 17 10:59:21 2017 +0200

Update GIT URLs to point to Gitbox

After we moved to Github we have new GIT URLs.

Signed-off-by: Wido den Hollander <w...@widodh.nl>
---
 source/developers.markdown | 8 
 source/downloads.md.erb| 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/source/developers.markdown b/source/developers.markdown
index 002130a..c99e158 100644
--- a/source/developers.markdown
+++ b/source/developers.markdown
@@ -58,7 +58,7 @@ $ git config --global user.email y...@domain.com
 You'll grab the CloudStack source with git:
 
 
-$ git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git
+$ git clone https://gitbox.apache.org/repos/asf/cloudstack.git
 
 
 If you already have the source, make sure you're working with the most 
recent version. Do a `git pull` if you cloned the source more than a few hours 
ago. (Apache CloudStack development can move pretty fast!)
@@ -139,8 +139,8 @@ $ git checkout -b mybranch
 The git repositories are hosted on Apache infrastructure, and can be found 
here:
 
 
-https://git-wip-us.apache.org/repos/asf/cloudstack.git; 
target="_blank">Apache CloudStack source code
-https://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey.git; 
target="_blank">Apache CloudStack Cloudmonkey source code
+https://gitbox.apache.org/repos/asf/cloudstack.git; 
target="_blank">Apache CloudStack source code
+https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git; 
target="_blank">Apache CloudStack Cloudmonkey source code
 https://github.com/apache/cloudstack-ec2stack; 
target="_blank">Apache CloudStack EC2stack Inteface
 https://github.com/apache/cloudstack-gcestack; 
target="_blank">Apache CloudStack GCEstack Interface
 https://github.com/apache/cloudstack-docs; 
target="_blank">General Documentation
@@ -153,7 +153,7 @@ $ git checkout -b mybranch
 To get the most recent source for Apache CloudStack, use:
 
 
-git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git
+git clone https://gitbox.apache.org/repos/asf/cloudstack.git
 
 
 Similarly, clone the cloudstack-cloudmonkey repository or the other 
repositories to get access to the most recent source of all CloudStack 
subprojects.
diff --git a/source/downloads.md.erb b/source/downloads.md.erb
index e79e5cc..2337397 100644
--- a/source/downloads.md.erb
+++ b/source/downloads.md.erb
@@ -199,7 +199,7 @@ CloudMonkey's most current release is <%= 
data.cloudstack.cloudmonkey.version %>
 
 
 
-Instructions for building and installing from source can be found in the 
included 
[README.md](https://git-wip-us.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=blob_plain;f=README.md)
 file.
+Instructions for building and installing from source can be found in the 
included 
[README.md](https://gitbox.apache.org/repos/asf?p=cloudstack-cloudmonkey.git;a=blob_plain;f=README.md)
 file.
 
  PyPi Package
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].


[cloudstack] branch master updated (3f29ace -> b8dd08c)

2017-04-17 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.

  from  3f29ace   Merge pull request #1771 from nitin-maharana/nitin3
  adds  a3f351c   [CLOUDSTACK-9858] Retirement of midonet plugin (build 
disabling)
   new  b8dd08c   Merge pull request #2036 from 
rafaelweingartner/midoneDisablingForRetirement

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 plugins/pom.xml | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].


[cloudstack] 01/01: Merge pull request #2036 from rafaelweingartner/midoneDisablingForRetirement

2017-04-17 Thread widodh
This is an automated email from the ASF dual-hosted git repository.

widodh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit b8dd08c3621e65265910ded8d78e53904a8cdc9f
Merge: 3f29ace a3f351c
Author: Wido den Hollander <w...@widodh.nl>
AuthorDate: Mon Apr 17 10:51:55 2017 +0200

Merge pull request #2036 from rafaelweingartner/midoneDisablingForRetirement

[CLOUDSTACK-9858] Retirement of midonet plugin (build disabling)

(This is also a test for me to see if Github merges work properly)

 plugins/pom.xml | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.


cloudstack-docs-install git commit: Updated KVM hypervisor requirements

2015-11-24 Thread widodh
Repository: cloudstack-docs-install
Updated Branches:
  refs/heads/master c7b7d30d4 -> 86889dae2


Updated KVM hypervisor requirements


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/commit/86889dae
Tree: 
http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/tree/86889dae
Diff: 
http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/diff/86889dae

Branch: refs/heads/master
Commit: 86889dae29c77dc7b0ac57359d6a6fe1c3dccbda
Parents: c7b7d30
Author: Wido den Hollander 
Authored: Tue Nov 24 18:28:34 2015 +0100
Committer: Wido den Hollander 
Committed: Tue Nov 24 18:28:34 2015 +0100

--
 source/hypervisor/kvm.rst | 60 +-
 1 file changed, 30 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/blob/86889dae/source/hypervisor/kvm.rst
--
diff --git a/source/hypervisor/kvm.rst b/source/hypervisor/kvm.rst
index f729998..d896758 100644
--- a/source/hypervisor/kvm.rst
+++ b/source/hypervisor/kvm.rst
@@ -24,23 +24,23 @@ KVM is included with a variety of Linux-based operating 
systems.
 Although you are not required to run these distributions, the following
 are recommended:
 
--  CentOS / RHEL: 6.3
+-  CentOS / RHEL: 7.X
 
--  Ubuntu: 12.04(.1)
+-  Ubuntu: 14.04
 
 The main requirement for KVM hypervisors is the libvirt and Qemu
 version. No matter what Linux distribution you are using, make sure the
 following requirements are met:
 
--  libvirt: 0.9.4 or higher
+-  libvirt: 1.2.0 or higher
 
--  Qemu/KVM: 1.0 or higher
+-  Qemu/KVM: 2.0 or higher
 
 The default bridge in CloudStack is the Linux native bridge
 implementation (bridge module). CloudStack includes an option to work
 with OpenVswitch, the requirements are listed below
 
--  libvirt: 0.9.11 or higher
+-  libvirt: 1.2.0 or higher
 
 -  openvswitch: 1.7.1 or higher
 
@@ -61,7 +61,7 @@ In addition, the following hardware requirements apply:
 -  At least 1 NIC
 
 -  When you deploy CloudStack, the hypervisor host must not have any VMs
-   already running
+   already running. These will be destroy by CloudStack.
 
 
 KVM Installation Overview
@@ -74,11 +74,11 @@ provides the CloudStack-specific steps that are needed to 
prepare a KVM
 host to work with CloudStack.
 
 .. warning::
-   Before continuing, make sure that you have applied the latest updates to 
+   Before continuing, make sure that you have applied the latest updates to
your host.
 
 .. warning::
-   It is NOT recommended to run services on this host not controlled by 
+   It is NOT recommended to run services on this host not controlled by
CloudStack.
 
 The procedure for installing a KVM Hypervisor Host is:
@@ -238,8 +238,8 @@ Here are some examples:
   guest.cpu.mode=host-passthrough
   guest.cpu.features=vmx
 
-.. note:: 
-   host-passthrough may lead to migration failure,if you have this problem, 
+.. note::
+   host-passthrough may lead to migration failure,if you have this problem,
you should use host-model or custom. guest.cpu.features will force cpu 
features
as a required policy so make sure to put only those features that are 
provided
by the host CPU.
@@ -400,12 +400,12 @@ ensure the Agent has all the required permissions.
 Configure the network bridges
 ~
 
-.. warning:: 
+.. warning::
This is a very important section, please make sure you read this thoroughly.
 
-.. note:: 
-   This section details how to configure bridges using the native 
-   implementation in Linux. Please refer to the next section if you intend to 
+.. note::
+   This section details how to configure bridges using the native
+   implementation in Linux. Please refer to the next section if you intend to
use OpenVswitch
 
 In order to forward traffic to your instances you will need at least two
@@ -437,7 +437,7 @@ VLAN's:
 On VLAN 100 we give the Hypervisor the IP-Address 192.168.42.11/24 with
 the gateway 192.168.42.1
 
-.. note:: 
+.. note::
The Hypervisor and Management server don't have to be in the same subnet!
 
 
@@ -447,9 +447,9 @@ Configuring the network bridges
 It depends on the distribution you are using how to configure these,
 below you'll find examples for RHEL/CentOS and Ubuntu.
 
-.. note:: 
-   The goal is to have two bridges called 'cloudbr0' and 'cloudbr1' after this 
-   section. This should be used as a guideline only. The exact configuration 
+.. note::
+   The goal is to have two bridges called 'cloudbr0' and 'cloudbr1' after this
+   section. This should be used as a guideline only. The exact configuration
will depend on your network layout.
 
 
@@ -565,8 +565,8 @@ We do the same for 

cloudstack-www git commit: Add Boris to Committer list

2015-11-09 Thread widodh
Repository: cloudstack-www
Updated Branches:
  refs/heads/master d813e3c50 -> edd4b1aeb


Add Boris to Committer list


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-www/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-www/commit/edd4b1ae
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-www/tree/edd4b1ae
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-www/diff/edd4b1ae

Branch: refs/heads/master
Commit: edd4b1aeb13daccf08ac90c79ca6ed1644f9159e
Parents: d813e3c
Author: Wido den Hollander 
Authored: Mon Nov 9 16:43:32 2015 +0100
Committer: Wido den Hollander 
Committed: Mon Nov 9 16:43:32 2015 +0100

--
 source/who.markdown | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-www/blob/edd4b1ae/source/who.markdown
--
diff --git a/source/who.markdown b/source/who.markdown
index 6eb9273..a2ccd90 100644
--- a/source/who.markdown
+++ b/source/who.markdown
@@ -84,6 +84,7 @@ Active list of committers (in alphabetical order of their 
usernames)
 |bfederle|Brian Federle|
 |bhaisaab|Rohit Yadav|
 |brett|Brett Porter|
+|boris|Boris Schrijver|
 |chipchilders|Chip Childers|
 |chiradeep|Chiradeep Vittal|
 |claytonweise|Clayton Weise|



[1/2] cloudstack-www git commit: Add Boris to Committer list

2015-11-09 Thread widodh
Repository: cloudstack-www
Updated Branches:
  refs/heads/asf-site dffc52936 -> 86e1e43ee


Add Boris to Committer list


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-www/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-www/commit/edd4b1ae
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-www/tree/edd4b1ae
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-www/diff/edd4b1ae

Branch: refs/heads/asf-site
Commit: edd4b1aeb13daccf08ac90c79ca6ed1644f9159e
Parents: d813e3c
Author: Wido den Hollander 
Authored: Mon Nov 9 16:43:32 2015 +0100
Committer: Wido den Hollander 
Committed: Mon Nov 9 16:43:32 2015 +0100

--
 source/who.markdown | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-www/blob/edd4b1ae/source/who.markdown
--
diff --git a/source/who.markdown b/source/who.markdown
index 6eb9273..a2ccd90 100644
--- a/source/who.markdown
+++ b/source/who.markdown
@@ -84,6 +84,7 @@ Active list of committers (in alphabetical order of their 
usernames)
 |bfederle|Brian Federle|
 |bhaisaab|Rohit Yadav|
 |brett|Brett Porter|
+|boris|Boris Schrijver|
 |chipchilders|Chip Childers|
 |chiradeep|Chiradeep Vittal|
 |claytonweise|Clayton Weise|



[2/2] cloudstack-www git commit: Merge branch 'master' into asf-site

2015-11-09 Thread widodh
Merge branch 'master' into asf-site


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-www/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-www/commit/86e1e43e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-www/tree/86e1e43e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-www/diff/86e1e43e

Branch: refs/heads/asf-site
Commit: 86e1e43eec8a40e51e8a8eb9f41afc3fd0576f09
Parents: dffc529 edd4b1a
Author: Wido den Hollander 
Authored: Mon Nov 9 16:44:55 2015 +0100
Committer: Wido den Hollander 
Committed: Mon Nov 9 16:44:55 2015 +0100

--
 source/who.markdown | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-www/blob/86e1e43e/source/who.markdown
--



cloudstack-www git commit: Add page with the Call-Home feature where we can point users to

2015-10-09 Thread widodh
Repository: cloudstack-www
Updated Branches:
  refs/heads/call-home [created] 12a296567


Add page with the Call-Home feature where we can point users to


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-www/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-www/commit/12a29656
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-www/tree/12a29656
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-www/diff/12a29656

Branch: refs/heads/call-home
Commit: 12a2965676db1467cc1c8d43742ba15da724dcf7
Parents: 30a96fe
Author: Wido den Hollander 
Authored: Fri Oct 9 11:41:29 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Oct 9 12:11:23 2015 +0200

--
 source/call-home.markdown | 45 ++
 1 file changed, 45 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-www/blob/12a29656/source/call-home.markdown
--
diff --git a/source/call-home.markdown b/source/call-home.markdown
new file mode 100644
index 000..e28e720
--- /dev/null
+++ b/source/call-home.markdown
@@ -0,0 +1,45 @@
+---
+title: Apache CloudStack Call Home
+---
+
+
+
+
+
+
+
+Apache CloudStack: Call Home
+
+
+
+
+
+
+
+Since version 4.7 a Management server will automatically 'call-home' towards 
the Apache CloudStack project.
+
+On a weekly basis the Management Server(s) will generate a report about how 
your CloudStack deployment is being used.
+
+## Report contents
+This report does not contain any personal information, it only includes 
statiscs on how CloudStack is being used:
+
+* The number of Instances
+* The number of Zones and their hypervisor type
+* The amount of Primary Storage pools
+* The total size of the Primary Storage pools
+* The version of CloudStack and the history
+* The IP-Address where the report came from (used for Geolocation)
+
+## Disabling
+For the CloudStack project this is vital information for tracking how and 
where CloudStack is being used, but if an administrator
+whishes the reports can be disabled.
+
+Setting the global setting 'usage.report.interval' to 0 makes sure no report 
is being send.
+
+## How is the data being used
+The data gathered by the CloudStack project is being used to determine how 
CloudStack is being used and in which configuration.
+
+It provides the project valuable information which can be used to find out 
which features are being used and which are not.
+
+## Who has access to the data
+All PMC members from the Apache CloudStack project have access to the data.



[2/2] git commit: updated refs/heads/master to 6841ba6

2015-09-25 Thread widodh
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 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6841ba61
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6841ba61
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6841ba61

Branch: refs/heads/master
Commit: 6841ba61da5e407f7a16c4a575d1a4e8c8345970
Parents: 13b29ba 9e90b53
Author: Wido den Hollander 
Authored: Fri Sep 25 10:13:03 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Sep 25 10:13:03 2015 +0200

--
 .../com/cloud/storage/template/LocalTemplateDownloaderTest.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[1/2] git commit: updated refs/heads/master to 6841ba6

2015-09-25 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 13b29bac5 -> 6841ba61d


Use java.io.tmpdir instead of hardcoded /tmp


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9e90b539
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9e90b539
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9e90b539

Branch: refs/heads/master
Commit: 9e90b5393a82163b5baf9c87fa5e49ff00de808f
Parents: 13b29ba
Author: Wido den Hollander 
Authored: Thu Sep 24 15:07:41 2015 +0200
Committer: Wido den Hollander 
Committed: Thu Sep 24 15:07:41 2015 +0200

--
 .../com/cloud/storage/template/LocalTemplateDownloaderTest.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e90b539/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
--
diff --git 
a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java 
b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
index 74d1adc..b685e4c 100644
--- a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
+++ b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
@@ -31,7 +31,7 @@ public class LocalTemplateDownloaderTest {
 @Test
 public void localTemplateDownloaderTest() {
 String url =  "file://" + new File("pom.xml").getAbsolutePath();
-TemplateDownloader td = new LocalTemplateDownloader(null, url, "/tmp", 
TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
+TemplateDownloader td = new LocalTemplateDownloader(null, url, 
System.getProperty("java.io.tmpdir"), 
TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
 long bytes = td.download(true, null);
 if (!(bytes > 0)) {
 fail("Failed download");



[9/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Merge pull request #845 from borisroman/CLOUDSTACK-8763

[4.6][BLOCKER]CLOUDSTACK-8763: Resolved POD/ZONE deletion failure.Instead of 
having both checkIfPodIsDeletable() and checkIfZoneIsDeletable have there own 
SQL query, I've refactored them so they use DAO SQL Queries.

This resolves the SQL Exception thrown by both classes.

Test to confirm working order:
- deploy ACS
- Add zones / pods. -> Try to delete without resources. -> Direct success.
- Add resources to zones / pods. -> Try to delete with resources in the pod / 
zone. -> Correct exception thrown. (Error message is why it cannot remove the 
zone / pod. IE: There is still a hosts or vm or  )

* pr/845:
  Added unit tests for checkIfPodIsDeletable() and checkIfZoneIsDeletable().
  Updated Dao classes with correct field names.
  Refactored checkIfZoneIsDeletable().
  Added findByDc(long dcId) to VolumeDao and VolumeDaoImpl.
  Added countIPs(long dcId, boolean onlyCountAllocated) to IPAddressDao and 
IPAddressDaoImpl.
  Added countIPs(long dcId, boolean onlyCountAllocated) to 
DataCenterIpAddressDao and DataCenterIpAddressDaoImpl.
  Refactored checkIfPodIsDeletable().
  Added findByPodId(Long podId) to HostDao and HostDaoImpl.

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a0f8f56a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a0f8f56a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a0f8f56a

Branch: refs/heads/master
Commit: a0f8f56a5dd3a323a72eb2a145d64cb1b5abea49
Parents: a601ae4 5a3a3d6
Author: Wido den Hollander 
Authored: Wed Sep 23 14:00:04 2015 +0200
Committer: Wido den Hollander 
Committed: Wed Sep 23 14:00:04 2015 +0200

--
 .../cloud/dc/dao/DataCenterIpAddressDao.java|   2 +
 .../dc/dao/DataCenterIpAddressDaoImpl.java  |  27 ++
 .../src/com/cloud/network/dao/IPAddressDao.java |   2 +
 .../com/cloud/network/dao/IPAddressDaoImpl.java |  21 ++
 .../src/com/cloud/storage/dao/VolumeDao.java|   4 +
 .../com/cloud/storage/dao/VolumeDaoImpl.java|  17 ++
 .../src/com/cloud/vm/dao/VMInstanceDaoImpl.java |   1 +
 .../configuration/ConfigurationManagerImpl.java | 217 +--
 .../configuration/ConfigurationManagerTest.java | 266 ++-
 9 files changed, 400 insertions(+), 157 deletions(-)
--




[4/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Added countIPs(long dcId, boolean onlyCountAllocated) to IPAddressDao and 
IPAddressDaoImpl.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/12fc2b4c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/12fc2b4c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/12fc2b4c

Branch: refs/heads/master
Commit: 12fc2b4c26145721622b34f1a4f40d4e06faea93
Parents: 473f193
Author: Boris Schrijver 
Authored: Wed Sep 16 22:15:53 2015 +0200
Committer: Boris Schrijver 
Committed: Wed Sep 16 22:15:53 2015 +0200

--
 .../src/com/cloud/network/dao/IPAddressDao.java  |  2 ++
 .../src/com/cloud/network/dao/IPAddressDaoImpl.java  | 15 +++
 2 files changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12fc2b4c/engine/schema/src/com/cloud/network/dao/IPAddressDao.java
--
diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDao.java 
b/engine/schema/src/com/cloud/network/dao/IPAddressDao.java
index cb07656..fbf5c57 100644
--- a/engine/schema/src/com/cloud/network/dao/IPAddressDao.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressDao.java
@@ -40,6 +40,8 @@ public interface IPAddressDao extends GenericDao {
 
 List listStaticNatPublicIps(long networkId);
 
+int countIPs(long dcId, boolean onlyCountAllocated);
+
 int countIPs(long dcId, long vlanDbId, boolean onlyCountAllocated);
 
 int countIPs(long dcId, Long accountId, String vlanId, String vlanGateway, 
String vlanNetmask);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12fc2b4c/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java 
b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
index 5122876..5c8b9b1 100644
--- a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
@@ -56,6 +56,7 @@ public class IPAddressDaoImpl extends 
GenericDaoBase implemen
 protected SearchBuilder VlanDbIdSearchUnallocated;
 protected GenericSearchBuilder AllIpCount;
 protected GenericSearchBuilder AllocatedIpCount;
+protected GenericSearchBuilder AllocatedIpCountForDc;
 protected GenericSearchBuilder 
AllIpCountForDashboard;
 protected SearchBuilder DeleteAllExceptGivenIp;
 protected GenericSearchBuilder 
AllocatedIpCountForAccount;
@@ -107,6 +108,12 @@ public class IPAddressDaoImpl extends 
GenericDaoBase implemen
 AllocatedIpCount.and("allocated", 
AllocatedIpCount.entity().getAllocatedTime(), Op.NNULL);
 AllocatedIpCount.done();
 
+AllocatedIpCountForDc = createSearchBuilder(Integer.class);
+AllocatedIpCountForDc.select(null, Func.COUNT, 
AllocatedIpCountForDc.entity().getAddress());
+AllocatedIpCountForDc.and("dc", 
AllocatedIpCountForDc.entity().getDataCenterId(), Op.EQ);
+AllocatedIpCountForDc.and("allocated", 
AllocatedIpCountForDc.entity().getAllocatedTime(), Op.NNULL);
+AllocatedIpCountForDc.done();
+
 AllIpCountForDashboard = createSearchBuilder(Integer.class);
 AllIpCountForDashboard.select(null, Func.COUNT, 
AllIpCountForDashboard.entity().getAddress());
 AllIpCountForDashboard.and("dc", 
AllIpCountForDashboard.entity().getDataCenterId(), Op.EQ);
@@ -282,6 +289,14 @@ public class IPAddressDaoImpl extends 
GenericDaoBase implemen
 }
 
 @Override
+public int countIPs(long dcId, boolean onlyCountAllocated) {
+SearchCriteria sc = onlyCountAllocated ? 
AllocatedIpCount.create() : AllIpCount.create();
+sc.setParameters("dc", dcId);
+
+return customSearch(sc, null).get(0);
+}
+
+@Override
 public int countIPs(long dcId, long vlanId, boolean onlyCountAllocated) {
 SearchCriteria sc = onlyCountAllocated ? 
AllocatedIpCount.create() : AllIpCount.create();
 sc.setParameters("dc", dcId);



[1/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master a601ae445 -> a0f8f56a5


Added findByPodId(Long podId) to HostDao and HostDaoImpl.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0648cb98
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0648cb98
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0648cb98

Branch: refs/heads/master
Commit: 0648cb98042eba19eb581c9d7f5b4d0c69ccd4e1
Parents: 1525ac0
Author: Boris Schrijver 
Authored: Wed Sep 16 22:13:10 2015 +0200
Committer: Boris Schrijver 
Committed: Wed Sep 16 22:13:10 2015 +0200

--
 engine/schema/src/com/cloud/storage/dao/VolumeDao.java | 2 ++
 engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java | 8 
 2 files changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0648cb98/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
--
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDao.java 
b/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
index 343ec2a..05aa3cf 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
@@ -45,6 +45,8 @@ public interface VolumeDao extends GenericDao, StateDao findByInstanceIdDestroyed(long vmId);
 
+List findByPod(long podId);
+
 List findByAccountAndPod(long accountId, long podId);
 
 List findByTemplateAndZone(long templateId, long zoneId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0648cb98/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java 
b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
index 85d08b8..56e92cf 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
@@ -190,6 +190,14 @@ public class VolumeDaoImpl extends 
GenericDaoBase implements Vol
 }
 
 @Override
+public List findByPod(long podId) {
+SearchCriteria sc = AllFieldsSearch.create();
+sc.setParameters("pod", podId);
+
+return listBy(sc);
+}
+
+@Override
 public List findByAccountAndPod(long accountId, long podId) {
 SearchCriteria sc = AllFieldsSearch.create();
 sc.setParameters("accountId", accountId);



[8/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Added unit tests for checkIfPodIsDeletable() and checkIfZoneIsDeletable().


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5a3a3d64
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5a3a3d64
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5a3a3d64

Branch: refs/heads/master
Commit: 5a3a3d641ddac3575e4d371004b0b38e28c6e897
Parents: fa5f388
Author: Boris Schrijver 
Authored: Thu Sep 17 17:28:29 2015 +0200
Committer: Boris Schrijver 
Committed: Thu Sep 17 17:28:29 2015 +0200

--
 .../configuration/ConfigurationManagerTest.java | 266 ++-
 1 file changed, 264 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5a3a3d64/server/test/com/cloud/configuration/ConfigurationManagerTest.java
--
diff --git a/server/test/com/cloud/configuration/ConfigurationManagerTest.java 
b/server/test/com/cloud/configuration/ConfigurationManagerTest.java
index c43e3fa..d30dacf 100644
--- a/server/test/com/cloud/configuration/ConfigurationManagerTest.java
+++ b/server/test/com/cloud/configuration/ConfigurationManagerTest.java
@@ -30,6 +30,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 import java.util.UUID;
 
 import com.cloud.user.User;
@@ -48,14 +49,21 @@ import 
org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationSe
 
 import com.cloud.configuration.Resource.ResourceType;
 import com.cloud.dc.AccountVlanMapVO;
+import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.DataCenterVO;
+import com.cloud.dc.HostPodVO;
 import com.cloud.dc.Vlan;
 import com.cloud.dc.VlanVO;
 import com.cloud.dc.dao.AccountVlanMapDao;
+import com.cloud.dc.dao.ClusterDao;
 import com.cloud.dc.dao.DataCenterDao;
+import com.cloud.dc.dao.DataCenterIpAddressDao;
+import com.cloud.dc.dao.HostPodDao;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
 import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
 import com.cloud.network.NetworkModel;
@@ -63,7 +71,11 @@ import com.cloud.network.Network.Capability;
 import com.cloud.network.dao.FirewallRulesDao;
 import com.cloud.network.dao.IPAddressDao;
 import com.cloud.network.dao.IPAddressVO;
+import com.cloud.network.dao.PhysicalNetworkDao;
+import com.cloud.network.dao.PhysicalNetworkVO;
 import com.cloud.projects.ProjectManager;
+import com.cloud.storage.VolumeVO;
+import com.cloud.storage.dao.VolumeDao;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.AccountVO;
@@ -71,7 +83,10 @@ import com.cloud.user.ResourceLimitService;
 import com.cloud.user.UserVO;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.db.TransactionLegacy;
+import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.Ip;
+import com.cloud.vm.VMInstanceVO;
+import com.cloud.vm.dao.VMInstanceDao;
 
 public class ConfigurationManagerTest {
 
@@ -109,12 +124,25 @@ public class ConfigurationManagerTest {
 IpAddressManager _ipAddrMgr;
 @Mock
 NetworkModel _networkModel;
+@Mock
+DataCenterIpAddressDao _privateIpAddressDao;
+@Mock
+VolumeDao _volumeDao;
+@Mock
+HostDao _hostDao;
+@Mock
+VMInstanceDao _vmInstanceDao;
+@Mock
+ClusterDao _clusterDao;
+@Mock
+HostPodDao _podDao;
+@Mock
+PhysicalNetworkDao _physicalNetworkDao;
 
 VlanVO vlan = new VlanVO(Vlan.VlanType.VirtualNetwork, "vlantag", 
"vlangateway", "vlannetmask", 1L, "iprange", 1L, 1L, null, null, null);
 
 @Mock
 Network network;
-
 @Mock
 Account account;
 
@@ -133,6 +161,14 @@ public class ConfigurationManagerTest {
 configurationMgr._firewallDao = _firewallDao;
 configurationMgr._ipAddrMgr = _ipAddrMgr;
 configurationMgr._networkModel = _networkModel;
+configurationMgr._privateIpAddressDao = _privateIpAddressDao;
+configurationMgr._volumeDao = _volumeDao;
+configurationMgr._hostDao = _hostDao;
+configurationMgr._vmInstanceDao = _vmInstanceDao;
+configurationMgr._clusterDao = _clusterDao;
+configurationMgr._podDao = _podDao;
+configurationMgr._physicalNetworkDao = _physicalNetworkDao;
+
 
 Account account = new AccountVO("testaccount", 1, "networkdomain", 
(short)0, UUID.randomUUID().toString());
 
when(configurationMgr._accountMgr.getAccount(anyLong())).thenReturn(account);
@@ -533,4 +569,230 @@ public class ConfigurationManagerTest {
 

[2/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Refactored checkIfPodIsDeletable().

It now makes use of various DAO DB function instead of running a self build 
query.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/45861fa1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/45861fa1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/45861fa1

Branch: refs/heads/master
Commit: 45861fa1b7e82250f404e22dd13ef4925c60da4e
Parents: 0648cb9
Author: Boris Schrijver 
Authored: Wed Sep 16 22:14:05 2015 +0200
Committer: Boris Schrijver 
Committed: Wed Sep 16 22:14:05 2015 +0200

--
 .../configuration/ConfigurationManagerImpl.java | 92 ++--
 1 file changed, 27 insertions(+), 65 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45861fa1/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
--
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java 
b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index fc7bff9..462d6e9 100644
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -134,6 +134,7 @@ import com.cloud.exception.PermissionDeniedException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.gpu.GPU;
+import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
@@ -182,6 +183,7 @@ import com.cloud.storage.Storage.ProvisioningType;
 import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.dao.DiskOfferingDao;
+import com.cloud.storage.dao.VolumeDao;
 import com.cloud.test.IPRangeConfig;
 import com.cloud.user.Account;
 import com.cloud.user.AccountDetailVO;
@@ -214,6 +216,7 @@ import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.NicIpAliasDao;
 import com.cloud.vm.dao.NicIpAliasVO;
 import com.cloud.vm.dao.NicSecondaryIpDao;
+import com.cloud.vm.dao.VMInstanceDao;
 
 @Local(value = {ConfigurationManager.class, ConfigurationService.class})
 public class ConfigurationManagerImpl extends ManagerBase implements 
ConfigurationManager, ConfigurationService, Configurable {
@@ -228,6 +231,12 @@ public class ConfigurationManagerImpl extends ManagerBase 
implements Configurati
 @Inject
 HostPodDao _podDao;
 @Inject
+HostDao _hostDao;
+@Inject
+VolumeDao _volumeDao;
+@Inject
+VMInstanceDao _vmInstanceDao;
+@Inject
 AccountVlanMapDao _accountVlanMapDao;
 @Inject
 PodVlanMapDao _podVlanMapDao;
@@ -878,81 +887,34 @@ public class ConfigurationManagerImpl extends ManagerBase 
implements Configurati
 return count > 0;
 }
 
-@DB
 protected void checkIfPodIsDeletable(final long podId) {
-final List tablesToCheck = new ArrayList();
-
 final HostPodVO pod = _podDao.findById(podId);
 
+final String errorMsg = "The pod cannot be deleted because ";
+
 // Check if there are allocated private IP addresses in the pod
 if (_privateIpAddressDao.countIPs(podId, pod.getDataCenterId(), true) 
!= 0) {
-throw new CloudRuntimeException("There are private IP addresses 
allocated for this pod");
+throw new CloudRuntimeException(errorMsg + "there are private IP 
addresses allocated in this pod");
 }
 
-final List volumes = new ArrayList();
-volumes.add(0, "volumes");
-volumes.add(1, "pod_id");
-volumes.add(2, "there are storage volumes for this pod");
-tablesToCheck.add(volumes);
-
-final List host = new ArrayList();
-host.add(0, "host");
-host.add(1, "pod_id");
-host.add(2, "there are servers running in this pod");
-tablesToCheck.add(host);
-
-final List vmInstance = new ArrayList();
-vmInstance.add(0, "vm_instance");
-vmInstance.add(1, "pod_id");
-vmInstance.add(2, "there are virtual machines running in this pod");
-tablesToCheck.add(vmInstance);
-
-final List cluster = new ArrayList();
-cluster.add(0, "cluster");
-cluster.add(1, "pod_id");
-cluster.add(2, "there are clusters in this pod");
-tablesToCheck.add(cluster);
-
-for (final List table : tablesToCheck) {
-final String tableName = table.get(0);
-final String column = table.get(1);
-final String errorMsg = table.get(2);
-
-String dbName;
-if (tableName.equals("event") || 

[3/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Added countIPs(long dcId, boolean onlyCountAllocated) to DataCenterIpAddressDao 
and DataCenterIpAddressDaoImpl.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/473f1937
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/473f1937
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/473f1937

Branch: refs/heads/master
Commit: 473f1937e2c13bc7cca0b42c7585fe16accf7415
Parents: 45861fa
Author: Boris Schrijver 
Authored: Wed Sep 16 22:15:00 2015 +0200
Committer: Boris Schrijver 
Committed: Wed Sep 16 22:15:00 2015 +0200

--
 .../cloud/dc/dao/DataCenterIpAddressDao.java|  2 ++
 .../dc/dao/DataCenterIpAddressDaoImpl.java  | 21 
 2 files changed, 23 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/473f1937/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDao.java
--
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDao.java 
b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDao.java
index 7f1ec4d..e5843b6 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDao.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDao.java
@@ -43,6 +43,8 @@ public interface DataCenterIpAddressDao extends 
GenericDaohttp://git-wip-us.apache.org/repos/asf/cloudstack/blob/473f1937/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java 
b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
index ca79eed..cf68322 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
@@ -46,6 +46,7 @@ public class DataCenterIpAddressDaoImpl extends 
GenericDaoBase AllFieldsSearch;
 private final GenericSearchBuilder 
AllIpCount;
 private final GenericSearchBuilder 
AllAllocatedIpCount;
+private final GenericSearchBuilder 
AllAllocatedIpCountForDc;
 
 @Override
 @DB
@@ -221,6 +222,20 @@ public class DataCenterIpAddressDaoImpl extends 
GenericDaoBase sc;
+if (onlyCountAllocated) {
+sc = AllAllocatedIpCountForDc.create();
+} else {
+sc = AllIpCount.create();
+}
+
+sc.setParameters("data_center_id", dcId);
+List count = customSearch(sc, null);
+return count.get(0);
+}
+
 public DataCenterIpAddressDaoImpl() {
 super();
 
@@ -244,5 +259,11 @@ public class DataCenterIpAddressDaoImpl extends 
GenericDaoBase

[7/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Updated Dao classes with correct field names.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fa5f388f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fa5f388f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fa5f388f

Branch: refs/heads/master
Commit: fa5f388fe91bc2fd477b1f6752c2a31ac69d5051
Parents: b31e64d
Author: Boris Schrijver 
Authored: Thu Sep 17 10:54:26 2015 +0200
Committer: Boris Schrijver 
Committed: Thu Sep 17 15:54:29 2015 +0200

--
 .../src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java | 8 +++-
 .../schema/src/com/cloud/network/dao/IPAddressDaoImpl.java   | 8 +++-
 engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java   | 3 ++-
 engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java| 1 +
 4 files changed, 17 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fa5f388f/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java 
b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
index cf68322..9486650 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
@@ -45,6 +45,7 @@ public class DataCenterIpAddressDaoImpl extends 
GenericDaoBase AllFieldsSearch;
 private final GenericSearchBuilder 
AllIpCount;
+private final GenericSearchBuilder 
AllIpCountForDc;
 private final GenericSearchBuilder 
AllAllocatedIpCount;
 private final GenericSearchBuilder 
AllAllocatedIpCountForDc;
 
@@ -228,7 +229,7 @@ public class DataCenterIpAddressDaoImpl extends 
GenericDaoBasehttp://git-wip-us.apache.org/repos/asf/cloudstack/blob/fa5f388f/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java 
b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
index 5c8b9b1..61bc1b7 100644
--- a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
@@ -55,6 +55,7 @@ public class IPAddressDaoImpl extends 
GenericDaoBase implemen
 protected SearchBuilder AllFieldsSearch;
 protected SearchBuilder VlanDbIdSearchUnallocated;
 protected GenericSearchBuilder AllIpCount;
+protected GenericSearchBuilder AllIpCountForDc;
 protected GenericSearchBuilder AllocatedIpCount;
 protected GenericSearchBuilder AllocatedIpCountForDc;
 protected GenericSearchBuilder 
AllIpCountForDashboard;
@@ -101,6 +102,11 @@ public class IPAddressDaoImpl extends 
GenericDaoBase implemen
 AllIpCount.and("vlan", AllIpCount.entity().getVlanId(), Op.EQ);
 AllIpCount.done();
 
+AllIpCountForDc = createSearchBuilder(Integer.class);
+AllIpCountForDc.select(null, Func.COUNT, 
AllIpCountForDc.entity().getAddress());
+AllIpCountForDc.and("dc", AllIpCountForDc.entity().getDataCenterId(), 
Op.EQ);
+AllIpCountForDc.done();
+
 AllocatedIpCount = createSearchBuilder(Integer.class);
 AllocatedIpCount.select(null, Func.COUNT, 
AllocatedIpCount.entity().getAddress());
 AllocatedIpCount.and("dc", 
AllocatedIpCount.entity().getDataCenterId(), Op.EQ);
@@ -290,7 +296,7 @@ public class IPAddressDaoImpl extends 
GenericDaoBase implemen
 
 @Override
 public int countIPs(long dcId, boolean onlyCountAllocated) {
-SearchCriteria sc = onlyCountAllocated ? 
AllocatedIpCount.create() : AllIpCount.create();
+SearchCriteria sc = onlyCountAllocated ? 
AllocatedIpCountForDc.create() : AllIpCountForDc.create();
 sc.setParameters("dc", dcId);
 
 return customSearch(sc, null).get(0);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fa5f388f/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java 
b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
index 7d0c9c3..f573847 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
@@ -200,7 +200,7 @@ public class VolumeDaoImpl 

[5/9] git commit: updated refs/heads/master to a0f8f56

2015-09-23 Thread widodh
Added findByDc(long dcId) to VolumeDao and VolumeDaoImpl.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0df3357c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0df3357c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0df3357c

Branch: refs/heads/master
Commit: 0df3357cac73a2191cf4e01d5ef8db48a0bcbc64
Parents: 12fc2b4
Author: Boris Schrijver 
Authored: Wed Sep 16 22:17:27 2015 +0200
Committer: Boris Schrijver 
Committed: Wed Sep 16 22:17:27 2015 +0200

--
 engine/schema/src/com/cloud/storage/dao/VolumeDao.java | 2 ++
 engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java | 8 
 2 files changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0df3357c/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
--
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDao.java 
b/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
index 05aa3cf..4959ce4 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDao.java
@@ -47,6 +47,8 @@ public interface VolumeDao extends GenericDao, StateDao findByPod(long podId);
 
+List findByDc(long dcId);
+
 List findByAccountAndPod(long accountId, long podId);
 
 List findByTemplateAndZone(long templateId, long zoneId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0df3357c/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java 
b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
index 56e92cf..7d0c9c3 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
@@ -198,6 +198,14 @@ public class VolumeDaoImpl extends 
GenericDaoBase implements Vol
 }
 
 @Override
+public List findByDc(long dcId) {
+SearchCriteria sc = AllFieldsSearch.create();
+sc.setParameters("data_center_id", dcId);
+
+return listBy(sc);
+}
+
+@Override
 public List findByAccountAndPod(long accountId, long podId) {
 SearchCriteria sc = AllFieldsSearch.create();
 sc.setParameters("accountId", accountId);



[2/2] git commit: updated refs/heads/master to 73c7ad9

2015-09-23 Thread widodh
Merge pull request #878 from borisroman/CLOUDSTACK-8890

[4.6][BLOCKER]CLOUDSTACK-8890: Added isEmpty() check to prevent 
nullPointerException.Check if the list is empty before trying to get the first 
entry. If the list is empty, in example when dealing with projects, it will 
user the caller user id.

Tests to verify working order:
1. Deploy ACS
2. Create project
3. Create resource in project -> Should succeed!

* pr/878:
  Added isEmpty() check to prevent nullPointerException.

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/73c7ad9a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/73c7ad9a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/73c7ad9a

Branch: refs/heads/master
Commit: 73c7ad9a4a409cba7f897c848145cbc7f6f96ae4
Parents: a0f8f56 80cb3ad
Author: Wido den Hollander 
Authored: Wed Sep 23 16:04:35 2015 +0200
Committer: Wido den Hollander 
Committed: Wed Sep 23 16:04:35 2015 +0200

--
 .../src/com/cloud/network/lb/LoadBalanceRuleHandler.java   | 6 +-
 .../network/lb/InternalLoadBalancerVMManagerImpl.java  | 6 +-
 .../network/contrail/management/ServiceManagerImpl.java| 6 +-
 server/src/com/cloud/network/router/NetworkHelperImpl.java | 6 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java | 5 -
 5 files changed, 24 insertions(+), 5 deletions(-)
--




[1/2] git commit: updated refs/heads/master to 73c7ad9

2015-09-23 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master a0f8f56a5 -> 73c7ad9a4


Added isEmpty() check to prevent nullPointerException.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/80cb3ada
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/80cb3ada
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/80cb3ada

Branch: refs/heads/master
Commit: 80cb3adad079be639331046f844b34a69079c224
Parents: a0f8f56
Author: Boris Schrijver 
Authored: Wed Sep 23 15:01:03 2015 +0200
Committer: Boris Schrijver 
Committed: Wed Sep 23 15:07:16 2015 +0200

--
 .../src/com/cloud/network/lb/LoadBalanceRuleHandler.java   | 6 +-
 .../network/lb/InternalLoadBalancerVMManagerImpl.java  | 6 +-
 .../network/contrail/management/ServiceManagerImpl.java| 6 +-
 server/src/com/cloud/network/router/NetworkHelperImpl.java | 6 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java | 5 -
 5 files changed, 24 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80cb3ada/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/LoadBalanceRuleHandler.java
--
diff --git 
a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/LoadBalanceRuleHandler.java
 
b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/LoadBalanceRuleHandler.java
index e90af37..f5046b6 100644
--- 
a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/LoadBalanceRuleHandler.java
+++ 
b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/LoadBalanceRuleHandler.java
@@ -79,6 +79,7 @@ import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.Account;
 import com.cloud.user.AccountService;
+import com.cloud.user.UserVO;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.user.dao.UserDao;
 import com.cloud.utils.db.DB;
@@ -279,7 +280,10 @@ public class LoadBalanceRuleHandler {
 
 long userId = CallContext.current().getCallingUserId();
 if (CallContext.current().getCallingAccount().getId() != 
owner.getId()) {
-userId =  
_userDao.listByAccount(owner.getAccountId()).get(0).getId();
+List userVOs = 
_userDao.listByAccount(owner.getAccountId());
+if (!userVOs.isEmpty()) {
+userId =  userVOs.get(0).getId();
+}
 }
 
 ServiceOfferingVO elasticLbVmOffering = 
_serviceOfferingDao.findDefaultSystemOffering(ServiceOffering.elbVmDefaultOffUniqueName,
 
ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80cb3ada/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
--
diff --git 
a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
 
b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
index 88ab512..bb153ff 100644
--- 
a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
+++ 
b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
@@ -97,6 +97,7 @@ import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.User;
+import com.cloud.user.UserVO;
 import com.cloud.user.dao.UserDao;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.ManagerBase;
@@ -772,7 +773,10 @@ public class InternalLoadBalancerVMManagerImpl extends 
ManagerBase implements In
 
 long userId = CallContext.current().getCallingUserId();
 if (CallContext.current().getCallingAccount().getId() != 
owner.getId()) {
-userId =  
_userDao.listByAccount(owner.getAccountId()).get(0).getId();
+List userVOs = 
_userDao.listByAccount(owner.getAccountId());
+if (!userVOs.isEmpty()) {
+userId =  userVOs.get(0).getId();
+}
 }
 
 internalLbVm =

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80cb3ada/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java

[3/4] git commit: updated refs/heads/master to a5ca762

2015-09-17 Thread widodh
CLOUDSTACK-8840: Do not include old systemd wrapper


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0204269b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0204269b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0204269b

Branch: refs/heads/master
Commit: 0204269b963ae80205e7e69e95e534eef5b84de3
Parents: 2c14354
Author: Wido den Hollander 
Authored: Wed Sep 16 13:59:52 2015 +0200
Committer: Wido den Hollander 
Committed: Wed Sep 16 13:59:52 2015 +0200

--
 packaging/centos7/cloud.spec | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0204269b/packaging/centos7/cloud.spec
--
diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index 3272499..e9bc16a 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -507,7 +507,6 @@ fi
 %{_defaultdocdir}/%{name}-common-%{version}/NOTICE
 
 %files usage
-%attr(0755,root,root) /usr/sbin/%{name}-usage-sysd
 %attr(0644,root,root) %{_unitdir}/%{name}-usage.service
 %attr(0644,root,root) %{_datadir}/%{name}-usage/*.jar
 %attr(0644,root,root) %{_datadir}/%{name}-usage/lib/*.jar



[4/4] git commit: updated refs/heads/master to a5ca762

2015-09-17 Thread widodh
Merge pull request #820 from wido/CLOUDSTACK-8840

CLOUDSTACK-8840: Systemd service for the Usage ServerThere already was a 
uncompleted systemd service file for the Usage
Server.

This new one replaces sysvinit and the old systemd service file.

* pr/820:
  CLOUDSTACK-8840: Do not include old systemd wrapper
  CLOUDSTACK-8840: Fix the source path of the service file
  CLOUDSTACK-8840: Systemd service for the Usage Server

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a5ca762a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a5ca762a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a5ca762a

Branch: refs/heads/master
Commit: a5ca762acb4e0a8b27f11aa3515558b87e8fdb18
Parents: 1525ac0 0204269
Author: Wido den Hollander 
Authored: Thu Sep 17 10:09:58 2015 +0200
Committer: Wido den Hollander 
Committed: Thu Sep 17 10:09:58 2015 +0200

--
 packaging/centos7/cloud-usage-sysd | 90 -
 packaging/centos7/cloud-usage.service  | 37 --
 packaging/centos7/cloud-usage.sysconfig| 31 -
 packaging/centos7/cloud.spec   | 16 +
 packaging/systemd/cloudstack-usage.service | 38 +++
 usage/conf/log4j-cloud_usage.xml.in|  6 +-
 6 files changed, 43 insertions(+), 175 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a5ca762a/packaging/centos7/cloud.spec
--



[2/4] git commit: updated refs/heads/master to a5ca762

2015-09-17 Thread widodh
CLOUDSTACK-8840: Fix the source path of the service file


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2c143543
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2c143543
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2c143543

Branch: refs/heads/master
Commit: 2c143543b5a83f2592a2fc9cefd3e127a7807289
Parents: f44a5c7
Author: Wido den Hollander 
Authored: Tue Sep 15 09:33:17 2015 +0200
Committer: Wido den Hollander 
Committed: Tue Sep 15 09:33:17 2015 +0200

--
 packaging/centos7/cloud.spec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2c143543/packaging/centos7/cloud.spec
--
diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index e620a77..3272499 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -310,7 +310,7 @@ install -D usage/target/cloud-usage-%{_maventag}.jar 
${RPM_BUILD_ROOT}%{_datadir
 install -D usage/target/transformed/db.properties 
${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage/db.properties
 install -D usage/target/transformed/log4j-cloud_usage.xml 
${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage/log4j-cloud.xml
 cp usage/target/dependencies/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-usage/lib/
-install -D packaging/cloudstack-usage.service 
${RPM_BUILD_ROOT}%{_unitdir}/%{name}-usage.service
+install -D packaging/systemd/cloudstack-usage.service 
${RPM_BUILD_ROOT}%{_unitdir}/%{name}-usage.service
 mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/usage/
 
 # CLI



[1/4] git commit: updated refs/heads/master to a5ca762

2015-09-17 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 1525ac079 -> a5ca762ac


CLOUDSTACK-8840: Systemd service for the Usage Server

There already was a uncompleted systemd service file for the Usage
Server.

This new one replaces sysvinit and the old systemd service file.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f44a5c79
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f44a5c79
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f44a5c79

Branch: refs/heads/master
Commit: f44a5c79b3e22b52b1b297e07e571cbddb90aba4
Parents: d091b91
Author: Wido den Hollander 
Authored: Mon Sep 14 13:30:32 2015 +0200
Committer: Wido den Hollander 
Committed: Mon Sep 14 13:30:32 2015 +0200

--
 packaging/centos7/cloud-usage-sysd | 90 -
 packaging/centos7/cloud-usage.service  | 37 --
 packaging/centos7/cloud-usage.sysconfig| 31 -
 packaging/centos7/cloud.spec   | 27 +++-
 packaging/systemd/cloudstack-usage.service | 38 +++
 usage/conf/log4j-cloud_usage.xml.in|  6 +-
 6 files changed, 49 insertions(+), 180 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f44a5c79/packaging/centos7/cloud-usage-sysd
--
diff --git a/packaging/centos7/cloud-usage-sysd 
b/packaging/centos7/cloud-usage-sysd
deleted file mode 100755
index a7c0f2f..000
--- a/packaging/centos7/cloud-usage-sysd
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-. /etc/sysconfig/cloudstack-usage
-
-start() {
-if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
-echo "$PROGNAME apparently already running"
-exit 0
-fi
-
-if hostname --fqdn >/dev/null 2>&1 ; then
-true
-else
-echo "The host name does not resolve properly to an IP address. Cannot 
start $PROGNAME"
-exit 1
-fi
-
-echo -n "Starting $PROGNAME" "$SHORTNAME"
-
-if /usr/bin/jsvc -pidfile $PIDFILE $DAEMON -home "$JAVA_HOME" -cp 
"$CLASSPATH" -pidfile "$PIDFILE" -user "$USER" \
-  -errfile $LOGDIR/cloudstack-usage.err -outfile 
$LOGDIR/cloudstack-usage.out -Dpid=$$ $CLASS
-RETVAL=$?
-then
-rc=0
-sleep 1
-if ! kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
-rc=1
-fi
-else
-rc=1
-fi
-
-if [ $rc -ne 0 ]; then
-echo > "$PIDFILE"
-exit 1
-fi
-}
-
-stop() {
-echo -n "Stopping $PROGNAME" "$SHORTNAME"
-if [ -e $PIDFILE ] ; then
-kill $(<$PIDFILE) > /dev/null 2>&1
-echo > $PIDFILE
-else
-echo Unable to stop $SHORTNAME, no pid file
-echo > $PIDFILE
-exit 1
-fi
-}
-
-case "$1" in
-start)
-start
-;;
-stop)
-stop
-;;
-status)
-status -p $PIDFILE $SHORTNAME
-RETVAL=$?
-;;
-restart | force-reload)
-stop
-sleep 3
-start
-;;
-*)
-echo "Usage: $0 {start|stop|restart|force-reload|status}"
-RETVAL=3
-esac
-
-exit $RETVAL
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f44a5c79/packaging/centos7/cloud-usage.service
--
diff --git a/packaging/centos7/cloud-usage.service 
b/packaging/centos7/cloud-usage.service
deleted file mode 100644
index a1bbc1dd..000
--- a/packaging/centos7/cloud-usage.service
+++ /dev/null
@@ -1,37 +0,0 @@
-# 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
-#
-#   

[2/2] git commit: updated refs/heads/master to 34caa69

2015-09-15 Thread widodh
Merge pull request #821 from wido/libvirt-rbd-logging

CLOUDSTACK-8645: Improve logging of RBD functionality in KVMA simple commit 
which changes a couple of log lines.

* pr/821:
  CLOUDSTACK-8645: Improve logging of RBD functionality in KVM

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/34caa694
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/34caa694
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/34caa694

Branch: refs/heads/master
Commit: 34caa694d0a788d649408d83719e87110d098410
Parents: 2bd61c3 4f409a7
Author: Wido den Hollander 
Authored: Tue Sep 15 10:57:18 2015 +0200
Committer: Wido den Hollander 
Committed: Tue Sep 15 10:57:18 2015 +0200

--
 .../kvm/storage/LibvirtStorageAdaptor.java  | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--




[1/2] git commit: updated refs/heads/master to 34caa69

2015-09-15 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 2bd61c35b -> 34caa694d


CLOUDSTACK-8645: Improve logging of RBD functionality in KVM

A simple commit which changes a couple of log lines.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4f409a7c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4f409a7c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4f409a7c

Branch: refs/heads/master
Commit: 4f409a7c173d2a2dd0e400dcd1ba426a1af66425
Parents: d091b91
Author: Wido den Hollander 
Authored: Mon Sep 14 13:50:53 2015 +0200
Committer: Wido den Hollander 
Committed: Tue Sep 15 10:10:04 2015 +0200

--
 .../kvm/storage/LibvirtStorageAdaptor.java  | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4f409a7c/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
--
diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index 6ef5b24..f656982 100644
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -273,7 +273,7 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
 s.undefine();
 s.free();
 } catch (LibvirtException l) {
-s_logger.debug("Failed to undefine the libvirt secret: 
" + l.toString());
+s_logger.error("Failed to undefine the libvirt secret: 
" + l.toString());
 }
 }
 return null;
@@ -288,7 +288,7 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
 sp = conn.storagePoolCreateXML(spd.toString(), 0);
 return sp;
 } catch (LibvirtException e) {
-s_logger.debug("Failed to create RBD storage pool: " + 
e.toString());
+s_logger.error("Failed to create RBD storage pool: " + 
e.toString());
 if (sp != null) {
 try {
 if (sp.isPersistent() == 1) {
@@ -299,17 +299,17 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
 }
 sp.free();
 } catch (LibvirtException l) {
-s_logger.debug("Failed to undefine RBD storage pool: " + 
l.toString());
+s_logger.error("Failed to undefine RBD storage pool: " + 
l.toString());
 }
 }
 
 if (s != null) {
 try {
-s_logger.debug("Failed to create the RBD storage pool, 
cleaning up the libvirt secret");
+s_logger.error("Failed to create the RBD storage pool, 
cleaning up the libvirt secret");
 s.undefine();
 s.free();
 } catch (LibvirtException se) {
-s_logger.debug("Failed to remove the libvirt secret: " + 
se.toString());
+s_logger.error("Failed to remove the libvirt secret: " + 
se.toString());
 }
 }
 
@@ -615,7 +615,7 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
 try {
 s = conn.secretLookupByUUIDString(uuid);
 } catch (LibvirtException e) {
-s_logger.debug("Storage pool " + uuid + " has no corresponding 
secret. Not removing any secret.");
+s_logger.info("Storage pool " + uuid + " has no corresponding 
secret. Not removing any secret.");
 }
 
 try {
@@ -877,8 +877,8 @@ public class LibvirtStorageAdaptor implements 
StorageAdaptor {
 rbd.close(image);
 r.ioCtxDestroy(io);
 
-s_logger.debug("Succesfully unprotected and removed any 
snapshots of " + pool.getSourceDir() + "/" + uuid +
-" Continuing to remove the RBD image");
+s_logger.info("Succesfully unprotected and removed any 
remaining snapshots (" + snaps.size() + ") of "
+  + pool.getSourceDir() + "/" + uuid + " 
Continuing to remove the RBD image");
 } catch (RadosException e) {
 throw new CloudRuntimeException(e.toString());
 } catch (RbdException e) {



[2/2] git commit: updated refs/heads/master to 06cefaf

2015-09-15 Thread widodh
Merge pull request #804 from anshul1886/CLOUDSTACK-8834

CLOUDSTACK-8834: Fixed unable to download Template , when in multi zonesWe were 
listing image stores by zone id which was resulting in listing of only one 
image store
If in that image store its download state is not DOWNLOADED then download 
template is failing

* pr/804:
  CLOUDSTACK-8834: Fixed unable to download Template , when in multi zones We 
were listing image stores by zone id which was resulting in listing of only one 
image store If in that image store its download state is not DOWNLOADED then 
download template is failing

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/06cefaf4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/06cefaf4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/06cefaf4

Branch: refs/heads/master
Commit: 06cefaf493423c953a95ee92482a2d0a20a21095
Parents: 34caa69 8511d62
Author: Wido den Hollander 
Authored: Tue Sep 15 11:10:41 2015 +0200
Committer: Wido den Hollander 
Committed: Tue Sep 15 11:10:41 2015 +0200

--
 server/src/com/cloud/template/TemplateManagerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[1/2] git commit: updated refs/heads/master to 06cefaf

2015-09-15 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 34caa694d -> 06cefaf49


CLOUDSTACK-8834: Fixed unable to download Template , when in multi zones
We were listing image stores by zone id which was resulting in listing of only 
one image store
If in that image store its download state is not DOWNLOADED then download 
template is failing


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8511d62b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8511d62b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8511d62b

Branch: refs/heads/master
Commit: 8511d62b5aee6976f2eecd32506402de47858215
Parents: 2d90f18
Author: Anshul Gangwar 
Authored: Thu Jun 11 11:32:08 2015 +0530
Committer: Anshul Gangwar 
Committed: Fri Sep 11 15:30:39 2015 +0530

--
 server/src/com/cloud/template/TemplateManagerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8511d62b/server/src/com/cloud/template/TemplateManagerImpl.java
--
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java 
b/server/src/com/cloud/template/TemplateManagerImpl.java
index 3911340..aaa86e4 100644
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -501,7 +501,7 @@ public class TemplateManagerImpl extends ManagerBase 
implements TemplateManager,
 
 _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, 
template);
 
-List ssStores = _dataStoreMgr.getImageStoresByScope(new 
ZoneScope(zoneId));
+List ssStores = _dataStoreMgr.getImageStoresByScope(new 
ZoneScope(null));
 
 TemplateDataStoreVO tmpltStoreRef = null;
 ImageStoreEntity tmpltStore = null;



[1/4] git commit: updated refs/heads/master to d091b91

2015-09-14 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 0b73d1936 -> d091b9189


Added QCOW2 virtual size checking for S3.

- Cleaned up S3TemplateDownloader
- Created static QCOW2 utils class.
- Reformatted some parts of DownloadManagerImpl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1971614e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1971614e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1971614e

Branch: refs/heads/master
Commit: 1971614e315b3dfe3833fae372fb87e1a2dd0e39
Parents: 28d18dc
Author: Boris Schrijver 
Authored: Wed Sep 9 17:53:35 2015 +0200
Committer: Boris Schrijver 
Committed: Thu Sep 10 16:45:48 2015 +0200

--
 .../storage/template/S3TemplateDownloader.java  | 169 ---
 .../storage/template/DownloadManagerImpl.java   |  87 +++---
 .../src/main/java/com/cloud/utils/S3Utils.java  |  16 ++
 .../com/cloud/utils/storage/QCOW2Utils.java |  60 +++
 4 files changed, 244 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1971614e/core/src/com/cloud/storage/template/S3TemplateDownloader.java
--
diff --git a/core/src/com/cloud/storage/template/S3TemplateDownloader.java 
b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
index ec44d8d..ac47dec 100644
--- a/core/src/com/cloud/storage/template/S3TemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
@@ -27,6 +27,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Date;
 
+import org.apache.cloudstack.managed.context.ManagedContextRunnable;
+import org.apache.cloudstack.storage.command.DownloadCommand.ResourceType;
 import org.apache.commons.httpclient.ChunkedInputStream;
 import org.apache.commons.httpclient.Credentials;
 import org.apache.commons.httpclient.Header;
@@ -50,10 +52,6 @@ import com.amazonaws.services.s3.model.ProgressEvent;
 import com.amazonaws.services.s3.model.ProgressListener;
 import com.amazonaws.services.s3.model.PutObjectRequest;
 import com.amazonaws.services.s3.model.StorageClass;
-
-import org.apache.cloudstack.managed.context.ManagedContextRunnable;
-import org.apache.cloudstack.storage.command.DownloadCommand.ResourceType;
-
 import com.cloud.agent.api.storage.Proxy;
 import com.cloud.agent.api.to.S3TO;
 import com.cloud.utils.Pair;
@@ -61,46 +59,48 @@ import com.cloud.utils.S3Utils;
 import com.cloud.utils.UriUtils;
 
 /**
- * Download a template file using HTTP
- *
+ * Download a template file using HTTP(S)
  */
 public class S3TemplateDownloader extends ManagedContextRunnable implements 
TemplateDownloader {
-public static final Logger s_logger = 
Logger.getLogger(S3TemplateDownloader.class.getName());
+private static final Logger s_logger = 
Logger.getLogger(S3TemplateDownloader.class.getName());
 private static final MultiThreadedHttpConnectionManager 
s_httpClientManager = new MultiThreadedHttpConnectionManager();
 
 private String downloadUrl;
 private String installPath;
 private String s3Key;
 private String fileName;
-public TemplateDownloader.Status status = 
TemplateDownloader.Status.NOT_STARTED;
-public String errorString = " ";
-private long remoteSize = 0;
-public long downloadTime = 0;
-public long totalBytes;
+private String fileExtension;
+private String errorString = " ";
+
+private TemplateDownloader.Status status = 
TemplateDownloader.Status.NOT_STARTED;
+private ResourceType resourceType = ResourceType.TEMPLATE;
 private final HttpClient client;
+private final HttpMethodRetryHandler myretryhandler;
 private GetMethod request;
-private boolean resume = false;
 private DownloadCompleteCallback completionCallback;
-private S3TO s3;
-private boolean inited = true;
+private S3TO s3to;
 
+private long remoteSize = 0;
+private long downloadTime = 0;
+private long totalBytes;
 private long maxTemplateSizeInByte;
-private ResourceType resourceType = ResourceType.TEMPLATE;
-private final HttpMethodRetryHandler myretryhandler;
 
-public S3TemplateDownloader(S3TO storageLayer, String downloadUrl, String 
installPath, DownloadCompleteCallback callback, long maxTemplateSizeInBytes, 
String user,
-String password, Proxy proxy, ResourceType resourceType) {
-s3 = storageLayer;
+private boolean resume = false;
+private boolean inited = true;
+
+public S3TemplateDownloader(S3TO s3to, String downloadUrl, String 
installPath, DownloadCompleteCallback callback,
+long maxTemplateSizeInBytes, String user, String password, Proxy 
proxy, ResourceType 

[4/4] git commit: updated refs/heads/master to d091b91

2015-09-14 Thread widodh
Merge pull request #795 from borisroman/CLOUDSTACK-8819

CLOUDSTACK-8819: Added QCOW2 virtual size checking for S3.- Cleaned up 
S3TemplateDownloader
- Created static QCOW2 utils class.
- Reformatted some parts of DownloadManagerImpl

* pr/795:
  Added Unit Tests for QCOW2Utils.
  Fixed Findbugs issue introduced by 1c6378ec0056e8c75990a4a0c15e99b2df162a75 
PR #795.
  Added QCOW2 virtual size checking for S3.

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d091b918
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d091b918
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d091b918

Branch: refs/heads/master
Commit: d091b9189ccc27549ea993f8e919232fa64922a7
Parents: 0b73d19 aa19a6a
Author: Wido den Hollander 
Authored: Mon Sep 14 12:02:02 2015 +0200
Committer: Wido den Hollander 
Committed: Mon Sep 14 12:02:03 2015 +0200

--
 .../storage/template/DownloadManagerImpl.java   |   3 +-
 .../com/cloud/utils/storage/QCOW2UtilsTest.java | 121 +++
 2 files changed, 123 insertions(+), 1 deletion(-)
--




[2/4] git commit: updated refs/heads/master to d091b91

2015-09-14 Thread widodh
Fixed Findbugs issue introduced by 1c6378ec0056e8c75990a4a0c15e99b2df162a75 PR 
#795.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4a770fc6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4a770fc6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4a770fc6

Branch: refs/heads/master
Commit: 4a770fc63a77e44cecbf6615b55a10113055e042
Parents: 1971614
Author: Boris Schrijver 
Authored: Mon Sep 14 10:56:11 2015 +0200
Committer: Boris Schrijver 
Committed: Mon Sep 14 10:56:11 2015 +0200

--
 .../apache/cloudstack/storage/template/DownloadManagerImpl.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4a770fc6/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
--
diff --git 
a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
 
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
index 2e4bb74..3bc0de7 100644
--- 
a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
+++ 
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
@@ -78,6 +78,7 @@ import com.cloud.storage.template.TemplateProp;
 import com.cloud.storage.template.VhdProcessor;
 import com.cloud.storage.template.VmdkProcessor;
 import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.StringUtils;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.OutputInterpreter;
@@ -423,7 +424,7 @@ public class DownloadManagerImpl extends ManagerBase 
implements DownloadManager
 if (extension.equals("iso")) {
 templateName = jobs.get(jobId).getTmpltName().trim().replace(" ", 
"_");
 } else {
-templateName = 
java.util.UUID.nameUUIDFromBytes((jobs.get(jobId).getTmpltName() + 
System.currentTimeMillis()).getBytes()).toString();
+templateName = 
java.util.UUID.nameUUIDFromBytes((jobs.get(jobId).getTmpltName() + 
System.currentTimeMillis()).getBytes(StringUtils.getPreferredCharset())).toString();
 }
 
 // run script to mv the temporary template file to the final template



[1/3] git commit: updated refs/heads/master to 120e1cc

2015-09-13 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master ff1ce07ae -> 120e1cc93


This is the fix for the JIRA issue CLOUDSTACK-8817. The return values for 
endpoint and startpoint are now Integer instead of String.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4d626c11
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4d626c11
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4d626c11

Branch: refs/heads/master
Commit: 4d626c11bc4f029788ddc0e12340d8e880521f8b
Parents: ff1ce07
Author: Ashwin Swaroop 
Authored: Fri Sep 11 18:27:31 2015 -0400
Committer: Ashwin Swaroop 
Committed: Fri Sep 11 18:27:31 2015 -0400

--
 api/src/org/apache/cloudstack/api/response/FirewallResponse.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d626c11/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
--
diff --git a/api/src/org/apache/cloudstack/api/response/FirewallResponse.java 
b/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
index 4c1342a..368f732 100644
--- a/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
@@ -37,11 +37,11 @@ public class FirewallResponse extends BaseResponse {
 
 @SerializedName(ApiConstants.START_PORT)
 @Param(description = "the starting port of firewall rule's port range")
-private String startPort;
+private Integer startPort;
 
 @SerializedName(ApiConstants.END_PORT)
 @Param(description = "the ending port of firewall rule's port range")
-private String endPort;
+private Integer endPort;
 
 @SerializedName(ApiConstants.IP_ADDRESS_ID)
 @Param(description = "the public ip address id for the firewall rule")



cloudstack-docs-install git commit: packages: Updated URLs to package repos

2015-09-11 Thread widodh
Repository: cloudstack-docs-install
Updated Branches:
  refs/heads/master 3b15e9e74 -> ee1049cae


packages: Updated URLs to package repos


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/commit/ee1049ca
Tree: 
http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/tree/ee1049ca
Diff: 
http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/diff/ee1049ca

Branch: refs/heads/master
Commit: ee1049caecec9e8a51de22cd86868f4d446ad084
Parents: 3b15e9e
Author: Wido den Hollander 
Authored: Fri Sep 11 14:16:57 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Sep 11 14:16:57 2015 +0200

--
 source/management-server/_pkg_repo.rst | 4 ++--
 source/qig.rst | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/blob/ee1049ca/source/management-server/_pkg_repo.rst
--
diff --git a/source/management-server/_pkg_repo.rst 
b/source/management-server/_pkg_repo.rst
index 03eb88c..3ecb2bf 100644
--- a/source/management-server/_pkg_repo.rst
+++ b/source/management-server/_pkg_repo.rst
@@ -53,7 +53,7 @@ information.
 
[cloudstack]
name=cloudstack
-   baseurl=http://cloudstack.apt-get.eu/rhel/4.5/
+   baseurl=http://cloudstack.apt-get.eu/centos/6/4.5/
enabled=1
gpgcheck=0
 
@@ -65,7 +65,7 @@ DEB package repository
 
 You can add a DEB package repository to your apt sources with the
 following commands. Please note that only packages for Ubuntu 12.04 LTS
-(precise) are being built at this time.
+(precise) and Ubuntu 14.04 (trusty) are being built at this time.
 
 Use your preferred editor and open (or create)
 ``/etc/apt/sources.list.d/cloudstack.list``. Add the community provided

http://git-wip-us.apache.org/repos/asf/cloudstack-docs-install/blob/ee1049ca/source/qig.rst
--
diff --git a/source/qig.rst b/source/qig.rst
index 3d88b26..8d761d2 100644
--- a/source/qig.rst
+++ b/source/qig.rst
@@ -256,7 +256,7 @@ insert the following information.
 
[cloudstack]
name=cloudstack
-   baseurl=http://cloudstack.apt-get.eu/rhel/4.5/
+   baseurl=http://cloudstack.apt-get.eu/centos/6/4.5/
enabled=1
gpgcheck=0
 



cloudstack-docs-admin git commit: Add Ceph to the table of supported storage

2015-09-11 Thread widodh
Repository: cloudstack-docs-admin
Updated Branches:
  refs/heads/master aea0265a1 -> 56b7c5d3e


Add Ceph to the table of supported storage


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-admin/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cloudstack-docs-admin/commit/56b7c5d3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-admin/tree/56b7c5d3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-admin/diff/56b7c5d3

Branch: refs/heads/master
Commit: 56b7c5d3e9e65935990eadcd1bbe628fc7af08a4
Parents: aea0265
Author: Wido den Hollander 
Authored: Fri Sep 11 14:44:43 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Sep 11 14:44:43 2015 +0200

--
 source/storage.rst | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-docs-admin/blob/56b7c5d3/source/storage.rst
--
diff --git a/source/storage.rst b/source/storage.rst
index fafb57f..1c1396e 100644
--- a/source/storage.rst
+++ b/source/storage.rst
@@ -110,6 +110,7 @@ Storage media \\ hypervisorVMware 
vSphere   Citrix XenServer
 **Local storage support**  Yes  Yes
  Yes Yes
 **Storage over-provisioning**  NFS and iSCSINFS
  NFS No
 **SMB/CIFS**   No   No 
  No  Yes
+**Ceph/RBD**   No   No 
  Yes No
 ==  
 === 
 
 XenServer uses a clustered LVM system to store VM images on iSCSI and



[2/3] git commit: updated refs/heads/master to 6330ef0

2015-09-11 Thread widodh
Added Unit Test for LocalTemplateDownloader.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c3f2ea6a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c3f2ea6a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c3f2ea6a

Branch: refs/heads/master
Commit: c3f2ea6ae0aa5cf1f54d82aab5d9873b8753d541
Parents: 5f2c732
Author: Boris Schrijver 
Authored: Thu Sep 10 01:26:23 2015 +0200
Committer: Boris Schrijver 
Committed: Thu Sep 10 13:07:34 2015 +0200

--
 .../template/LocalTemplateDownloaderTest.java   | 41 
 1 file changed, 41 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3f2ea6a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
--
diff --git 
a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java 
b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
new file mode 100644
index 000..74d1adc
--- /dev/null
+++ b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
@@ -0,0 +1,41 @@
+//
+// 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 com.cloud.storage.template;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import org.junit.Test;
+
+
+public class LocalTemplateDownloaderTest {
+
+@Test
+public void localTemplateDownloaderTest() {
+String url =  "file://" + new File("pom.xml").getAbsolutePath();
+TemplateDownloader td = new LocalTemplateDownloader(null, url, "/tmp", 
TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
+long bytes = td.download(true, null);
+if (!(bytes > 0)) {
+fail("Failed download");
+}
+}
+
+}



[1/3] git commit: updated refs/heads/master to 6330ef0

2015-09-11 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master ba59a4333 -> 6330ef023


Removal of test/debug code.

Removed main() method from LocalTemplateDownloader.java

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5f2c732a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5f2c732a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5f2c732a

Branch: refs/heads/master
Commit: 5f2c732a2c3ff90c5d21c53477576b754d934305
Parents: 28d18dc
Author: borisroman 
Authored: Wed Sep 9 11:16:14 2015 +0200
Committer: borisroman 
Committed: Wed Sep 9 11:16:14 2015 +0200

--
 .../cloud/storage/template/LocalTemplateDownloader.java | 12 
 1 file changed, 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5f2c732a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
--
diff --git a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java 
b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
index d55a4a2..3d33a21 100644
--- a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
@@ -159,16 +159,4 @@ public class LocalTemplateDownloader extends 
TemplateDownloaderBase implements T
 }
 }
 }
-
-public static void main(String[] args) {
-String url = "file:///home/ahuang/Download/E3921_P5N7A-VM_manual.zip";
-TemplateDownloader td = new LocalTemplateDownloader(null, url, 
"/tmp/mysql", TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
-long bytes = td.download(true, null);
-if (bytes > 0) {
-System.out.println("Downloaded  (" + bytes + " bytes)" + " in " + 
td.getDownloadTime() / 1000 + " secs");
-} else {
-System.out.println("Failed download");
-}
-
-}
 }



[2/3] git commit: updated refs/heads/master to b66dcda

2015-09-11 Thread widodh
Added QCOW2 virtual size checking for S3.

- Cleaned up S3TemplateDownloader
- Created static QCOW2 utils class.
- Reformatted some parts of DownloadManagerImpl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1c6378ec
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1c6378ec
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1c6378ec

Branch: refs/heads/master
Commit: 1c6378ec0056e8c75990a4a0c15e99b2df162a75
Parents: 1a02773
Author: Boris Schrijver 
Authored: Wed Sep 9 17:53:35 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Sep 11 14:57:32 2015 +0200

--
 .../storage/template/S3TemplateDownloader.java  | 169 ---
 .../storage/template/DownloadManagerImpl.java   |  87 +++---
 .../src/main/java/com/cloud/utils/S3Utils.java  |  16 ++
 .../com/cloud/utils/storage/QCOW2Utils.java |  60 +++
 4 files changed, 244 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c6378ec/core/src/com/cloud/storage/template/S3TemplateDownloader.java
--
diff --git a/core/src/com/cloud/storage/template/S3TemplateDownloader.java 
b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
index ec44d8d..ac47dec 100644
--- a/core/src/com/cloud/storage/template/S3TemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
@@ -27,6 +27,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Date;
 
+import org.apache.cloudstack.managed.context.ManagedContextRunnable;
+import org.apache.cloudstack.storage.command.DownloadCommand.ResourceType;
 import org.apache.commons.httpclient.ChunkedInputStream;
 import org.apache.commons.httpclient.Credentials;
 import org.apache.commons.httpclient.Header;
@@ -50,10 +52,6 @@ import com.amazonaws.services.s3.model.ProgressEvent;
 import com.amazonaws.services.s3.model.ProgressListener;
 import com.amazonaws.services.s3.model.PutObjectRequest;
 import com.amazonaws.services.s3.model.StorageClass;
-
-import org.apache.cloudstack.managed.context.ManagedContextRunnable;
-import org.apache.cloudstack.storage.command.DownloadCommand.ResourceType;
-
 import com.cloud.agent.api.storage.Proxy;
 import com.cloud.agent.api.to.S3TO;
 import com.cloud.utils.Pair;
@@ -61,46 +59,48 @@ import com.cloud.utils.S3Utils;
 import com.cloud.utils.UriUtils;
 
 /**
- * Download a template file using HTTP
- *
+ * Download a template file using HTTP(S)
  */
 public class S3TemplateDownloader extends ManagedContextRunnable implements 
TemplateDownloader {
-public static final Logger s_logger = 
Logger.getLogger(S3TemplateDownloader.class.getName());
+private static final Logger s_logger = 
Logger.getLogger(S3TemplateDownloader.class.getName());
 private static final MultiThreadedHttpConnectionManager 
s_httpClientManager = new MultiThreadedHttpConnectionManager();
 
 private String downloadUrl;
 private String installPath;
 private String s3Key;
 private String fileName;
-public TemplateDownloader.Status status = 
TemplateDownloader.Status.NOT_STARTED;
-public String errorString = " ";
-private long remoteSize = 0;
-public long downloadTime = 0;
-public long totalBytes;
+private String fileExtension;
+private String errorString = " ";
+
+private TemplateDownloader.Status status = 
TemplateDownloader.Status.NOT_STARTED;
+private ResourceType resourceType = ResourceType.TEMPLATE;
 private final HttpClient client;
+private final HttpMethodRetryHandler myretryhandler;
 private GetMethod request;
-private boolean resume = false;
 private DownloadCompleteCallback completionCallback;
-private S3TO s3;
-private boolean inited = true;
+private S3TO s3to;
 
+private long remoteSize = 0;
+private long downloadTime = 0;
+private long totalBytes;
 private long maxTemplateSizeInByte;
-private ResourceType resourceType = ResourceType.TEMPLATE;
-private final HttpMethodRetryHandler myretryhandler;
 
-public S3TemplateDownloader(S3TO storageLayer, String downloadUrl, String 
installPath, DownloadCompleteCallback callback, long maxTemplateSizeInBytes, 
String user,
-String password, Proxy proxy, ResourceType resourceType) {
-s3 = storageLayer;
+private boolean resume = false;
+private boolean inited = true;
+
+public S3TemplateDownloader(S3TO s3to, String downloadUrl, String 
installPath, DownloadCompleteCallback callback,
+long maxTemplateSizeInBytes, String user, String password, Proxy 
proxy, ResourceType resourceType) {
+this.s3to = s3to;
 this.downloadUrl = downloadUrl;
 

[1/3] git commit: updated refs/heads/master to b66dcda

2015-09-11 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master a04b8f6e8 -> b66dcda49


CLOUDSTACK-8799 fixed for vpc networks.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b66dcda4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b66dcda4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b66dcda4

Branch: refs/heads/master
Commit: b66dcda49f370e6fc91ebff889a694f17826ca44
Parents: 1c6378e
Author: Bharat Kumar 
Authored: Thu Sep 10 04:14:30 2015 -0700
Committer: Wido den Hollander 
Committed: Fri Sep 11 14:57:32 2015 +0200

--
 .../debian/config/opt/cloud/bin/cs/CsAddress.py   | 14 +-
 .../debian/config/opt/cloud/bin/cs/CsRedundant.py |  2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b66dcda4/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
--
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py 
b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
index a855f83..e97abac 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
@@ -95,6 +95,14 @@ class CsAddress(CsDataBag):
 return ip
 return None
 
+def check_if_link_exists(self,dev):
+cmd="ip link show dev %s"%dev
+result=CsHelper.execute(cmd)
+if(len(result)!=0):
+   return True
+else:
+   return False
+
 def check_if_link_up(self,dev):
 cmd="ip link show dev %s | tr '\n' ' ' | cut -d ' ' -f 9"%dev
 result=CsHelper.execute(cmd)
@@ -117,6 +125,9 @@ class CsAddress(CsDataBag):
 continue
 
 #check if link is up
+if (not self.check_if_link_exists(dev)):
+logging.info("link %s does not exist, so not 
processing"%dev)
+continue
 if not self.check_if_link_up(dev):
cmd="ip link set %s up"%dev
CsHelper.execute(cmd)
@@ -142,7 +153,8 @@ class CsAddress(CsDataBag):
 # is a default route and add if needed
 if not route.defaultroute_exists():
 cmdline=self.config.get_cmdline_instance()
-route.add_defaultroute(cmdline.get_gateway())
+if(cmdline.get_gateway()):
+route.add_defaultroute(cmdline.get_gateway())
 
 
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b66dcda4/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
--
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py 
b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
index 3f1cbe0..5d72824 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -262,7 +262,7 @@ class CsRedundant(object):
 self.set_lock()
 logging.debug("Setting router to master")
 self.address.process()
-logging.info("added default rotue")
+logging.info("added default routes")
 
 # ip route add default via $gw table Table_$dev proto static
 cmd = "%s -C %s" % (self.CONNTRACKD_BIN, self.CONNTRACKD_CONF)



[3/3] git commit: updated refs/heads/master to b66dcda

2015-09-11 Thread widodh
CLOUDSTACK-8799 fixed the defalut routes
CLOUDSTACK-8799 made changes to fix CsRedundant.py


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1a02773b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1a02773b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1a02773b

Branch: refs/heads/master
Commit: 1a02773b556a0efa277cf18cd099fc62a4e27706
Parents: a04b8f6
Author: Bharat Kumar 
Authored: Fri Sep 4 12:44:46 2015 +0530
Committer: Wido den Hollander 
Committed: Fri Sep 11 14:57:32 2015 +0200

--
 .../debian/config/opt/cloud/bin/cs/CsAddress.py | 32 ++--
 .../debian/config/opt/cloud/bin/cs/CsDatabag.py |  4 +++
 .../config/opt/cloud/bin/cs/CsRedundant.py  | 17 ++-
 3 files changed, 29 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a02773b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
--
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py 
b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
index 767e748..a855f83 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
@@ -95,9 +95,17 @@ class CsAddress(CsDataBag):
 return ip
 return None
 
+def check_if_link_up(self,dev):
+cmd="ip link show dev %s | tr '\n' ' ' | cut -d ' ' -f 9"%dev
+result=CsHelper.execute(cmd)
+if(result[0].lower()=="up"):
+return True
+else:
+return False
+
+
 def process(self):
 route = CsRoute()
-found_defaultroute = False
 
 for dev in self.dbag:
 if dev == "id":
@@ -105,8 +113,14 @@ class CsAddress(CsDataBag):
 ip = CsIP(dev, self.config)
 
 for address in self.dbag[dev]:
+if(address["nw_type"]!="public"):
+continue
+
+#check if link is up
+if not self.check_if_link_up(dev):
+   cmd="ip link set %s up"%dev
+   CsHelper.execute(cmd)
 
-gateway = str(address["gateway"])
 network = str(address["network"])
 
 ip.setAddress(address)
@@ -122,16 +136,14 @@ class CsAddress(CsDataBag):
 "Address %s on device %s not configured", ip.ip(), dev)
 if CsDevice(dev, self.config).waitfordevice():
 ip.configure()
+route.add_route(dev, network)
 
-if address["nw_type"] != "control":
-route.add_route(dev, network)
+# once we start processing public ip's we need to verify there
+# is a default route and add if needed
+if not route.defaultroute_exists():
+cmdline=self.config.get_cmdline_instance()
+route.add_defaultroute(cmdline.get_gateway())
 
-# once we start processing public ip's we need to verify there
-# is a default route and add if needed
-if address["nw_type"] == "public" and not found_defaultroute:
-if not route.defaultroute_exists():
-if route.add_defaultroute(gateway):
-found_defaultroute = True
 
 
 class CsInterface:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a02773b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
--
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py 
b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
index 2a37b0a..f04961b 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
@@ -134,3 +134,7 @@ class CsCmdLine(CsDataBag):
 md5 = hashlib.md5()
 md5.update(passwd)
 return md5.hexdigest()
+def get_gateway(self):
+if "gateway" in self.idata():
+return self.idata()['gateway']
+return False

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a02773b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
--
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py 
b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
index da9b887..3f1cbe0 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -261,20 +261,9 @@ class CsRedundant(object):
 
 

cloudstack-www git commit: Add Ceph to the features of CloudStack

2015-09-11 Thread widodh
Repository: cloudstack-www
Updated Branches:
  refs/heads/master 2481287e1 -> 0d03f9673


Add Ceph to the features of CloudStack


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-www/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-www/commit/0d03f967
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-www/tree/0d03f967
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-www/diff/0d03f967

Branch: refs/heads/master
Commit: 0d03f967326ac34f5833b084336c6ad49ec0dcdd
Parents: 2481287
Author: Wido den Hollander 
Authored: Fri Sep 11 15:02:36 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Sep 11 15:02:36 2015 +0200

--
 source/features.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-www/blob/0d03f967/source/features.markdown
--
diff --git a/source/features.markdown b/source/features.markdown
index a8fc188..69e690f 100644
--- a/source/features.markdown
+++ b/source/features.markdown
@@ -116,7 +116,7 @@ Have a feature request? We'd invite you to [bring it up on 
the mailing list](mai
 
 
 Multiple Storage 
Solutions
-CloudStack supports many storage solutions 
with iSCSI and NFS being preferred, but anything that can have multiple 
nodes mount it simultaneously will work. This gives you the ultimate 
freedom in deciding your storage servers from using commodity hardware to 
integrating with enterprise-grade solutions such as Dell EqualLogic or 
NetApp.
+CloudStack supports many storage solutions 
with iSCSI and NFS being preferred, but anything that can have multiple 
nodes mount it simultaneously will work. Ceph RBD is also supported in 
combination with the KVM hypervisor. This gives you the ultimate freedom in 
deciding your storage servers from using commodity hardware to integrating with 
enterprise-grade solutions such as Dell EqualLogic or NetApp.
 
 
 Storage 
Tiering



[2/2] git commit: updated refs/heads/master to 5812f71

2015-09-11 Thread widodh
Merge pull request #807 from karuturi/createuser-unittests

unittests to verify empty password is not allowed during account/user create

* pr/807:
  unittests to verify empty password is not allowed during account create

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5812f714
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5812f714
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5812f714

Branch: refs/heads/master
Commit: 5812f714fcb96566ada96736b81857017a9ef0ca
Parents: 6330ef0 1865433
Author: Wido den Hollander 
Authored: Fri Sep 11 14:54:47 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Sep 11 14:54:47 2015 +0200

--
 .../command/admin/account/CreateAccountCmd.java |  15 ++-
 .../api/command/admin/user/CreateUserCmd.java   |  13 ++-
 .../admin/account/CreateAccountCmdTest.java | 100 +++
 .../command/admin/user/CreateUserCmdTest.java   |  96 ++
 .../com/cloud/user/AccountManagerImplTest.java  |  43 
 5 files changed, 260 insertions(+), 7 deletions(-)
--




[1/2] git commit: updated refs/heads/master to 5812f71

2015-09-11 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 6330ef023 -> 5812f714f


unittests to verify empty password is not allowed during account create


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1865433e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1865433e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1865433e

Branch: refs/heads/master
Commit: 1865433e69fe9f0e639a51340406517496cb92cc
Parents: 2d90f18
Author: Rajani Karuturi 
Authored: Tue Apr 1 11:32:33 2014 +0530
Committer: Rajani Karuturi 
Committed: Fri Sep 11 15:52:38 2015 +0530

--
 .../command/admin/account/CreateAccountCmd.java |  15 ++-
 .../api/command/admin/user/CreateUserCmd.java   |  13 ++-
 .../admin/account/CreateAccountCmdTest.java | 100 +++
 .../command/admin/user/CreateUserCmdTest.java   |  96 ++
 .../com/cloud/user/AccountManagerImplTest.java  |  43 
 5 files changed, 260 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1865433e/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
--
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
index ec3090f..b55ce71 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.account;
 import java.util.Collection;
 import java.util.Map;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
@@ -31,7 +32,6 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.AccountResponse;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.commons.lang.StringUtils;
 
 import com.cloud.user.Account;
 import com.cloud.user.UserAccount;
@@ -175,9 +175,7 @@ public class CreateAccountCmd extends BaseCmd {
 
 @Override
 public void execute() {
-if (StringUtils.isEmpty(getPassword())) {
-throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty 
passwords are not allowed");
-}
+validateParams();
 CallContext.current().setEventDetails("Account Name: " + 
getAccountName() + ", Domain Id:" + getDomainId());
 UserAccount userAccount =
 _accountService.createUserAccount(getUsername(), getPassword(), 
getFirstName(), getLastName(), getEmail(), getTimeZone(), getAccountName(), 
getAccountType(),
@@ -190,4 +188,13 @@ public class CreateAccountCmd extends BaseCmd {
 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed 
to create a user account");
 }
 }
+
+/**
+ * TODO: this should be done through a validator. for now replicating the 
validation logic in create account and user
+ */
+private void validateParams() {
+if(StringUtils.isEmpty(getPassword())) {
+throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty 
passwords are not allowed");
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1865433e/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
--
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
index 122fd43..71d6a66 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
@@ -150,9 +150,7 @@ public class CreateUserCmd extends BaseCmd {
 
 @Override
 public void execute() {
-if (StringUtils.isEmpty(getPassword())) {
-throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty 
passwords are not allowed");
-}
+validateParams();
 CallContext.current().setEventDetails("UserName: " + getUserName() + 
", FirstName :" + getFirstName() + ", LastName: " + getLastName());
 User user =
 _accountService.createUser(getUserName(), getPassword(), 
getFirstName(), getLastName(), getEmail(), getTimezone(), getAccountName(), 
getDomainId(),
@@ -165,4 +163,13 @@ public class CreateUserCmd extends BaseCmd {
 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed 
to create a user");
 

cloudstack-docs git commit: Add Ceph in concepts about Primary Storage

2015-09-11 Thread widodh
Repository: cloudstack-docs
Updated Branches:
  refs/heads/master 0568e985f -> 24fae4506


Add Ceph in concepts about Primary Storage


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-docs/commit/24fae450
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-docs/tree/24fae450
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-docs/diff/24fae450

Branch: refs/heads/master
Commit: 24fae4506689cba80a9de75cb727fedc128ddff0
Parents: 0568e98
Author: Wido den Hollander 
Authored: Fri Sep 11 14:44:22 2015 +0200
Committer: Wido den Hollander 
Committed: Fri Sep 11 14:44:22 2015 +0200

--
 rtd/source/concepts.rst | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack-docs/blob/24fae450/rtd/source/concepts.rst
--
diff --git a/rtd/source/concepts.rst b/rtd/source/concepts.rst
index 79971e3..e3ea3b8 100644
--- a/rtd/source/concepts.rst
+++ b/rtd/source/concepts.rst
@@ -432,6 +432,9 @@ time-consuming.
 For Hyper-V, SMB/CIFS storage is supported. Note that Zone-wide Primary
 Storage is not supported in Hyper-V.
 
+Ceph/RBD storage is only supported by the KVM hypervisor. It can be used
+as Zone-wide Primary Storage.
+
 CloudStack is designed to work with all standards-compliant iSCSI and
 NFS servers that are supported by the underlying hypervisor, including,
 for example:



[2/2] git commit: updated refs/heads/master to bbafaf0

2015-09-08 Thread widodh
Merge pull request #783 from wido/debian-depends

debian: Updated dependencies for PackagesA few dependencies have been updated 
to their latest version and some
have been removed.

The ordering for some dependencies has been changed so that we will
depend on Java 8 over Java 7 when doing a new install.

* pr/783:
  debian: Updated dependencies for Packages

Signed-off-by: Wido den Hollander 


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bbafaf05
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bbafaf05
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bbafaf05

Branch: refs/heads/master
Commit: bbafaf05b15f9172bb6c489ddafcf9b28a3c452f
Parents: 5da7083 ae5025a
Author: Wido den Hollander 
Authored: Tue Sep 8 10:28:49 2015 +0200
Committer: Wido den Hollander 
Committed: Tue Sep 8 10:28:49 2015 +0200

--
 debian/control | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--




[1/2] git commit: updated refs/heads/master to bbafaf0

2015-09-08 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 5da70837a -> bbafaf05b


debian: Updated dependencies for Packages

A few dependencies have been updated to their latest version and some
have been removed.

The ordering for some dependencies has been changed so that we will
depend on Java 8 over Java 7 when doing a new install.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ae5025ac
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ae5025ac
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ae5025ac

Branch: refs/heads/master
Commit: ae5025aca8ce7c0a29e2dcf0db86dbb862546796
Parents: 5da7083
Author: Wido den Hollander 
Authored: Mon Sep 7 16:45:34 2015 +0200
Committer: Wido den Hollander 
Committed: Mon Sep 7 16:45:34 2015 +0200

--
 debian/control | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae5025ac/debian/control
--
diff --git a/debian/control b/debian/control
index 86bf55e..6720595 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,8 @@ Source: cloudstack
 Section: libs
 Priority: extra
 Maintainer: Wido den Hollander 
-Build-Depends: debhelper (>= 7), openjdk-7-jdk | openjdk-8-jdk, genisoimage,
- python-mysqldb, maven (>= 3) | maven3, python (>= 2.6.6-3~)
+Build-Depends: debhelper (>= 9), openjdk-8-jdk | openjdk-7-jdk, genisoimage,
+ python-mysqldb, maven (>= 3) | maven3, python (>= 2.7)
 Standards-Version: 3.8.1
 Homepage: http://www.cloudstack.org/
 
@@ -15,14 +15,14 @@ Description: A common package which contains files which 
are shared by several C
 
 Package: cloudstack-management
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, cloudstack-common (= 
${source:Version}), tomcat6 | tomcat7 | tomcat8, sudo, jsvc, python-mysqldb, 
libmysql-java, python-paramiko, augeas-tools, mysql-client, adduser
+Depends: ${misc:Depends}, ${python:Depends}, cloudstack-common (= 
${source:Version}), tomcat8 | tomcat7 | tomcat6, sudo, jsvc, python-mysqldb, 
libmysql-java, augeas-tools, mysql-client, adduser
 Conflicts: cloud-server, cloud-client, cloud-client-ui
 Description: CloudStack server library
  The CloudStack management server
 
 Package: cloudstack-agent
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, openjdk-7-jre-headless | 
openjdk-8-jre-headless, cloudstack-common (= ${source:Version}), lsb-base (>= 
3.2), libcommons-daemon-java, openssh-client, libvirt0, qemu-system-x86 | 
qemu-kvm, libvirt-bin, uuid-runtime, rsync, iproute, perl-modules, ebtables, 
vlan, wget, jsvc, ipset, python-libvirt, ethtool, iptables
+Depends: ${misc:Depends}, ${python:Depends}, openjdk-8-jre-headless | 
openjdk-7-jre-headless, cloudstack-common (= ${source:Version}), lsb-base (>= 
4.0), libcommons-daemon-java, openssh-client, qemu-kvm (>= 1.0), libvirt-bin 
(>= 0.9.8), uuid-runtime, iproute, ebtables, vlan, jsvc, ipset, python-libvirt, 
ethtool, iptables
 Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
 Description: CloudStack agent
  The CloudStack agent is in charge of managing shared computing resources in
@@ -31,7 +31,7 @@ Description: CloudStack agent
 
 Package: cloudstack-usage
 Architecture: all
-Depends: ${misc:Depends}, openjdk-7-jre-headless | openjdk-8-jre-headless, 
cloudstack-common (= ${source:Version}), jsvc, libmysql-java
+Depends: ${misc:Depends}, openjdk-8-jre-headless | openjdk-7-jre-headless, 
cloudstack-common (= ${source:Version}), jsvc, libmysql-java
 Description: CloudStack usage monitor
  The CloudStack usage monitor provides usage accounting across the entire 
cloud for
  cloud operators to charge based on usage parameters.



[2/2] git commit: updated refs/heads/master to a741875

2015-08-28 Thread widodh
Merge pull request #757 from ustcweizhou/MariaDB-crash

Fix schema-421to430.sql issue after MariaDB upgrade@remibergsma @wido Can you 
test it?

* pr/757:
  Fix schema-421to430.sql issue after MariaDB upgrade

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a7418751
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a7418751
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a7418751

Branch: refs/heads/master
Commit: a7418751c1790adcb985ab2a91d3ccc1298c2796
Parents: da9cc33 9978651
Author: Wido den Hollander w...@widodh.nl
Authored: Fri Aug 28 09:56:17 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Fri Aug 28 09:56:17 2015 +0200

--
 setup/db/db/schema-421to430.sql | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--




[1/2] git commit: updated refs/heads/master to a741875

2015-08-28 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master da9cc334a - a7418751c


Fix schema-421to430.sql issue after MariaDB upgrade


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/99786516
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/99786516
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/99786516

Branch: refs/heads/master
Commit: 99786516d7eb25fcf2e971bc3d2e7532a3a39b1f
Parents: da9cc33
Author: Wei Zhou w.z...@tech.leaseweb.com
Authored: Thu Aug 27 16:21:22 2015 +0200
Committer: Wei Zhou w.z...@tech.leaseweb.com
Committed: Thu Aug 27 16:21:22 2015 +0200

--
 setup/db/db/schema-421to430.sql | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99786516/setup/db/db/schema-421to430.sql
--
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index 3f2ad02..0a96ea0 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -111,8 +111,7 @@ CREATE TABLE `cloud`.`async_job_join_map` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 #realhostip changes, before changing table and adding default value
-UPDATE `cloud`.`configuration` SET value = CONCAT(*.,(SELECT 
`temptable`.`value` FROM (SELECT * FROM `cloud`.`configuration` WHERE 
`name`=consoleproxy.url.domain) AS `temptable` WHERE 
`temptable`.`name`=consoleproxy.url.domain)) WHERE 
`name`=consoleproxy.url.domain;
-UPDATE `cloud`.`configuration` SET `value` = CONCAT(*.,(SELECT 
`temptable`.`value` FROM (SELECT * FROM `cloud`.`configuration` WHERE 
`name`=secstorage.ssl.cert.domain) AS `temptable` WHERE 
`temptable`.`name`=secstorage.ssl.cert.domain)) WHERE 
`name`=secstorage.ssl.cert.domain;
+UPDATE `cloud`.`configuration` SET value=CONCAT(*.,value) WHERE 
`name`=consoleproxy.url.domain OR `name`=secstorage.ssl.cert.domain;
 
 ALTER TABLE `cloud`.`configuration` ADD COLUMN `default_value` VARCHAR(4095) 
COMMENT 'Default value for a configuration parameter';
 ALTER TABLE `cloud`.`configuration` ADD COLUMN `updated` datetime COMMENT 
'Time this was updated by the server. null means this row is obsolete.';



[3/3] git commit: updated refs/heads/master to 64a2cbd

2015-08-18 Thread widodh
Merge pull request #708 from radu-stefanache/master

Fixed typoSpotted this using Elasticsearch .

* pr/708:
  Typo correction

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/64a2cbda
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/64a2cbda
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/64a2cbda

Branch: refs/heads/master
Commit: 64a2cbdae63fca4771524e93a69110aa41f81776
Parents: 8a1d632 cea45b2
Author: Wido den Hollander w...@widodh.nl
Authored: Tue Aug 18 12:03:24 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Tue Aug 18 12:03:24 2015 +0200

--
 server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[1/3] git commit: updated refs/heads/master to 64a2cbd

2015-08-18 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 8a1d63227 - 64a2cbdae


Typo correction

Simple typo in the code .

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f5a6d8ca
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f5a6d8ca
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f5a6d8ca

Branch: refs/heads/master
Commit: f5a6d8ca3ac143a042016d73017af25731a77d4b
Parents: fa56b3f
Author: Radu Stefanache radu.stefana...@gmail.com
Authored: Wed Aug 12 09:48:49 2015 +0100
Committer: Radu Stefanache radu.stefana...@gmail.com
Committed: Wed Aug 12 09:48:49 2015 +0100

--
 server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5a6d8ca/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
--
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java 
b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 75bc4b5..bfd6af4 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -358,7 +358,7 @@ StateListenerState, VirtualMachine.Event, VirtualMachine {
 }
 }
 }
-s_logger.debug(Cannnot deploy to specified host, returning.);
+s_logger.debug(Cannot deploy to specified host, returning.);
 return null;
 }
 



[2/3] git commit: updated refs/heads/master to 64a2cbd

2015-08-18 Thread widodh
Merge pull request #1 from radu-stefanache/radu-stefanache-patch-1

Typo correction

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cea45b21
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cea45b21
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cea45b21

Branch: refs/heads/master
Commit: cea45b21241a02bfc4b1295e80a6d1af8c46dfca
Parents: fa56b3f f5a6d8c
Author: Radu Stefanache radu.stefana...@gmail.com
Authored: Thu Aug 13 16:05:56 2015 +0100
Committer: Radu Stefanache radu.stefana...@gmail.com
Committed: Thu Aug 13 16:05:56 2015 +0100

--
 server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[2/2] git commit: updated refs/heads/master to 8a1d632

2015-08-18 Thread widodh
Merge pull request #709 from borisroman/CLOUDSTACK-8742

Removed double encoding of Public Key from JS.See Cloudstack issue 
CLOUDSTACK-8742  CLOUDSTACK-8649 for information.

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

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8a1d6322
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8a1d6322
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8a1d6322

Branch: refs/heads/master
Commit: 8a1d6322733069d856bd8b95f4e24052946b44a7
Parents: bc51a42 f9e21da
Author: Wido den Hollander w...@widodh.nl
Authored: Tue Aug 18 11:43:35 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Tue Aug 18 11:43:36 2015 +0200

--
 ui/scripts/accounts.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[1/2] git commit: updated refs/heads/master to 8a1d632

2015-08-18 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master bc51a42fc - 8a1d63227


Removed double encoding of Public Key from JS.

See Cloudstack issue CLOUDSTACK-8742 for information.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f9e21da5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f9e21da5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f9e21da5

Branch: refs/heads/master
Commit: f9e21da5dda095f23b6809946e4a2b8ab7c8f86b
Parents: bc51a42
Author: Boris Schrijver bo...@pcextreme.nl
Authored: Mon Aug 17 22:56:17 2015 +0200
Committer: Boris Schrijver bo...@pcextreme.nl
Committed: Mon Aug 17 22:56:17 2015 +0200

--
 ui/scripts/accounts.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f9e21da5/ui/scripts/accounts.js
--
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index e48f3a1..420eb16 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -1813,7 +1813,7 @@
 
 if (args.data.publickey != null  
args.data.publickey.length  0) {
 $.extend(data, {
-publickey: 
encodeURIComponent(args.data.publickey)
+publickey: args.data.publickey
 });
 $.ajax({
 url: createURL('registerSSHKeyPair'),



[3/4] git commit: updated refs/heads/master to bc51a42

2015-08-17 Thread widodh
Refactored NicProfile.java for readability.

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


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5db33718
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5db33718
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5db33718

Branch: refs/heads/master
Commit: 5db337184057193001056f46e178836e6be2d6fd
Parents: caa524b
Author: Boris Schrijver bo...@pcextreme.nl
Authored: Mon Aug 17 14:12:10 2015 +0200
Committer: Boris Schrijver bo...@pcextreme.nl
Committed: Mon Aug 17 14:12:10 2015 +0200

--
 api/src/com/cloud/vm/NicProfile.java| 443 ++-
 .../orchestration/NetworkOrchestrator.java  |  57 ++-
 .../BareMetalPingServiceImpl.java   |  17 +-
 .../networkservice/BaremetaNetworkGuru.java |  35 +-
 .../BaremetalDhcpManagerImpl.java   |  36 +-
 .../networkservice/BaremetalPxeManagerImpl.java |   9 +-
 .../hypervisor/hyperv/guru/HypervGuru.java  |  14 +-
 .../network/element/BigSwitchBcfElement.java|   2 +-
 .../guru/BigSwitchBcfGuestNetworkGuru.java  |   2 +-
 .../cloudstack/network/element/DnsNotifier.java |   8 +-
 .../lb/ElasticLoadBalancerManagerImpl.java  |  22 +-
 .../cloudstack/element/GloboDnsElement.java |   4 +-
 .../cloudstack/element/GloboDnsElementTest.java |   8 +-
 .../lb/InternalLoadBalancerVMManagerImpl.java   |  26 +-
 .../management/ContrailElementImpl.java |  22 +-
 .../contrail/management/ContrailGuru.java   |  27 +-
 .../cloud/network/element/MidoNetElement.java   |  22 +-
 .../network/guru/MidoNetPublicNetworkGuru.java  |  32 +-
 .../network/element/MidoNetElementTest.java |   6 +-
 server/src/com/cloud/api/ApiResponseHelper.java |  23 +-
 .../consoleproxy/ConsoleProxyManagerImpl.java   |  26 +-
 .../cloud/hypervisor/HypervisorGuruBase.java|  10 +-
 .../com/cloud/network/IpAddressManagerImpl.java |  46 +-
 .../element/CloudZonesNetworkElement.java   |   4 +-
 .../cloud/network/guru/ControlNetworkGuru.java  |  15 +-
 .../cloud/network/guru/DirectNetworkGuru.java   |  49 +-
 .../network/guru/DirectPodBasedNetworkGuru.java |  35 +-
 .../network/guru/ExternalGuestNetworkGuru.java  |  39 +-
 .../cloud/network/guru/GuestNetworkGuru.java|  26 +-
 .../cloud/network/guru/PodBasedNetworkGuru.java |  10 +-
 .../cloud/network/guru/PrivateNetworkGuru.java  |  32 +-
 .../cloud/network/guru/PublicNetworkGuru.java   |  35 +-
 .../cloud/network/guru/StorageNetworkGuru.java  |  10 +-
 .../network/router/CommandSetupHelper.java  |  10 +-
 .../cloud/network/router/NetworkHelperImpl.java |  14 +-
 .../network/router/NicProfileHelperImpl.java|  12 +-
 .../VirtualNetworkApplianceManagerImpl.java |  54 +--
 .../network/router/VpcNetworkHelperImpl.java|   6 +-
 .../VpcVirtualNetworkApplianceManagerImpl.java  |  10 +-
 .../com/cloud/network/rules/DhcpPvlanRules.java |   2 +-
 .../cloud/network/rules/DhcpSubNetRules.java|   8 +-
 .../cloud/network/rules/NicPlugInOutRules.java  |  12 +-
 .../network/rules/PrivateGatewayRules.java  |   2 +-
 .../SecondaryStorageManagerImpl.java|  26 +-
 44 files changed, 668 insertions(+), 640 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/api/src/com/cloud/vm/NicProfile.java
--
diff --git a/api/src/com/cloud/vm/NicProfile.java 
b/api/src/com/cloud/vm/NicProfile.java
index e9e9dc5..717054a 100644
--- a/api/src/com/cloud/vm/NicProfile.java
+++ b/api/src/com/cloud/vm/NicProfile.java
@@ -33,92 +33,166 @@ public class NicProfile implements InternalIdentity, 
Serializable {
 
 long id;
 long networkId;
+long vmId;
+String reservationId;
+Integer deviceId;
+
+String name;
+String uuid;
+
+String macAddress;
 BroadcastDomainType broadcastType;
 Mode mode;
-long vmId;
-String gateway;
 AddressFormat format;
 TrafficType trafficType;
-String ip4Address;
-String ip6Address;
-String ip6Gateway;
-String ip6Cidr;
-String macAddress;
 URI isolationUri;
-String netmask;
 URI broadcastUri;
 ReservationStrategy strategy;
-String reservationId;
 boolean defaultNic;
-Integer deviceId;
-String dns1;
-String dns2;
-String ip6Dns1;
-String ip6Dns2;
 Integer networkRate;
 boolean isSecurityGroupEnabled;
-String name;
-String requestedIpv4;
-String requestedIpv6;
-String uuid;
 
-public String getDns1() {
-return dns1;
-}
+// IPv4
+String ipv4Address;
+String ipv4Netmask;
+String ipv4Gateway;
+String ipv4Dns1;
+String ipv4Dns2;
+String requestedIPv4;
+
+// IPv6
+String 

[2/4] git commit: updated refs/heads/master to bc51a42

2015-08-17 Thread widodh
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
--
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java 
b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index d2f6fd2..54ae382 100644
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -30,11 +30,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
 import org.apache.cloudstack.config.ApiServiceConfiguration;
 import org.apache.cloudstack.context.CallContext;
 import 
org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
@@ -47,6 +42,7 @@ import 
org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -141,6 +137,8 @@ import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.ConsoleProxyDao;
 import com.cloud.vm.dao.UserVmDetailsDao;
 import com.cloud.vm.dao.VMInstanceDao;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
 
 //
 // Possible console proxy state transition cases
@@ -1330,16 +1328,16 @@ public class ConsoleProxyManagerImpl extends 
ManagerBase implements ConsoleProxy
 
 for (NicProfile nic : profile.getNics()) {
 int deviceId = nic.getDeviceId();
-if (nic.getIp4Address() == null) {
+if (nic.getIPv4Address() == null) {
 buf.append( 
eth).append(deviceId).append(ip=).append(0.0.0.0);
 buf.append( 
eth).append(deviceId).append(mask=).append(0.0.0.0);
 } else {
-buf.append( 
eth).append(deviceId).append(ip=).append(nic.getIp4Address());
-buf.append( 
eth).append(deviceId).append(mask=).append(nic.getNetmask());
+buf.append( 
eth).append(deviceId).append(ip=).append(nic.getIPv4Address());
+buf.append( 
eth).append(deviceId).append(mask=).append(nic.getIPv4Netmask());
 }
 
 if (nic.isDefaultNic()) {
-buf.append( gateway=).append(nic.getGateway());
+buf.append( gateway=).append(nic.getIPv4Gateway());
 }
 
 if (nic.getTrafficType() == TrafficType.Management) {
@@ -1384,11 +1382,11 @@ public class ConsoleProxyManagerImpl extends 
ManagerBase implements ConsoleProxy
 for (NicProfile nic : nics) {
 if ((nic.getTrafficType() == TrafficType.Public  
dc.getNetworkType() == NetworkType.Advanced) ||
 (nic.getTrafficType() == TrafficType.Guest  
(dc.getNetworkType() == NetworkType.Basic || dc.isSecurityGroupEnabled( {
-proxy.setPublicIpAddress(nic.getIp4Address());
-proxy.setPublicNetmask(nic.getNetmask());
+proxy.setPublicIpAddress(nic.getIPv4Address());
+proxy.setPublicNetmask(nic.getIPv4Netmask());
 proxy.setPublicMacAddress(nic.getMacAddress());
 } else if (nic.getTrafficType() == TrafficType.Management) {
-proxy.setPrivateIpAddress(nic.getIp4Address());
+proxy.setPrivateIpAddress(nic.getIPv4Address());
 proxy.setPrivateMacAddress(nic.getMacAddress());
 }
 }
@@ -1404,7 +1402,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase 
implements ConsoleProxy
 for (NicProfile nic : profile.getNics()) {
 if (nic.getTrafficType() == TrafficType.Management) {
 managementNic = nic;
-} else if (nic.getTrafficType() == TrafficType.Control  
nic.getIp4Address() != null) {
+} else if (nic.getTrafficType() == TrafficType.Control  
nic.getIPv4Address() != null) {
 controlNic = nic;
 }
 }
@@ -1422,7 +1420,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase 
implements ConsoleProxy
 controlNic = managementNic;
 }
 
-CheckSshCommand check = new CheckSshCommand(profile.getInstanceName(), 
controlNic.getIp4Address(), 3922);
+CheckSshCommand check = new CheckSshCommand(profile.getInstanceName(), 
controlNic.getIPv4Address(), 3922);
 cmds.addCommand(checkSsh, check);
 
 return true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5db33718/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
--
diff --git 

[4/4] git commit: updated refs/heads/master to bc51a42

2015-08-17 Thread widodh
Merge pull request #705 from borisroman/CLOUDSTACK-8736

Refactored NicProfile.java for readability.Only changed names and reorganized 
them! No functional implementation change.

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

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

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bc51a42f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bc51a42f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bc51a42f

Branch: refs/heads/master
Commit: bc51a42fc249cdc9fadcd310c3eb346297f694a7
Parents: 9c7e81e 5db3371
Author: Wido den Hollander w...@widodh.nl
Authored: Mon Aug 17 15:24:06 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Mon Aug 17 15:24:06 2015 +0200

--
 api/src/com/cloud/vm/NicProfile.java| 443 ++-
 .../orchestration/NetworkOrchestrator.java  |  57 ++-
 .../BareMetalPingServiceImpl.java   |  17 +-
 .../networkservice/BaremetaNetworkGuru.java |  35 +-
 .../BaremetalDhcpManagerImpl.java   |  36 +-
 .../networkservice/BaremetalPxeManagerImpl.java |   9 +-
 .../hypervisor/hyperv/guru/HypervGuru.java  |  14 +-
 .../network/element/BigSwitchBcfElement.java|   2 +-
 .../guru/BigSwitchBcfGuestNetworkGuru.java  |   2 +-
 .../cloudstack/network/element/DnsNotifier.java |   8 +-
 .../lb/ElasticLoadBalancerManagerImpl.java  |  22 +-
 .../cloudstack/element/GloboDnsElement.java |   4 +-
 .../cloudstack/element/GloboDnsElementTest.java |   8 +-
 .../lb/InternalLoadBalancerVMManagerImpl.java   |  26 +-
 .../management/ContrailElementImpl.java |  22 +-
 .../contrail/management/ContrailGuru.java   |  27 +-
 .../cloud/network/element/MidoNetElement.java   |  22 +-
 .../network/guru/MidoNetPublicNetworkGuru.java  |  32 +-
 .../network/element/MidoNetElementTest.java |   6 +-
 server/src/com/cloud/api/ApiResponseHelper.java |  23 +-
 .../consoleproxy/ConsoleProxyManagerImpl.java   |  26 +-
 .../cloud/hypervisor/HypervisorGuruBase.java|  10 +-
 .../com/cloud/network/IpAddressManagerImpl.java |  46 +-
 .../element/CloudZonesNetworkElement.java   |   4 +-
 .../cloud/network/guru/ControlNetworkGuru.java  |  15 +-
 .../cloud/network/guru/DirectNetworkGuru.java   |  49 +-
 .../network/guru/DirectPodBasedNetworkGuru.java |  35 +-
 .../network/guru/ExternalGuestNetworkGuru.java  |  39 +-
 .../cloud/network/guru/GuestNetworkGuru.java|  26 +-
 .../cloud/network/guru/PodBasedNetworkGuru.java |  10 +-
 .../cloud/network/guru/PrivateNetworkGuru.java  |  32 +-
 .../cloud/network/guru/PublicNetworkGuru.java   |  35 +-
 .../cloud/network/guru/StorageNetworkGuru.java  |  10 +-
 .../network/router/CommandSetupHelper.java  |  10 +-
 .../cloud/network/router/NetworkHelperImpl.java |  14 +-
 .../network/router/NicProfileHelperImpl.java|  12 +-
 .../VirtualNetworkApplianceManagerImpl.java |  54 +--
 .../network/router/VpcNetworkHelperImpl.java|   6 +-
 .../VpcVirtualNetworkApplianceManagerImpl.java  |  10 +-
 .../com/cloud/network/rules/DhcpPvlanRules.java |   2 +-
 .../cloud/network/rules/DhcpSubNetRules.java|   8 +-
 .../cloud/network/rules/NicPlugInOutRules.java  |  12 +-
 .../network/rules/PrivateGatewayRules.java  |   2 +-
 .../SecondaryStorageManagerImpl.java|  26 +-
 44 files changed, 668 insertions(+), 640 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc51a42f/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
--



[1/2] git commit: updated refs/heads/master to aa7f8e5

2015-08-13 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master 792c27c9b - aa7f8e57c


Added unit tests for CLOUDSTACK-8133

Tests will confirm the behaviour of the newly added response fields of 
listSecurityGroups.

Signed-off-by: Wido den Hollander w...@widodh.nl

This closes #679


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/aa7f8e57
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/aa7f8e57
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/aa7f8e57

Branch: refs/heads/master
Commit: aa7f8e57c592cd3e4f3e222697c0fe3cc5eef7b4
Parents: 03f4887
Author: Boris Schrijver bo...@pcextreme.nl
Authored: Wed Aug 12 16:00:07 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Thu Aug 13 13:47:38 2015 +0200

--
 .../query/dao/SecurityGroupJoinDaoImplTest.java | 205 +++
 1 file changed, 205 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aa7f8e57/server/test/com/cloud/api/query/dao/SecurityGroupJoinDaoImplTest.java
--
diff --git 
a/server/test/com/cloud/api/query/dao/SecurityGroupJoinDaoImplTest.java 
b/server/test/com/cloud/api/query/dao/SecurityGroupJoinDaoImplTest.java
new file mode 100644
index 000..112504d
--- /dev/null
+++ b/server/test/com/cloud/api/query/dao/SecurityGroupJoinDaoImplTest.java
@@ -0,0 +1,205 @@
+// 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 com.cloud.api.query.dao;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.when;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.cloudstack.api.response.SecurityGroupResponse;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import com.cloud.api.query.vo.ResourceTagJoinVO;
+import com.cloud.api.query.vo.SecurityGroupJoinVO;
+import com.cloud.network.security.SecurityGroupVMMapVO;
+import com.cloud.network.security.dao.SecurityGroupVMMapDao;
+import com.cloud.server.ResourceTag.ResourceObjectType;
+import com.cloud.user.Account;
+import com.cloud.vm.UserVmVO;
+import com.cloud.vm.dao.UserVmDao;
+
+import junit.framework.TestCase;
+
+@RunWith(MockitoJUnitRunner.class)
+public class SecurityGroupJoinDaoImplTest extends TestCase {
+
+// Mock private variables.
+@Mock (name = _resourceTagJoinDao)
+private ResourceTagJoinDao _resourceTagJoinDao;
+@Mock (name = _securityGroupVMMapDao)
+private SecurityGroupVMMapDao _securityGroupVMMapDao;
+@Mock (name = _userVmDao)
+private UserVmDao _userVmDao;
+
+// Inject mocks in class to be tested.
+@InjectMocks
+private SecurityGroupJoinDaoImpl _securityGroupJoinDaoImpl;
+
+// Mock a caller and a SecurityGroupJoinVO
+@Mock
+private Account caller;
+@Mock
+private SecurityGroupJoinVO vsg;
+
+// Mock securitygroups
+@Mock
+private SecurityGroupVMMapVO securityGroupVMMapVOone;
+@Mock
+private SecurityGroupVMMapVO securityGroupVMMapVOtwo;
+
+// Mock 2 UserVmVOs
+@Mock
+private UserVmVO userVmVOone;
+@Mock
+private UserVmVO userVmVOtwo;
+
+// Random generated UUIDs
+private final String uuidOne = 463e022a-249d-4212-bdf4-726bc9047aa7;
+private final String uuidTwo = d8714c5f-766f-4b14-bdf4-17571042b9c5;
+
+@Before
+public void setup() {
+MockitoAnnotations.initMocks(this);
+
+// Security group without vms associated.
+ListSecurityGroupVMMapVO securityGroupVmMap_empty = new 
ArrayListSecurityGroupVMMapVO();
+
+// Security group with one vm associated.
+ListSecurityGroupVMMapVO securityGroupVmMap_one = new 
ArrayListSecurityGroupVMMapVO();
+securityGroupVmMap_one.add(securityGroupVMMapVOone);
+
+// 

[2/2] git commit: updated refs/heads/master to aa7f8e5

2015-08-13 Thread widodh
CLOUDSTACK-8133 Added Virtualmachine count and ID's to listSecurityGroups 
response.

See issue CLOUDSTACK-8133 for more information.

Added null check by comment of Koushik Das.

Added brackets by comment of Wido den Hollander.

Removed a call to findById() by comment of Koushik Das.

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/03f48872
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/03f48872
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/03f48872

Branch: refs/heads/master
Commit: 03f48872d602c64bd74c40a2cd93f17acc746236
Parents: 792c27c
Author: Boris Schrijver bo...@pcextreme.nl
Authored: Tue Aug 11 19:01:38 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Thu Aug 13 13:47:38 2015 +0200

--
 .../org/apache/cloudstack/api/ApiConstants.java |  1 +
 .../api/response/SecurityGroupResponse.java | 24 +++--
 .../api/query/dao/SecurityGroupJoinDaoImpl.java | 27 
 3 files changed, 45 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/03f48872/api/src/org/apache/cloudstack/api/ApiConstants.java
--
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java 
b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 0e7ff88..e86e2d4 100644
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -271,6 +271,7 @@ public class ApiConstants {
 public static final String VIRTUAL_MACHINE_ID = virtualmachineid;
 public static final String VIRTUAL_MACHINE_IDS = virtualmachineids;
 public static final String VIRTUAL_MACHINE_ID_IP = vmidipmap;
+public static final String VIRTUAL_MACHINE_COUNT = virtualmachinecount;
 public static final String USAGE_ID = usageid;
 
 public static final String VLAN = vlan;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/03f48872/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
--
diff --git 
a/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java 
b/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
index 0be2ee1..c96421b 100644
--- a/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
@@ -19,14 +19,13 @@ package org.apache.cloudstack.api.response;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
-import com.google.gson.annotations.SerializedName;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.network.security.SecurityGroup;
 import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
 
 @SuppressWarnings(unused)
 @EntityReference(value = SecurityGroup.class)
@@ -76,7 +75,16 @@ public class SecurityGroupResponse extends BaseResponse 
implements ControlledVie
 @Param(description = the list of resource tags associated with the rule, 
responseObject = ResourceTagResponse.class)
 private SetResourceTagResponse tags;
 
+@SerializedName(ApiConstants.VIRTUAL_MACHINE_COUNT)
+@Param(description = the number of virtualmachines associated with this 
securitygroup, since = 4.6.0)
+private Integer virtualMachineCount;
+
+@SerializedName(ApiConstants.VIRTUAL_MACHINE_IDS)
+@Param(description = the list of virtualmachine ids associated with this 
securitygroup, since = 4.6.0)
+private SetString virtualMachineIds;
+
 public SecurityGroupResponse() {
+this.virtualMachineIds = new LinkedHashSetString();
 this.ingressRules = new LinkedHashSetSecurityGroupRuleResponse();
 this.egressRules = new LinkedHashSetSecurityGroupRuleResponse();
 this.tags = new LinkedHashSetResourceTagResponse();
@@ -176,4 +184,16 @@ public class SecurityGroupResponse extends BaseResponse 
implements ControlledVie
 public void addTag(ResourceTagResponse tag) {
 this.tags.add(tag);
 }
+
+public void setVirtualMachineCount(Integer virtualMachineCount) {
+this.virtualMachineCount = virtualMachineCount;
+}
+
+public void setVirtualMachineIds(SetString virtualMachineIds) {
+this.virtualMachineIds = virtualMachineIds;
+}
+
+public void addVirtualMachineId(String virtualMachineId) {
+this.virtualMachineIds.add(virtualMachineId);
+}
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/03f48872/server/src/com/cloud/api/query/dao/SecurityGroupJoinDaoImpl.java

git commit: updated refs/heads/master to a9ace22

2015-08-07 Thread widodh
Repository: cloudstack
Updated Branches:
  refs/heads/master a5e563aa8 - a9ace22fb


CLOUDSTACK-8638: install update_host_passwd.sh in cloudstack-common installation

Signed-off-by: Wido den Hollander w...@widodh.nl

This closes #663


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a9ace22f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a9ace22f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a9ace22f

Branch: refs/heads/master
Commit: a9ace22fbd53fe33b924454de95c93b79a75d3e2
Parents: a5e563a
Author: Wei Zhou w.z...@tech.leaseweb.com
Authored: Thu Aug 6 12:04:28 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Fri Aug 7 15:06:17 2015 +0200

--
 debian/cloudstack-common.install | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a9ace22f/debian/cloudstack-common.install
--
diff --git a/debian/cloudstack-common.install b/debian/cloudstack-common.install
index 01d0957..accc6fa 100644
--- a/debian/cloudstack-common.install
+++ b/debian/cloudstack-common.install
@@ -24,6 +24,7 @@
 /usr/share/cloudstack-common/scripts/vm/systemvm/*
 /usr/share/cloudstack-common/scripts/vm/pingtest.sh
 /usr/share/cloudstack-common/scripts/vm/hypervisor/kvm/*
+/usr/share/cloudstack-common/scripts/vm/hypervisor/update_host_passwd.sh
 /usr/share/cloudstack-common/scripts/vm/hypervisor/versions.sh
 /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/*
 /usr/share/cloudstack-common/lib/*



[10/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8628: Send an alert when fencing a KVM host failed

Also change the logging a bit so that you get useful logs when
not running on DEBUG level

Signed-off-by: Wido den Hollander w...@widodh.nl

This closes #580


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fbe3b04a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fbe3b04a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fbe3b04a

Branch: refs/heads/reporter
Commit: fbe3b04a43ff7380a6874a2c331f372aa59ccf3d
Parents: d1f76a2
Author: Wido den Hollander w...@widodh.nl
Authored: Thu Jul 16 16:15:20 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Fri Jul 17 12:33:11 2015 +0200

--
 server/src/com/cloud/ha/KVMFencer.java  | 26 +++-
 server/test/com/cloud/ha/KVMFencerTest.java | 22 
 2 files changed, 38 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fbe3b04a/server/src/com/cloud/ha/KVMFencer.java
--
diff --git a/server/src/com/cloud/ha/KVMFencer.java 
b/server/src/com/cloud/ha/KVMFencer.java
index 7392dff..b5834ef 100644
--- a/server/src/com/cloud/ha/KVMFencer.java
+++ b/server/src/com/cloud/ha/KVMFencer.java
@@ -26,6 +26,7 @@ import javax.naming.ConfigurationException;
 import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
+import com.cloud.alert.AlertManager;
 import com.cloud.agent.api.FenceAnswer;
 import com.cloud.agent.api.FenceCommand;
 import com.cloud.exception.AgentUnavailableException;
@@ -48,6 +49,8 @@ public class KVMFencer extends AdapterBase implements 
FenceBuilder {
 @Inject
 AgentManager _agentMgr;
 @Inject
+AlertManager _alertMgr;
+@Inject
 ResourceManager _resourceMgr;
 
 @Override
@@ -75,18 +78,22 @@ public class KVMFencer extends AdapterBase implements 
FenceBuilder {
 @Override
 public Boolean fenceOff(VirtualMachine vm, Host host) {
 if (host.getHypervisorType() != HypervisorType.KVM  
host.getHypervisorType() != HypervisorType.LXC) {
-s_logger.debug(Don't know how to fence non kvm hosts  + 
host.getHypervisorType());
+s_logger.warn(Don't know how to fence non kvm hosts  + 
host.getHypervisorType());
 return null;
 }
 
 ListHostVO hosts = 
_resourceMgr.listAllHostsInCluster(host.getClusterId());
 FenceCommand fence = new FenceCommand(vm, host);
 
+int i = 0;
 for (HostVO h : hosts) {
 if (h.getHypervisorType() == HypervisorType.KVM || 
h.getHypervisorType() == HypervisorType.LXC) {
 if (h.getStatus() != Status.Up) {
 continue;
 }
+
+i++;
+
 if (h.getId() == host.getId()) {
 continue;
 }
@@ -94,14 +101,10 @@ public class KVMFencer extends AdapterBase implements 
FenceBuilder {
 try {
 answer = (FenceAnswer)_agentMgr.send(h.getId(), fence);
 } catch (AgentUnavailableException e) {
-if (s_logger.isDebugEnabled()) {
-s_logger.debug(Moving on to the next host because  + 
h.toString() +  is unavailable);
-}
+s_logger.info(Moving on to the next host because  + 
h.toString() +  is unavailable);
 continue;
 } catch (OperationTimedoutException e) {
-if (s_logger.isDebugEnabled()) {
-s_logger.debug(Moving on to the next host because  + 
h.toString() +  is unavailable);
-}
+s_logger.info(Moving on to the next host because  + 
h.toString() +  is unavailable);
 continue;
 }
 if (answer != null  answer.getResult()) {
@@ -110,9 +113,12 @@ public class KVMFencer extends AdapterBase implements 
FenceBuilder {
 }
 }
 
-if (s_logger.isDebugEnabled()) {
-s_logger.debug(Unable to fence off  + vm.toString() +  on  + 
host.toString());
-}
+_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, 
host.getDataCenterId(), host.getPodId(),
+Unable to fence off host:  + host.getId(),
+Fencing off host  + host.getId() +  did not 
succeed after asking  + i +  hosts.  +
+Check Agent logs for more information.);
+
+s_logger.error(Unable to fence off  + vm.toString() +  on  + 
host.toString());
 
 return false;
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fbe3b04a/server/test/com/cloud/ha/KVMFencerTest.java

[03/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8641 - Adding unit tests

- Making sure that the boolean value is false and also that the 
updateHostPassword() method gets called.

Signed-off-by: Rohit Yadav rohit.ya...@shapeblue.com

This closes #596


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/984fafce
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/984fafce
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/984fafce

Branch: refs/heads/reporter
Commit: 984fafce77f4a7831ff1c0f30dd433d28225f490
Parents: c3c8baf
Author: wilderrodrigues wrodrig...@schubergphilis.com
Authored: Thu Jul 16 13:38:54 2015 +0200
Committer: Rohit Yadav rohit.ya...@shapeblue.com
Committed: Thu Jul 16 18:28:27 2015 +0530

--
 .../command/test/UpdateHostPasswordCmdTest.java | 97 
 1 file changed, 97 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/984fafce/api/test/org/apache/cloudstack/api/command/test/UpdateHostPasswordCmdTest.java
--
diff --git 
a/api/test/org/apache/cloudstack/api/command/test/UpdateHostPasswordCmdTest.java
 
b/api/test/org/apache/cloudstack/api/command/test/UpdateHostPasswordCmdTest.java
new file mode 100644
index 000..12f9da3
--- /dev/null
+++ 
b/api/test/org/apache/cloudstack/api/command/test/UpdateHostPasswordCmdTest.java
@@ -0,0 +1,97 @@
+// 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.command.test;
+
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import junit.framework.TestCase;
+
+import org.apache.cloudstack.api.ResponseGenerator;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.resource.ResourceService;
+import com.cloud.server.ManagementService;
+
+public class UpdateHostPasswordCmdTest extends TestCase {
+
+private UpdateHostPasswordCmd updateHostPasswordCmd;
+private ManagementService managementServer;
+private ResourceService resourceService;
+private ResponseGenerator responseGenerator;
+
+@Override
+@Before
+public void setUp() {
+responseGenerator = Mockito.mock(ResponseGenerator.class);
+managementServer = Mockito.mock(ManagementService.class);
+resourceService = Mockito.mock(ResourceService.class);
+updateHostPasswordCmd = new UpdateHostPasswordCmd();
+}
+
+@Test
+public void testExecuteForNullResult() {
+
+updateHostPasswordCmd._mgr = managementServer;
+updateHostPasswordCmd._resourceService = resourceService;
+
+try {
+
Mockito.when(managementServer.updateHostPassword(updateHostPasswordCmd)).thenReturn(false);
+} catch (final InvalidParameterValueException e) {
+fail(e.getMessage());
+} catch (final IllegalArgumentException e) {
+fail(e.getMessage());
+}
+
+try {
+updateHostPasswordCmd.execute();
+} catch (final ServerApiException exception) {
+Assert.assertEquals(Failed to update config, 
exception.getDescription());
+}
+
+assertFalse(The attribute updatePasswdOnHost should be false, but it 
isn't., updateHostPasswordCmd.getUpdatePasswdOnHost());
+verify(managementServer, 
times(1)).updateHostPassword(updateHostPasswordCmd);
+}
+
+@Test
+public void testCreateSuccess() {
+
+updateHostPasswordCmd._mgr = managementServer;
+updateHostPasswordCmd._resourceService = resourceService;
+updateHostPasswordCmd._responseGenerator = responseGenerator;
+
+try {
+
Mockito.when(managementServer.updateHostPassword(updateHostPasswordCmd)).thenReturn(true);
+} catch (final Exception e) {
+fail(Received exception 

[31/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8660 - Formatting test and utility classes

Signed-off-by: wilderrodrigues wrodrig...@schubergphilis.com


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/59d7bc35
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/59d7bc35
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/59d7bc35

Branch: refs/heads/reporter
Commit: 59d7bc3573b713371882b68b0e7a887650ed227a
Parents: 8875d7a
Author: wilderrodrigues wrodrig...@schubergphilis.com
Authored: Wed Jul 22 13:24:44 2015 +0200
Committer: wilderrodrigues wrodrig...@schubergphilis.com
Committed: Thu Jul 23 08:08:45 2015 +0200

--
 utils/src/com/cloud/utils/StringUtils.java  | 128 -
 utils/test/com/cloud/utils/StringUtilsTest.java | 140 +--
 2 files changed, 134 insertions(+), 134 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59d7bc35/utils/src/com/cloud/utils/StringUtils.java
--
diff --git a/utils/src/com/cloud/utils/StringUtils.java 
b/utils/src/com/cloud/utils/StringUtils.java
index 1dc0f9f..d1225c5 100644
--- a/utils/src/com/cloud/utils/StringUtils.java
+++ b/utils/src/com/cloud/utils/StringUtils.java
@@ -36,7 +36,7 @@ public class StringUtils {
 private static Charset preferredACSCharset;
 
 static {
-String preferredCharset = UTF-8;
+final String preferredCharset = UTF-8;
 if (Charset.isSupported(preferredCharset)) {
 preferredACSCharset = Charset.forName(preferredCharset);
 } else {
@@ -48,16 +48,16 @@ public class StringUtils {
 return preferredACSCharset;
 }
 
-public static String join(Iterable? extends Object iterable, String 
delim) {
-StringBuilder sb = new StringBuilder();
+public static String join(final Iterable? extends Object iterable, final 
String delim) {
+final StringBuilder sb = new StringBuilder();
 if (iterable != null) {
-Iterator? extends Object iter = iterable.iterator();
+final Iterator? extends Object iter = iterable.iterator();
 if (iter.hasNext()) {
-Object next = iter.next();
+final Object next = iter.next();
 sb.append(next.toString());
 }
 while (iter.hasNext()) {
-Object next = iter.next();
+final Object next = iter.next();
 sb.append(delim + next.toString());
 }
 }
@@ -68,7 +68,7 @@ public class StringUtils {
 return org.apache.commons.lang.StringUtils.join(components, delimiter);
 }
 
-public static boolean isNotBlank(String str) {
+public static boolean isNotBlank(final String str) {
 if (str != null  str.trim().length()  0) {
 return true;
 }
@@ -78,8 +78,8 @@ public class StringUtils {
 
 public static String cleanupTags(String tags) {
 if (tags != null) {
-String[] tokens = tags.split(,);
-StringBuilder t = new StringBuilder();
+final String[] tokens = tags.split(,);
+final StringBuilder t = new StringBuilder();
 for (int i = 0; i  tokens.length; i++) {
 t.append(tokens[i].trim()).append(,);
 }
@@ -94,11 +94,11 @@ public class StringUtils {
  * @param tags
  * @return List of tags
  */
-public static ListString csvTagsToList(String tags) {
-ListString tagsList = new ArrayListString();
+public static ListString csvTagsToList(final String tags) {
+final ListString tagsList = new ArrayListString();
 
 if (tags != null) {
-String[] tokens = tags.split(,);
+final String[] tokens = tags.split(,);
 for (int i = 0; i  tokens.length; i++) {
 tagsList.add(tokens[i].trim());
 }
@@ -113,8 +113,8 @@ public class StringUtils {
  * @return String containing a comma separated list of tags
  */
 
-public static String listToCsvTags(ListString tagsList) {
-StringBuilder tags = new StringBuilder();
+public static String listToCsvTags(final ListString tagsList) {
+final StringBuilder tags = new StringBuilder();
 if (tagsList.size()  0) {
 for (int i = 0; i  tagsList.size(); i++) {
 tags.append(tagsList.get(i));
@@ -127,12 +127,12 @@ public class StringUtils {
 return tags.toString();
 }
 
-public static String getExceptionStackInfo(Throwable e) {
-StringBuffer sb = new StringBuffer();
+public static String getExceptionStackInfo(final Throwable e) {
+final StringBuffer sb = new StringBuffer();
 
 sb.append(e.toString()).append(\n);
-

[29/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8655: [Browser Based Upload Volume] Partially uploaded volumes are 
not getting destroyed as part of storage GC
As part of volume sync, that runs during of SSVM start-up, the volume_store_ref 
entry was getting deleted. Volume GC relies on this entry to move volume to 
destroyed state.
Since the entry was getting deleted, GC thread never moved the volume from 
UploadError/UploadAbandoned to Destroyed. Fix is to not remove the 
volume_store_ref entry as part
of volume sync and let GC thread handle the clean up.

This closes #611


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ab7c9e40
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ab7c9e40
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ab7c9e40

Branch: refs/heads/reporter
Commit: ab7c9e409826dfe6afca7f9b075920caa6b65c9b
Parents: 2982fcf
Author: Koushik Das kous...@apache.org
Authored: Tue Jul 21 14:28:38 2015 +0530
Committer: Koushik Das kous...@apache.org
Committed: Wed Jul 22 19:05:47 2015 +0530

--
 .../cloudstack/storage/volume/VolumeObject.java |  3 +--
 .../component/test_browse_volumes.py| 28 
 2 files changed, 29 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ab7c9e40/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
--
diff --git 
a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
 
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
index e851870..5bf49a9 100644
--- 
a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
+++ 
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
@@ -333,11 +333,10 @@ public class VolumeObject implements VolumeInfo {
 } finally {
 // in case of OperationFailed, expunge the entry
 if (event == ObjectInDataStoreStateMachine.Event.OperationFailed 
-(volumeVO.getState() != Volume.State.Copying  
volumeVO.getState() != Volume.State.Uploaded)) {
+(volumeVO.getState() != Volume.State.Copying  
volumeVO.getState() != Volume.State.Uploaded  volumeVO.getState() != 
Volume.State.UploadError)) {
 objectInStoreMgr.deleteIfNotReady(this);
 }
 }
-
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ab7c9e40/test/integration/component/test_browse_volumes.py
--
diff --git a/test/integration/component/test_browse_volumes.py 
b/test/integration/component/test_browse_volumes.py
index 4c15351..12aa037 100644
--- a/test/integration/component/test_browse_volumes.py
+++ b/test/integration/component/test_browse_volumes.py
@@ -2678,6 +2678,34 @@ class TestBrowseUploadVolume(cloudstackTestCase):
 return
 
 
+@attr(tags = [advanced, advancedns, smoke, basic], 
required_hardware=false)
+def test_browser_upload_volume_incomplete(self):
+
+Test browser based incomplete volume upload, followed by SSVM destroy. 
Volume should go to UploadAbandoned/Error state and get cleaned up.
+
+try:
+self.debug(= Test browser based 
incomplete volume upload )
+
+#Only register volume, without uploading
+cmd = getUploadParamsForVolume.getUploadParamsForVolumeCmd()
+cmd.zoneid = self.zone.id
+cmd.format = self.uploadvolumeformat
+cmd.name = self.volname + self.account.name + 
(random.choice(string.ascii_uppercase))
+cmd.account = self.account.name
+cmd.domainid = self.domain.id
+upload_volume_response = 
self.apiclient.getUploadParamsForVolume(cmd)
+
+#Destroy SSVM, and wait for new one to start
+self.destroy_ssvm()
+
+#Verify that the volume is cleaned up as part of sync-up during 
new SSVM start
+self.validate_uploaded_volume(upload_volume_response.id, 
'UploadAbandoned')
+
+except Exception as e:
+self.fail(Exceptione occurred  : %s % e)
+return
+
+
 @classmethod
 def tearDownClass(self):
 try:



[49/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8664: Verify if queryAsyncJobResult api return jobinstanceid
This closes #619


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9c9e902e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9c9e902e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9c9e902e

Branch: refs/heads/reporter
Commit: 9c9e902e5ca6e5f5ac5fcb186d28963d5571eb3e
Parents: 31b486d
Author: Priti Sarap priti.sa...@clogeny.com
Authored: Thu Jul 23 15:08:35 2015 +0530
Committer: sanjeev sanj...@apache.org
Committed: Mon Jul 27 12:38:12 2015 +0530

--
 .../testpaths/testpath_queryAsyncJobResult.py   | 133 +++
 1 file changed, 133 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9c9e902e/test/integration/testpaths/testpath_queryAsyncJobResult.py
--
diff --git a/test/integration/testpaths/testpath_queryAsyncJobResult.py 
b/test/integration/testpaths/testpath_queryAsyncJobResult.py
new file mode 100644
index 000..c424965
--- /dev/null
+++ b/test/integration/testpaths/testpath_queryAsyncJobResult.py
@@ -0,0 +1,133 @@
+# 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.
+ Test case to check if queryAsyncJobResult returns jobinstanceid
+
+from nose.plugins.attrib import attr
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.utils import (cleanup_resources)
+from marvin.lib.base import (Account,
+ ServiceOffering,
+ VirtualMachine,
+ )
+from marvin.lib.common import (get_domain,
+   get_zone,
+   get_template,
+   )
+
+from marvin.cloudstackAPI import queryAsyncJobResult
+
+
+class TestJobinstanceid(cloudstackTestCase):
+
+@classmethod
+def setUpClass(cls):
+testClient = super(TestJobinstanceid, cls).getClsTestClient()
+cls.apiclient = testClient.getApiClient()
+cls.testdata = testClient.getParsedTestDataConfig()
+
+cls.hypervisor = cls.testClient.getHypervisorInfo()
+# Get Zone, Domain and templates
+cls.domain = get_domain(cls.apiclient)
+cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
+
+cls.template = get_template(
+cls.apiclient,
+cls.zone.id,
+cls.testdata[ostype])
+
+cls._cleanup = []
+
+try:
+
+# Create an account
+cls.account = Account.create(
+cls.apiclient,
+cls.testdata[account],
+domainid=cls.domain.id
+)
+# Create user api client of the account
+cls.userapiclient = testClient.getUserApiClient(
+UserName=cls.account.name,
+DomainName=cls.account.domain
+)
+
+# Create Service offering
+cls.service_offering = ServiceOffering.create(
+cls.apiclient,
+cls.testdata[service_offering],
+)
+
+cls._cleanup = [
+cls.account,
+cls.service_offering,
+]
+except Exception as e:
+cls.tearDownClass()
+raise e
+return
+
+@classmethod
+def tearDownClass(cls):
+try:
+cleanup_resources(cls.apiclient, cls._cleanup)
+except Exception as e:
+raise Exception(Warning: Exception during cleanup : %s % e)
+
+def setUp(self):
+self.apiclient = self.testClient.getApiClient()
+self.dbclient = self.testClient.getDbConnection()
+self.cleanup = []
+
+def tearDown(self):
+try:
+cleanup_resources(self.apiclient, self.cleanup)
+except Exception as e:
+raise Exception(Warning: Exception during cleanup : %s % e)
+return
+
+@attr(tags=[advanced, basic], required_hardware=false)
+def 

[28/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
reverting gmaven version to 1.3

the changes in commit ec32ea30f7b3e5351e661786955d9fa0929047bd changed
gmaven version in ldap plugin which broke running the spock tests from
command line. Hence reverting the change until we fix it with
the new version.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d42173a1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d42173a1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d42173a1

Branch: refs/heads/reporter
Commit: d42173a1a31043cf88909434a82f641a5fc36bf3
Parents: 4e57cc6
Author: Rajani Karuturi rajanikarut...@gmail.com
Authored: Wed Jul 22 16:31:28 2015 +0530
Committer: Rajani Karuturi rajanikarut...@gmail.com
Committed: Wed Jul 22 16:31:28 2015 +0530

--
 plugins/user-authenticators/ldap/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42173a1/plugins/user-authenticators/ldap/pom.xml
--
diff --git a/plugins/user-authenticators/ldap/pom.xml 
b/plugins/user-authenticators/ldap/pom.xml
index d24a5be..22cdeb7 100644
--- a/plugins/user-authenticators/ldap/pom.xml
+++ b/plugins/user-authenticators/ldap/pom.xml
@@ -24,7 +24,7 @@
   plugin
 groupIdorg.codehaus.gmaven/groupId
 artifactIdgmaven-plugin/artifactId
-version1.5/version
+version1.3/version
 configuration
   providerSelection1.7/providerSelection
 /configuration



[07/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8581: Make the code which initiates the S3TO object more readable

All arguments are now on a own line which makes the code easier to read

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4b61f5a1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4b61f5a1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4b61f5a1

Branch: refs/heads/reporter
Commit: 4b61f5a17abbaed8bb412a1c5190147fdd60526c
Parents: 178a9f5
Author: Wido den Hollander w...@widodh.nl
Authored: Tue Jul 14 13:58:34 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Fri Jul 17 10:07:04 2015 +0200

--
 .../driver/S3ImageStoreDriverImpl.java  | 24 
 1 file changed, 14 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b61f5a1/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
--
diff --git 
a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
 
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
index 8705892..2d723f4 100644
--- 
a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
+++ 
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
@@ -54,16 +54,20 @@ public class S3ImageStoreDriverImpl extends 
BaseImageStoreDriverImpl {
 public DataStoreTO getStoreTO(DataStore store) {
 ImageStoreImpl imgStore = (ImageStoreImpl)store;
 MapString, String details = 
_imageStoreDetailsDao.getDetails(imgStore.getId());
-return new S3TO(imgStore.getId(), imgStore.getUuid(), 
details.get(ApiConstants.S3_ACCESS_KEY), 
details.get(ApiConstants.S3_SECRET_KEY),
-details.get(ApiConstants.S3_END_POINT), 
details.get(ApiConstants.S3_BUCKET_NAME), 
details.get(ApiConstants.S3_HTTPS_FLAG) == null ? false
-: 
Boolean.parseBoolean(details.get(ApiConstants.S3_HTTPS_FLAG)), 
details.get(ApiConstants.S3_CONNECTION_TIMEOUT) == null ? null
-: 
Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TIMEOUT)), 
details.get(ApiConstants.S3_MAX_ERROR_RETRY) == null ? null
-: 
Integer.valueOf(details.get(ApiConstants.S3_MAX_ERROR_RETRY)), 
details.get(ApiConstants.S3_SOCKET_TIMEOUT) == null ? null
-: 
Integer.valueOf(details.get(ApiConstants.S3_SOCKET_TIMEOUT)), 
imgStore.getCreated(), _configDao.getValue(Config.S3EnableRRS.toString()) == 
null ? false
-: 
Boolean.parseBoolean(_configDao.getValue(Config.S3EnableRRS.toString())), 
getMaxSingleUploadSizeInBytes(),
-details.get(ApiConstants.S3_CONNECTION_TTL) == null ? null : 
Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TTL)),
-details.get(ApiConstants.S3_USE_TCP_KEEPALIVE) == null ? null 
: Boolean.parseBoolean(details.get(ApiConstants.S3_USE_TCP_KEEPALIVE)));
-
+return new S3TO(imgStore.getId(),
+imgStore.getUuid(),
+details.get(ApiConstants.S3_ACCESS_KEY),
+details.get(ApiConstants.S3_SECRET_KEY),
+details.get(ApiConstants.S3_END_POINT), 
details.get(ApiConstants.S3_BUCKET_NAME),
+details.get(ApiConstants.S3_HTTPS_FLAG) == null ? 
false : Boolean.parseBoolean(details.get(ApiConstants.S3_HTTPS_FLAG)),
+details.get(ApiConstants.S3_CONNECTION_TIMEOUT) == 
null ? null : Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TIMEOUT)),
+details.get(ApiConstants.S3_MAX_ERROR_RETRY) == null ? 
null : Integer.valueOf(details.get(ApiConstants.S3_MAX_ERROR_RETRY)),
+details.get(ApiConstants.S3_SOCKET_TIMEOUT) == null ? 
null : Integer.valueOf(details.get(ApiConstants.S3_SOCKET_TIMEOUT)),
+imgStore.getCreated(),
+_configDao.getValue(Config.S3EnableRRS.toString()) == 
null ? false : 
Boolean.parseBoolean(_configDao.getValue(Config.S3EnableRRS.toString())),
+getMaxSingleUploadSizeInBytes(),
+details.get(ApiConstants.S3_CONNECTION_TTL) == null ? 
null : Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TTL)),
+details.get(ApiConstants.S3_USE_TCP_KEEPALIVE) == null 
? null : Boolean.parseBoolean(details.get(ApiConstants.S3_USE_TCP_KEEPALIVE)));
 }
 
 private long getMaxSingleUploadSizeInBytes() {



[42/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
fixed finbugs issue due to PR #609

applicationCtx need not be static as the bean is singleton

This closes #622


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ac9c2a22
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ac9c2a22
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ac9c2a22

Branch: refs/heads/reporter
Commit: ac9c2a224a78f413945e25fd7cf23364fbef00b5
Parents: 090db05
Author: Rajani Karuturi rajanikarut...@gmail.com
Authored: Fri Jul 24 14:52:53 2015 +0530
Committer: Rajani Karuturi rajanikarut...@gmail.com
Committed: Fri Jul 24 17:42:21 2015 +0530

--
 .../src/org/apache/cloudstack/ldap/LdapUserManagerFactory.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac9c2a22/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManagerFactory.java
--
diff --git 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManagerFactory.java
 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManagerFactory.java
index b7414c7..f796ce2 100644
--- 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManagerFactory.java
+++ 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManagerFactory.java
@@ -34,7 +34,7 @@ public class LdapUserManagerFactory implements 
ApplicationContextAware {
 
 private static MapLdapUserManager.Provider, LdapUserManager 
ldapUserManagerMap = new HashMap();
 
-static ApplicationContext applicationCtx;
+private ApplicationContext applicationCtx;
 
 public LdapUserManager getInstance(LdapUserManager.Provider provider) {
 LdapUserManager ldapUserManager;
@@ -46,7 +46,7 @@ public class LdapUserManagerFactory implements 
ApplicationContextAware {
 ldapUserManagerMap.put(LdapUserManager.Provider.MICROSOFTAD, 
ldapUserManager);
 }
 } else {
-//defaults to opendldap
+//defaults to openldap
 ldapUserManager = 
ldapUserManagerMap.get(LdapUserManager.Provider.OPENLDAP);
 if (ldapUserManager == null) {
 ldapUserManager = new OpenLdapUserManagerImpl();



[38/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
Fixed Coverity issue Dereference null return value

added a not null check and a CloudRuntimeException in case of null

Signed-off-by: Rajani Karuturi rajanikarut...@gmail.com

This closes #617


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1f09b8c3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1f09b8c3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1f09b8c3

Branch: refs/heads/reporter
Commit: 1f09b8c3bfdfee559d1735c8796daae16bf19e74
Parents: d8f37c5
Author: Maneesha P maneesha.papireddyg...@citrix.com
Authored: Thu Jul 23 00:45:00 2015 +0530
Committer: Rajani Karuturi rajanikarut...@gmail.com
Committed: Thu Jul 23 15:46:17 2015 +0530

--
 .../wrapper/LibvirtBackupSnapshotCommandWrapper.java | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f09b8c3/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
--
diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
index 25da046..ad33945 100644
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
+++ 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
@@ -171,7 +171,11 @@ public final class LibvirtBackupSnapshotCommandWrapper 
extends CommandWrapperBa
 final String snapshot = snapshotXML.format(args);
 s_logger.debug(snapshot);
 final DomainSnapshot snap = 
vm.snapshotLookupByName(snapshotName);
-snap.delete(0);
+if (snap != null) {
+snap.delete(0);
+} else {
+throw new CloudRuntimeException(Unable to find vm 
snapshot with name - + snapshotName);
+}
 
 /*
  * libvirt on RHEL6 doesn't handle resume event emitted from
@@ -203,4 +207,4 @@ public final class LibvirtBackupSnapshotCommandWrapper 
extends CommandWrapperBa
 }
 return new BackupSnapshotAnswer(command, true, null, snapshotRelPath + 
File.separator + snapshotName, true);
 }
-}
\ No newline at end of file
+}



[45/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
BUG-ID: CLOUDSTACK-8483 - Private template not visible in project added new 
'projectId' parameter in createTemplate command and based current user, account 
and projectid decide the owner of the template.

Signed-off-by: Pierre-Luc Dion pdion...@apache.org


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f8ef13c5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f8ef13c5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f8ef13c5

Branch: refs/heads/reporter
Commit: f8ef13c5e6fe833c923dbcda9d0e61381ded3de5
Parents: 9dbc99c
Author: Sudhansu sudhansu.s...@citrix.com
Authored: Fri Mar 13 17:48:47 2015 +0530
Committer: Pierre-Luc Dion pdion...@apache.org
Committed: Sun Jul 26 10:27:48 2015 -0400

--
 .../user/template/CreateTemplateCmd.java| 50 
 1 file changed, 31 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8ef13c5/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
--
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
index 7be7e62..ae9205f 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
@@ -20,6 +20,14 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.cloudstack.acl.SecurityChecker;
+import org.apache.cloudstack.api.response.GuestOSResponse;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.TemplateResponse;
+import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
+
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
@@ -30,11 +38,6 @@ import org.apache.cloudstack.api.BaseAsyncCreateCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
 import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.GuestOSResponse;
-import org.apache.cloudstack.api.response.SnapshotResponse;
-import org.apache.cloudstack.api.response.TemplateResponse;
-import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.context.CallContext;
 
 import com.cloud.event.EventTypes;
@@ -124,6 +127,9 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd {
description = true if template contains XS/VMWare tools 
inorder to support dynamic scaling of VM cpu/memory)
 protected Boolean isDynamicallyScalable;
 
+@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, 
entityType = ProjectResponse.class, description = create template for the 
project)
+private Long projectId;
+
 // ///
 // / Accessors ///
 // ///
@@ -215,33 +221,39 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd 
{
 if (volumeId != null) {
 Volume volume = _entityMgr.findById(Volume.class, volumeId);
 if (volume != null) {
-accountId = volume.getAccountId();
+
_accountService.checkAccess(CallContext.current().getCallingAccount(), 
SecurityChecker.AccessType.UseEntry, false, volume);
 } else {
 throw new InvalidParameterValueException(Unable to find 
volume by id= + volumeId);
 }
 } else {
 Snapshot snapshot = _entityMgr.findById(Snapshot.class, 
snapshotId);
 if (snapshot != null) {
-accountId = snapshot.getAccountId();
+
_accountService.checkAccess(CallContext.current().getCallingAccount(), 
SecurityChecker.AccessType.UseEntry, false, snapshot);
 } else {
 throw new InvalidParameterValueException(Unable to find 
snapshot by id= + snapshotId);
 }
 }
 
-Account account = _accountService.getAccount(accountId);
-//Can create templates for enabled projects/accounts only
-if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
-Project project = 
_projectService.findByProjectAccountId(accountId);
-if (project.getState() != Project.State.Active) {
-PermissionDeniedException ex =
-new 

[40/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
Merge branch 'CLOUDSTACK-8596' of https://github.com/karuturi/cloudstack

This closes #609


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7febdb58
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7febdb58
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7febdb58

Branch: refs/heads/reporter
Commit: 7febdb58b53123d5b4efbdbf2fe44a3df5cf5b9d
Parents: 2984acc 96cf032
Author: Rajani Karuturi rajanikarut...@gmail.com
Authored: Fri Jul 24 10:59:15 2015 +0530
Committer: Rajani Karuturi rajanikarut...@gmail.com
Committed: Fri Jul 24 10:59:15 2015 +0530

--
 plugins/user-authenticators/ldap/pom.xml|   2 +-
 .../cloudstack/ldap/spring-ldap-context.xml |   2 +-
 .../cloudstack/ldap/ADLdapUserManagerImpl.java  |  82 +
 .../cloudstack/ldap/LdapConfiguration.java  |  25 +-
 .../apache/cloudstack/ldap/LdapManagerImpl.java |  19 +-
 .../apache/cloudstack/ldap/LdapUserManager.java | 239 ++---
 .../cloudstack/ldap/LdapUserManagerFactory.java |  64 
 .../ldap/OpenLdapUserManagerImpl.java   | 233 +
 .../ldap/ADLdapUserManagerImplSpec.groovy   |  70 
 .../ldap/LdapConfigurationSpec.groovy   | 100 --
 .../ldap/LdapCreateAccountCmdSpec.groovy|   2 +-
 .../cloudstack/ldap/LdapManagerImplSpec.groovy  | 110 --
 .../ldap/LdapUserManagerFactorySpec.groovy  |  57 
 .../cloudstack/ldap/LdapUserManagerSpec.groovy  | 336 --
 .../ldap/OpenLdapUserManagerSpec.groovy | 337 +++
 15 files changed, 1056 insertions(+), 622 deletions(-)
--




[37/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8596 addressed review comments

In LdapUserManagerFactory moved the beans to a map
used a Enum for LdapProvider and made the corresponding changes in
LdapConfiguration and the callers.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/96cf0325
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/96cf0325
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/96cf0325

Branch: refs/heads/reporter
Commit: 96cf0325e2b9542c18fde6f2c4f7191e6406cdb6
Parents: d42173a
Author: Rajani Karuturi rajanikarut...@gmail.com
Authored: Thu Jul 23 15:21:59 2015 +0530
Committer: Rajani Karuturi rajanikarut...@gmail.com
Committed: Thu Jul 23 15:21:59 2015 +0530

--
 .../cloudstack/ldap/ADLdapUserManagerImpl.java  | 15 
 .../cloudstack/ldap/LdapConfiguration.java  | 11 +-
 .../apache/cloudstack/ldap/LdapUserManager.java |  4 +++
 .../cloudstack/ldap/LdapUserManagerFactory.java | 37 
 .../ldap/LdapConfigurationSpec.groovy   |  6 ++--
 .../ldap/LdapUserManagerFactorySpec.groovy  |  5 +--
 6 files changed, 52 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96cf0325/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/ADLdapUserManagerImpl.java
--
diff --git 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/ADLdapUserManagerImpl.java
 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/ADLdapUserManagerImpl.java
index e5e20c5..50f1fa0 100644
--- 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/ADLdapUserManagerImpl.java
+++ 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/ADLdapUserManagerImpl.java
@@ -32,21 +32,22 @@ import org.apache.log4j.Logger;
 
 public class ADLdapUserManagerImpl extends OpenLdapUserManagerImpl implements 
LdapUserManager {
 public static final Logger s_logger = 
Logger.getLogger(ADLdapUserManagerImpl.class.getName());
+private static final String MICROSOFT_AD_NESTED_MEMBERS_FILTER = 
memberOf:1.2.840.113556.1.4.1941;
 
 @Override
 public ListLdapUser getUsersInGroup(String groupName, LdapContext 
context) throws NamingException {
-final SearchControls searchControls = new SearchControls();
-searchControls.setSearchScope(_ldapConfiguration.getScope());
-
searchControls.setReturningAttributes(_ldapConfiguration.getReturnAttributes());
+if (StringUtils.isBlank(groupName)) {
+throw new IllegalArgumentException(ldap group name cannot be 
blank);
+}
 
 String basedn = _ldapConfiguration.getBaseDn();
 if (StringUtils.isBlank(basedn)) {
 throw new IllegalArgumentException(ldap basedn is not 
configured);
 }
 
-if (StringUtils.isBlank(groupName)) {
-throw new IllegalArgumentException(ldap group name cannot be 
blank);
-}
+final SearchControls searchControls = new SearchControls();
+searchControls.setSearchScope(_ldapConfiguration.getScope());
+
searchControls.setReturningAttributes(_ldapConfiguration.getReturnAttributes());
 
 NamingEnumerationSearchResult results = context.search(basedn, 
generateADGroupSearchFilter(groupName), searchControls);
 final ListLdapUser users = new ArrayListLdapUser();
@@ -65,7 +66,7 @@ public class ADLdapUserManagerImpl extends 
OpenLdapUserManagerImpl implements Ld
 
 final StringBuilder memberOfFilter = new StringBuilder();
 String groupCnName =  _ldapConfiguration.getCommonNameAttribute() + 
= +groupName + , +  _ldapConfiguration.getBaseDn();
-memberOfFilter.append((memberOf:1.2.840.113556.1.4.1941:=);
+memberOfFilter.append(( + MICROSOFT_AD_NESTED_MEMBERS_FILTER + :=);
 memberOfFilter.append(groupCnName);
 memberOfFilter.append());
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96cf0325/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
--
diff --git 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
index f247f40..a64899a 100644
--- 
a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
+++ 
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
@@ -167,7 +167,16 @@ public class LdapConfiguration implements Configurable{
 return ldapPageSize.value();
 }
 
-public String getLdapProvider() { return ldapProvider.value();}
+public LdapUserManager.Provider 

[08/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8581: S3, make connection TTL and TCP KeepAlive configureable

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/178a9f55
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/178a9f55
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/178a9f55

Branch: refs/heads/reporter
Commit: 178a9f555d9ba44ecee68cbcdfd89cd10a08f43f
Parents: b1e5906
Author: Wido den Hollander w...@widodh.nl
Authored: Tue Jul 14 08:17:49 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Fri Jul 17 10:07:04 2015 +0200

--
 api/src/com/cloud/agent/api/to/S3TO.java| 34 +++-
 .../org/apache/cloudstack/api/ApiConstants.java |  2 ++
 .../api/command/admin/storage/AddS3Cmd.java | 31 ++
 .../driver/S3ImageStoreDriverImpl.java  |  4 ++-
 utils/src/com/cloud/utils/S3Utils.java  | 17 --
 5 files changed, 84 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/178a9f55/api/src/com/cloud/agent/api/to/S3TO.java
--
diff --git a/api/src/com/cloud/agent/api/to/S3TO.java 
b/api/src/com/cloud/agent/api/to/S3TO.java
index 346dd62..a46d609 100644
--- a/api/src/com/cloud/agent/api/to/S3TO.java
+++ b/api/src/com/cloud/agent/api/to/S3TO.java
@@ -34,9 +34,11 @@ public final class S3TO implements S3Utils.ClientOptions, 
DataStoreTO {
 private String endPoint;
 private String bucketName;
 private Boolean httpsFlag;
+private Boolean useTCPKeepAlive;
 private Integer connectionTimeout;
 private Integer maxErrorRetry;
 private Integer socketTimeout;
+private Integer connectionTtl;
 private Date created;
 private boolean enableRRS;
 private long maxSingleUploadSizeInBytes;
@@ -50,7 +52,7 @@ public final class S3TO implements S3Utils.ClientOptions, 
DataStoreTO {
 
 public S3TO(final Long id, final String uuid, final String accessKey, 
final String secretKey, final String endPoint, final String bucketName,
 final Boolean httpsFlag, final Integer connectionTimeout, final 
Integer maxErrorRetry, final Integer socketTimeout, final Date created,
-final boolean enableRRS, final long maxUploadSize) {
+final boolean enableRRS, final long maxUploadSize, final Integer 
connectionTtl, final Boolean useTCPKeepAlive) {
 
 super();
 
@@ -67,6 +69,8 @@ public final class S3TO implements S3Utils.ClientOptions, 
DataStoreTO {
 this.created = created;
 this.enableRRS = enableRRS;
 this.maxSingleUploadSizeInBytes = maxUploadSize;
+this.connectionTtl = connectionTtl;
+this.useTCPKeepAlive = useTCPKeepAlive;
 
 }
 
@@ -118,6 +122,14 @@ public final class S3TO implements S3Utils.ClientOptions, 
DataStoreTO {
 return false;
 }
 
+if (connectionTtl != null ? 
!connectionTtl.equals(thatS3TO.connectionTtl) : thatS3TO.connectionTtl != null) 
{
+return false;
+}
+
+if (useTCPKeepAlive != null ? 
!useTCPKeepAlive.equals(thatS3TO.useTCPKeepAlive) : thatS3TO.useTCPKeepAlive != 
null) {
+return false;
+}
+
 if (bucketName != null ? !bucketName.equals(thatS3TO.bucketName) : 
thatS3TO.bucketName != null) {
 return false;
 }
@@ -147,6 +159,8 @@ public final class S3TO implements S3Utils.ClientOptions, 
DataStoreTO {
 result = 31 * result + (connectionTimeout != null ? 
connectionTimeout.hashCode() : 0);
 result = 31 * result + (maxErrorRetry != null ? 
maxErrorRetry.hashCode() : 0);
 result = 31 * result + (socketTimeout != null ? 
socketTimeout.hashCode() : 0);
+result = 31 * result + (connectionTtl != null ? 
connectionTtl.hashCode() : 0);
+result = 31 * result + (useTCPKeepAlive ? 1 : 0);
 
 return result;
 
@@ -245,6 +259,24 @@ public final class S3TO implements S3Utils.ClientOptions, 
DataStoreTO {
 this.socketTimeout = socketTimeout;
 }
 
+@Override
+public Integer getConnectionTtl() {
+return this.connectionTtl;
+}
+
+public void setConnectionTtl(final Integer connectionTtl) {
+this.connectionTtl = connectionTtl;
+}
+
+@Override
+public Boolean getUseTCPKeepAlive() {
+return this.useTCPKeepAlive;
+}
+
+public void setUseTCPKeepAlive(final Boolean useTCPKeepAlive) {
+this.useTCPKeepAlive = useTCPKeepAlive;
+}
+
 public Date getCreated() {
 return this.created;
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/178a9f55/api/src/org/apache/cloudstack/api/ApiConstants.java

[11/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8628: kvm: Disable Fencing when no NFS storage pools are present

On NFS we write a heartbeat, but without those we can not safely
fence off a host.

If we fence without knowing about a heartbeat we can cause a split-brain 
situation.

Signed-off-by: Wido den Hollander w...@widodh.nl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d1f76a2a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d1f76a2a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d1f76a2a

Branch: refs/heads/reporter
Commit: d1f76a2a84c531a73285630c4f6283dc17143f82
Parents: 8d96aab
Author: Wido den Hollander w...@widodh.nl
Authored: Mon Jul 13 17:26:00 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Fri Jul 17 12:33:11 2015 +0200

--
 .../resource/wrapper/LibvirtFenceCommandWrapper.java| 12 
 1 file changed, 12 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d1f76a2a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
--
diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
index 8fdf46b..cb313df 100644
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
+++ 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
@@ -48,6 +48,18 @@ public final class LibvirtFenceCommandWrapper extends 
CommandWrapperFenceComman
 final KVMHAMonitor monitor = libvirtComputingResource.getMonitor();
 
 final ListNfsStoragePool pools = monitor.getStoragePools();
+
+/**
+ * We can only safely fence off hosts when we use NFS
+ * On NFS primary storage pools hosts continuesly write
+ * a heartbeat. Disable Fencing Off for hosts without NFS
+ */
+if (pools.size() == 0) {
+String logline = No NFS storage pools found. No way to safely 
fence  + command.getVmName() +  on host  + command.getHostGuid();
+s_logger.warn(logline);
+return new FenceAnswer(command, false, logline);
+}
+
 final KVMHAChecker ha = new KVMHAChecker(pools, command.getHostIp());
 
 final FutureBoolean future = executors.submit(ha);



[44/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8648: Pass the proper storage layer when configuring

Signed-off-by: Pierre-Luc Dion pdion...@apache.org


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9dbc99c6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9dbc99c6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9dbc99c6

Branch: refs/heads/reporter
Commit: 9dbc99c6083ac833045713403f794bf3506065b1
Parents: 554f5f9
Author: Wido den Hollander w...@widodh.nl
Authored: Thu Jul 23 23:39:02 2015 +0200
Committer: Pierre-Luc Dion pdion...@apache.org
Committed: Sun Jul 26 10:25:06 2015 -0400

--
 .../cloudstack/storage/resource/NfsSecondaryStorageResource.java  | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9dbc99c6/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
--
diff --git 
a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
 
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index 5c361ed..be59691 100644
--- 
a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ 
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -860,6 +860,9 @@ public class NfsSecondaryStorageResource extends 
ServerResourceBase implements S
 return file.length();
 }
 
+MapString, Object params = new HashMapString, Object();
+params.put(StorageLayer.InstanceConfigKey, _storage);
+processor.configure(template processor, params);
 return processor.getVirtualSize(file);
 } catch (Exception e) {
 s_logger.warn(Failed to get virtual size of file  + 
file.getPath() + , returning file size instead: , e);



[50/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
Proposal of a Usage Reporter / call-home functionality for CloudStack

With this commit the Management Server will be default generate a anonymous 
Usage
report every 7 (seven) days and submit this information back to the Apache 
CloudStack project.

These anonymous reports do NOT contain any information about Instance names, 
subnets, etc. It only
contains numbers about how CloudStack is being used.

This information is vital for the project to gain more insight in how 
CloudStack is being used.

Users can turn the reporting off by setting usage.report.interval to 0 (zero)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3e1816df
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3e1816df
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3e1816df

Branch: refs/heads/reporter
Commit: 3e1816df98946b45903e058819ba63325c54e0ee
Parents: 9c9e902
Author: Wido den Hollander w...@widodh.nl
Authored: Wed Jul 8 21:17:30 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Mon Jul 27 10:42:12 2015 +0200

--
 .../src/com/cloud/upgrade/dao/VersionDao.java   |   4 +
 .../com/cloud/upgrade/dao/VersionDaoImpl.java   |   9 +
 pom.xml |   1 +
 reporter/README.md  |  18 +
 reporter/usage-report-collector.py  |  64 +++
 server/pom.xml  |  10 +
 .../spring-server-core-managers-context.xml |   2 +
 server/src/com/cloud/configuration/Config.java  |   5 +-
 .../cloudstack/report/AtomicGsonAdapter.java|  48 ++
 .../apache/cloudstack/report/UsageReporter.java | 470 +++
 setup/db/db/schema-452to460.sql |   2 +
 11 files changed, 632 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e1816df/engine/schema/src/com/cloud/upgrade/dao/VersionDao.java
--
diff --git a/engine/schema/src/com/cloud/upgrade/dao/VersionDao.java 
b/engine/schema/src/com/cloud/upgrade/dao/VersionDao.java
index e280e0b..1a60f36 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/VersionDao.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/VersionDao.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.upgrade.dao;
 
+import java.util.List;
+
 import com.cloud.upgrade.dao.VersionVO.Step;
 import com.cloud.utils.db.GenericDao;
 
@@ -23,4 +25,6 @@ public interface VersionDao extends GenericDaoVersionVO, 
Long {
 VersionVO findByVersion(String version, Step step);
 
 String getCurrentVersion();
+
+ListVersionVO getAllVersions();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e1816df/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java 
b/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java
index 0fb2dfe..3422a43 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/VersionDaoImpl.java
@@ -154,4 +154,13 @@ public class VersionDaoImpl extends 
GenericDaoBaseVersionVO, Long implements V
 }
 
 }
+
+@Override
+@DB
+public ListVersionVO getAllVersions() {
+SearchCriteriaVersionVO sc = AllFieldsSearch.create();
+sc.setParameters(step, Complete);
+
+return listBy(sc);
+}
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e1816df/pom.xml
--
diff --git a/pom.xml b/pom.xml
index e76d747..0511e91 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,6 +64,7 @@
 cs.ehcache.version2.6.9/cs.ehcache.version
 cs.gson.version1.7.2/cs.gson.version
 cs.guava-testlib.version18.0/cs.guava-testlib.version
+cs.gson.version2.3.1/cs.gson.version
 cs.guava.version18.0/cs.guava.version
 cs.xapi.version6.2.0-3.1/cs.xapi.version
 cs.httpclient.version4.3.6/cs.httpclient.version

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e1816df/reporter/README.md
--
diff --git a/reporter/README.md b/reporter/README.md
new file mode 100644
index 000..6453fa4
--- /dev/null
+++ b/reporter/README.md
@@ -0,0 +1,18 @@
+# CloudStack Usage Report
+
+This directory contains the CloudStack reporter webservice used by the Apache 
CloudStack project
+to gather anonymous statistical information about CloudStack deployments.
+
+Since version FIX ME!! the management server sends out a anonymized Usage 
Report out to the
+project every 7 days.
+
+This information is used to gain information about how CloudStack is being 
used.
+
+Turning this 

[23/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8639:fixing calculation mistakes in 
component/test_ss_domain_limits.py
This closes #595


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b4006081
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b4006081
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b4006081

Branch: refs/heads/reporter
Commit: b4006081623a447c172f77008d44678aac49adc8
Parents: faaf6b1
Author: nitt10prashant nitt10.prash...@gmail.com
Authored: Wed Jul 15 18:33:00 2015 +0530
Committer: sanjeev sanj...@apache.org
Committed: Mon Jul 20 14:41:52 2015 +0530

--
 test/integration/component/test_ss_domain_limits.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b4006081/test/integration/component/test_ss_domain_limits.py
--
diff --git a/test/integration/component/test_ss_domain_limits.py 
b/test/integration/component/test_ss_domain_limits.py
index 2591d2f..0d9138a 100644
--- a/test/integration/component/test_ss_domain_limits.py
+++ b/test/integration/component/test_ss_domain_limits.py
@@ -559,7 +559,9 @@ class TestDeleteAccount(cloudstackTestCase):
 self.assertFalse(result[0], result[1])
 self.assertTrue(result[2], Resource count does not match)
 
-expectedCount *= 2
+self.templateSize = int((int(templates[0].size)*2) / (1024**3))
+
+expectedCount = self.templateSize
 result = isDomainResourceCountEqualToExpectedCount(
 self.apiclient, self.parent_domain.id,
 expectedCount, RESOURCE_SECONDARY_STORAGE)



[15/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
coverity 1116711: findLostHost trivial try-with-resource inserted

Signed-off-by: Daan Hoogland d...@onecht.net


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4f1eb8d6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4f1eb8d6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4f1eb8d6

Branch: refs/heads/reporter
Commit: 4f1eb8d6dd3eb03fe67162f448334e7e61bf19ce
Parents: e92e800
Author: Daan Hoogland d...@onecht.net
Authored: Thu Jul 16 16:29:06 2015 +0200
Committer: Daan Hoogland d...@onecht.net
Committed: Fri Jul 17 13:22:42 2015 +0200

--
 .../src/com/cloud/host/dao/HostDaoImpl.java | 31 +++-
 1 file changed, 10 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4f1eb8d6/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java 
b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
index f1567ee..8342f1f 100644
--- a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
+++ b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
@@ -740,32 +740,21 @@ public class HostDaoImpl extends GenericDaoBaseHostVO, 
Long implements HostDao
 @DB
 @Override
 public ListHostVO findLostHosts(long timeout) {
-TransactionLegacy txn = TransactionLegacy.currentTxn();
-PreparedStatement pstmt = null;
 ListHostVO result = new ArrayListHostVO();
-ResultSet rs = null;
-try {
-String sql =
+String sql =
 select h.id from host h left join  cluster c on 
h.cluster_id=c.id where h.mgmt_server_id is not null and h.last_ping  ? and 
h.status in ('Up', 'Updating', 'Disconnected', 'Connecting') and h.type not in 
('ExternalFirewall', 'ExternalLoadBalancer', 'TrafficMonitor', 
'SecondaryStorage', 'LocalSecondaryStorage', 'L2Networking') and (h.cluster_id 
is null or c.managed_state = 'Managed') ;;
-pstmt = txn.prepareStatement(sql);
+try (
+TransactionLegacy txn = TransactionLegacy.currentTxn();
+PreparedStatement pstmt = txn.prepareStatement(sql);) {
 pstmt.setLong(1, timeout);
-rs = pstmt.executeQuery();
-while (rs.next()) {
-long id = rs.getLong(1); //ID column
-result.add(findById(id));
-}
-} catch (Exception e) {
-s_logger.warn(Exception: , e);
-} finally {
-try {
-if (rs != null) {
-rs.close();
-}
-if (pstmt != null) {
-pstmt.close();
+try (ResultSet rs = pstmt.executeQuery();) {
+while (rs.next()) {
+long id = rs.getLong(1); //ID column
+result.add(findById(id));
 }
-} catch (SQLException e) {
 }
+} catch (SQLException e) {
+s_logger.warn(Exception: , e);
 }
 return result;
 }



[39/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8580 Users are now able to view, expunge and recover their vm's 
themselves. Two configuration options are added to allow this behaviour on a 
global or per account scale. Configuration options default to false.

Signed-off-by: wilderrodrigues wrodrig...@schubergphilis.com

This closes #593


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2984acca
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2984acca
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2984acca

Branch: refs/heads/reporter
Commit: 2984acca83fff03c2ad8bdd28c097e797d4ce087
Parents: 1f09b8c
Author: Boris Schrijver bo...@pcextreme.nl
Authored: Wed Jul 15 11:04:32 2015 +0200
Committer: wilderrodrigues wrodrig...@schubergphilis.com
Committed: Thu Jul 23 13:59:44 2015 +0200

--
 .../api/command/user/vm/DestroyVMCmd.java|  4 ++--
 .../apache/cloudstack/query/QueryService.java|  5 +
 client/tomcatconf/commands.properties.in |  4 ++--
 .../com/cloud/api/query/QueryManagerImpl.java| 17 ++---
 server/src/com/cloud/vm/UserVmManager.java   |  3 +++
 server/src/com/cloud/vm/UserVmManagerImpl.java   | 19 +--
 6 files changed, 39 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2984acca/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
--
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java 
b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
index 3de0e4f..f23e03a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
@@ -40,7 +40,7 @@ import com.cloud.user.Account;
 import com.cloud.uservm.UserVm;
 import com.cloud.vm.VirtualMachine;
 
-@APICommand(name = destroyVirtualMachine, description = Destroys a virtual 
machine. Once destroyed, only the administrator can recover it., 
responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, 
entityType = {VirtualMachine.class},
+@APICommand(name = destroyVirtualMachine, description = Destroys a virtual 
machine., responseObject = UserVmResponse.class, responseView = 
ResponseView.Restricted, entityType = {VirtualMachine.class},
 requestHasSensitiveInfo = false,
 responseHasSensitiveInfo = true)
 public class DestroyVMCmd extends BaseAsyncCmd {
@@ -59,7 +59,7 @@ public class DestroyVMCmd extends BaseAsyncCmd {
 
 @Parameter(name = ApiConstants.EXPUNGE,
type = CommandType.BOOLEAN,
-   description = If true is passed, the vm is expunged 
immediately. False by default. Parameter can be passed to the call by 
ROOT/Domain admin only,
+   description = If true is passed, the vm is expunged 
immediately. False by default.,
since = 4.2.1)
 private Boolean expunge;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2984acca/api/src/org/apache/cloudstack/query/QueryService.java
--
diff --git a/api/src/org/apache/cloudstack/query/QueryService.java 
b/api/src/org/apache/cloudstack/query/QueryService.java
index 0cf05a6..1a5ac11 100644
--- a/api/src/org/apache/cloudstack/query/QueryService.java
+++ b/api/src/org/apache/cloudstack/query/QueryService.java
@@ -71,6 +71,7 @@ import org.apache.cloudstack.api.response.UserResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.framework.config.ConfigKey;
 
 import com.cloud.exception.PermissionDeniedException;
 
@@ -80,6 +81,10 @@ import com.cloud.exception.PermissionDeniedException;
  */
 public interface QueryService {
 
+// Config keys
+static final ConfigKeyBoolean AllowUserViewDestroyedVM = new 
ConfigKeyBoolean(Advanced, Boolean.class, allow.user.view.destroyed.vm, 
false,
+Determines whether users can view their destroyed or expunging vm 
, true, ConfigKey.Scope.Account);
+
 ListResponseUserResponse searchForUsers(ListUsersCmd cmd) throws 
PermissionDeniedException;
 
 ListResponseEventResponse searchForEvents(ListEventsCmd cmd);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2984acca/client/tomcatconf/commands.properties.in
--
diff --git a/client/tomcatconf/commands.properties.in 
b/client/tomcatconf/commands.properties.in
index 29752c6..c32ecc4 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -82,8 

[05/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8642: SSO Method not allowed bug fix. Due to CLOUDSTACK-8505 and 
commit 1c81b241e7914b24b06c3b7b3ee98bc0d3b4f68b

Signed-off-by: Daan Hoogland d...@onecht.net

This closes #598


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b1e59069
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b1e59069
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b1e59069

Branch: refs/heads/reporter
Commit: b1e5906923512d3fe8470382277a85d82cb131c4
Parents: 984fafc
Author: Boris Schrijver bo...@pcextreme.nl
Authored: Thu Jul 16 14:44:52 2015 +0200
Committer: Daan Hoogland d...@onecht.net
Committed: Thu Jul 16 17:00:05 2015 +0200

--
 ui/scripts/cloud.core.callbacks.js | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b1e59069/ui/scripts/cloud.core.callbacks.js
--
diff --git a/ui/scripts/cloud.core.callbacks.js 
b/ui/scripts/cloud.core.callbacks.js
index a32d068..3ae6d09 100644
--- a/ui/scripts/cloud.core.callbacks.js
+++ b/ui/scripts/cloud.core.callbacks.js
@@ -65,6 +65,7 @@ $(document).ready(function() {
 if (url != undefined  url != null  url.length  0) {
 url = unescape(clientApiUrl + ? + url);
 $.ajax({
+type: 'POST',
 url: url,
 dataType: json,
 async: false,



[06/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8581: Do not make attributes final and don't set them to null

Signed-off-by: Wido den Hollander w...@widodh.nl

This closes #582


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8d96aab9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8d96aab9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8d96aab9

Branch: refs/heads/reporter
Commit: 8d96aab9b2ee32038d43d13b3d85c6a0c7729ee6
Parents: 4b61f5a
Author: Wido den Hollander w...@widodh.nl
Authored: Thu Jul 16 18:13:46 2015 +0200
Committer: Wido den Hollander w...@widodh.nl
Committed: Fri Jul 17 10:07:04 2015 +0200

--
 .../api/command/admin/storage/AddS3Cmd.java   | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d96aab9/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java
--
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java
index 09272a5..d54cb75 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java
@@ -68,28 +68,28 @@ public final class AddS3Cmd extends BaseCmd {
 private String secretKey;
 
 @Parameter(name = S3_END_POINT, type = STRING, required = false, 
description = S3 host name)
-private final String endPoint = null;
+private String endPoint;
 
 @Parameter(name = S3_BUCKET_NAME, type = STRING, required = true, 
description = name of the template storage bucket)
 private String bucketName;
 
 @Parameter(name = S3_HTTPS_FLAG, type = BOOLEAN, required = false, 
description = connect to the S3 endpoint via HTTPS?)
-private final Boolean httpsFlag = null;
+private Boolean httpsFlag;
 
 @Parameter(name = S3_CONNECTION_TIMEOUT, type = INTEGER, required = false, 
description = connection timeout (milliseconds))
-private final Integer connectionTimeout = null;
+private Integer connectionTimeout;
 
 @Parameter(name = S3_MAX_ERROR_RETRY, type = INTEGER, required = false, 
description = maximum number of times to retry on error)
-private final Integer maxErrorRetry = null;
+private Integer maxErrorRetry;
 
 @Parameter(name = S3_SOCKET_TIMEOUT, type = INTEGER, required = false, 
description = socket timeout (milliseconds))
-private final Integer socketTimeout = null;
+private Integer socketTimeout;
 
 @Parameter(name = S3_CONNECTION_TTL, type = INTEGER, required = false, 
description = connection ttl (milliseconds))
-private final Integer connectionTtl = null;
+private Integer connectionTtl;
 
 @Parameter(name = S3_USE_TCP_KEEPALIVE, type = BOOLEAN, required = false, 
description = whether tcp keepalive is used)
-private final Boolean useTCPKeepAlive = null;
+private Boolean useTCPKeepAlive;
 
 @Override
 public void execute() throws ResourceUnavailableException, 
InsufficientCapacityException, ServerApiException, ConcurrentOperationException,



[47/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8634: Made changes to test_security_group.py test suite to support 
EIP

Signed-off-by: Pierre-Luc Dion pdion...@apache.org


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7f7026ac
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7f7026ac
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7f7026ac

Branch: refs/heads/reporter
Commit: 7f7026ace59d96e7d38270ec4a2fe1a7076d0e87
Parents: fd17e47
Author: sanjeev sanj...@apache.org
Authored: Tue Jul 14 17:24:58 2015 +0530
Committer: Pierre-Luc Dion pdion...@apache.org
Committed: Sun Jul 26 10:39:15 2015 -0400

--
 .../component/test_security_groups.py   | 243 ---
 1 file changed, 157 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f7026ac/test/integration/component/test_security_groups.py
--
diff --git a/test/integration/component/test_security_groups.py 
b/test/integration/component/test_security_groups.py
index f132e3a..f1ac0b6 100755
--- a/test/integration/component/test_security_groups.py
+++ b/test/integration/component/test_security_groups.py
@@ -27,7 +27,8 @@ from marvin.lib.base import (Account,
  VirtualMachine,
  SecurityGroup,
  Router,
- Host)
+ Host,
+ Network)
 from marvin.lib.common import (get_domain,
get_zone,
get_template,
@@ -528,6 +529,12 @@ class TestRevokeIngressRule(cloudstackTestCase):
 
 return
 
+def revokeSGRule(self, sgid):
+cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd()
+cmd.id = sgid
+self.apiclient.revokeSecurityGroupIngress(cmd)
+return
+
 @attr(tags=[sg, eip, advancedsg])
 def test_01_revokeIngressRule(self):
 Test revoke ingress rule
@@ -605,11 +612,21 @@ class TestRevokeIngressRule(cloudstackTestCase):
 
 self.debug(Revoking ingress rule for sec group ID: %s for ssh access
% security_group.id)
-# Revoke Security group to SSH to VM
-security_group.revoke(
+security_groups = SecurityGroup.list(
 self.apiclient,
-id=ssh_rule[ruleid]
+account=self.account.name,
+domainid=self.account.domainid,
+listall=True
+)
+self.assertEqual(
+validateList(security_groups)[0],
+PASS,
+Security groups list validation failed
 )
+for sg in security_groups:
+if not sg.ingressrule:
+continue
+self.revokeSGRule(sg.ingressrule[0].ruleid)
 
 # SSH Attempt to VM should fail
 with self.assertRaises(Exception):
@@ -617,7 +634,8 @@ class TestRevokeIngressRule(cloudstackTestCase):
 SshClient(self.virtual_machine.ssh_ip,
   self.virtual_machine.ssh_port,
   self.virtual_machine.username,
-  self.virtual_machine.password
+  self.virtual_machine.password,
+  retries=5
   )
 return
 
@@ -1490,32 +1508,45 @@ class TestIngressRule(cloudstackTestCase):
 security_group.id,
 self.account.name
 ))
-result = security_group.revoke(
+#skip revoke and ping tests in case of EIP/ELB zone
+vm_res = VirtualMachine.list(
 self.apiclient,
-id=icmp_rule[ruleid]
+id=self.virtual_machine.id
 )
-self.debug(Revoke ingress rule result: %s % result)
-time.sleep(self.testdata[sleep])
-# User should not be able to ping VM
-try:
-self.debug(Trying to ping VM %s % self.virtual_machine.ssh_ip)
-if platform_type == 'windows':
-result = subprocess.call(
-['ping', '-n', '1', self.virtual_machine.ssh_ip])
-else:
-result = subprocess.call(
-['ping', '-c 1', self.virtual_machine.ssh_ip])
-
-self.debug(Ping result: %s % result)
-# if ping successful, then result should be 0
-self.assertNotEqual(
-result,
-0,
-Check if ping is successful or not
+self.assertEqual(validateList(vm_res)[0], PASS, invalid vm response)
+vm_nw = Network.list(
+self.apiclient,
+id=vm_res[0].nic[0].networkid
+)
+self.assertEqual(validateList(vm_nw)[0], PASS, invalid network 
response)

[20/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8632: Unable to revert snapshot on XenServer


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/538d6630
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/538d6630
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/538d6630

Branch: refs/heads/reporter
Commit: 538d6630db1395a320b5d539aa06dd77e6e76da9
Parents: 4ef40e2
Author: Gaurav Aradhye gaurav.arad...@clogeny.com
Authored: Wed Jul 15 11:15:47 2015 +0530
Committer: sanjeev sanj...@apache.org
Committed: Mon Jul 20 12:28:29 2015 +0530

--
 .../testpaths/testpath_revert_snap.py   | 160 +++
 1 file changed, 160 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/538d6630/test/integration/testpaths/testpath_revert_snap.py
--
diff --git a/test/integration/testpaths/testpath_revert_snap.py 
b/test/integration/testpaths/testpath_revert_snap.py
new file mode 100644
index 000..0c14360
--- /dev/null
+++ b/test/integration/testpaths/testpath_revert_snap.py
@@ -0,0 +1,160 @@
+# 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.
+ Test cases for Verifying revert snapshot 
+
+from nose.plugins.attrib import attr
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.utils import (cleanup_resources,
+ validateList)
+from marvin.lib.base import (Account,
+ ServiceOffering,
+ Snapshot,
+ VmSnapshot,
+ VirtualMachine,
+ )
+from marvin.lib.common import (get_domain,
+   get_zone,
+   get_template,
+   list_volumes,
+  )
+
+
+class TestUnableToRevertSnapshot(cloudstackTestCase):
+
+@classmethod
+def setUpClass(cls):
+testClient = super(TestUnableToRevertSnapshot, cls).getClsTestClient()
+cls.apiclient = testClient.getApiClient()
+cls.testdata = testClient.getParsedTestDataConfig()
+
+cls.hypervisor = cls.testClient.getHypervisorInfo()
+# Get Zone, Domain and templates
+cls.domain = get_domain(cls.apiclient)
+cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
+
+cls.template = get_template(
+cls.apiclient,
+cls.zone.id,
+cls.testdata[ostype])
+
+cls._cleanup = []
+
+try:
+
+cls.skiptest = False
+
+if cls.hypervisor.lower() not in ['xenserver']:
+cls.skiptest = True
+return 
+# Create an account
+cls.account = Account.create(
+cls.apiclient,
+cls.testdata[account],
+domainid=cls.domain.id
+)
+
+# Create user api client of the account
+cls.userapiclient = testClient.getUserApiClient(
+UserName=cls.account.name,
+DomainName=cls.account.domain
+)
+# Create Service offering
+cls.service_offering = ServiceOffering.create(
+cls.apiclient,
+cls.testdata[service_offering],
+)
+
+cls._cleanup = [
+cls.account,
+cls.service_offering,
+]
+except Exception as e:
+cls.tearDownClass()
+raise e
+return
+
+@classmethod
+def tearDownClass(cls):
+try:
+cleanup_resources(cls.apiclient, cls._cleanup)
+except Exception as e:
+raise Exception(Warning: Exception during cleanup : %s % e)
+
+def setUp(self):
+self.apiclient = self.testClient.getApiClient()
+self.dbclient = self.testClient.getDbConnection()
+self.cleanup = []
+if self.skiptest:
+self.skipTest(This test is to be checked on xenserver only  
Hence, skip for 

[41/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8666: Put host in Alert state only after alert.wait timeout
Instead of putting the host to Alert state immediately, the investigators 
should be allowed to run for some time based on alert.wait global config.
At the end of this interval if the host state still cannot be determined then 
put the host in Alert. Also updated some of the log messages.

This closes #621


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/090db058
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/090db058
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/090db058

Branch: refs/heads/reporter
Commit: 090db05821a100ead24dee90658d5b0a863a8682
Parents: 7febdb5
Author: Koushik Das kous...@apache.org
Authored: Thu Jul 23 17:57:51 2015 +0530
Committer: Koushik Das kous...@apache.org
Committed: Fri Jul 24 12:16:07 2015 +0530

--
 .../cloud/agent/manager/AgentManagerImpl.java   | 32 +++-
 .../cloud/ha/HighAvailabilityManagerImpl.java   |  2 +-
 2 files changed, 19 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/090db058/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
--
diff --git 
a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java 
b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
index 64aaf48..a38fd08 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -824,25 +824,30 @@ public class AgentManagerImpl extends ManagerBase 
implements AgentManager, Handl
 /* OK, we are going to the bad status, let's see what happened 
*/
 s_logger.info(Investigating why host  + hostId +  has 
disconnected with event  + event);
 
-final Status determinedState = investigate(attache);
+Status determinedState = investigate(attache);
 // if state cannot be determined do nothing and bail out
 if (determinedState == null) {
-s_logger.warn(Agent state cannot be determined, do 
nothing);
-return false;
+if (((System.currentTimeMillis()  10) - 
host.getLastPinged())  AlertWait.value()) {
+s_logger.warn(Agent  + hostId +  state cannot be 
determined for more than  + AlertWait + ( + AlertWait.value() + ) seconds, 
will go to Alert state);
+determinedState = Status.Alert;
+} else {
+s_logger.warn(Agent  + hostId +  state cannot be 
determined, do nothing);
+return false;
+}
 }
 
 final Status currentStatus = host.getStatus();
-s_logger.info(The state determined is  + determinedState);
+s_logger.info(The agent  + hostId +  state determined is  
+ determinedState);
 
 if (determinedState == Status.Down) {
-s_logger.error(Host is down:  + host.getId() + - + 
host.getName() + .  Starting HA on the VMs);
+String message = Host is down:  + host.getId() + - + 
host.getName() + . Starting HA on the VMs;
+s_logger.error(message);
 if (host.getType() != Host.Type.SecondaryStorage  
host.getType() != Host.Type.ConsoleProxy) {
-
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, 
host.getDataCenterId(), host.getPodId(), Host disconnected,  + host.getId(),
-Host is down:  + host.getId() + - + 
host.getName() + .  Starting HA on the VMs);
+
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, 
host.getDataCenterId(), host.getPodId(), Host down,  + host.getId(), message);
 }
 event = Status.Event.HostDown;
 } else if (determinedState == Status.Up) {
-/* Got ping response from host, bring it back*/
+/* Got ping response from host, bring it back */
 s_logger.info(Agent is determined to be up and running);
 agentStatusTransitTo(host, Status.Event.Ping, _nodeId);
 return false;
@@ -850,10 +855,10 @@ public class AgentManagerImpl extends ManagerBase 
implements AgentManager, Handl
 s_logger.warn(Agent is disconnected but the host is still 
up:  + host.getId() + - + host.getName());
 if (currentStatus == Status.Disconnected) {
 if ((System.currentTimeMillis()  10) - 
host.getLastPinged()  

[16/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
coverity 1116696: iprange adding code cleaned

Signed-off-by: Daan Hoogland d...@onecht.net


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e92e8009
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e92e8009
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e92e8009

Branch: refs/heads/reporter
Commit: e92e800930c66ed14a3f3623ac394e4d7410da58
Parents: f15eaec
Author: Daan Hoogland d...@onecht.net
Authored: Thu Jul 16 16:21:00 2015 +0200
Committer: Daan Hoogland d...@onecht.net
Committed: Fri Jul 17 13:22:42 2015 +0200

--
 .../dc/dao/DataCenterIpAddressDaoImpl.java  | 23 ++--
 1 file changed, 11 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e92e8009/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
--
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java 
b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
index 9bc373f..ca79eed 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
@@ -116,7 +116,6 @@ public class DataCenterIpAddressDaoImpl extends 
GenericDaoBaseDataCenterIpAddre
 String insertSql = INSERT INTO `cloud`.`op_dc_ip_address_alloc` 
(ip_address, data_center_id, pod_id, mac_address)  +
 VALUES (?, ?, ?, (select mac_address from `cloud`.`data_center` 
where id=?));
 String updateSql = UPDATE `cloud`.`data_center` set mac_address = 
mac_address+1 where id=?;
-PreparedStatement stmt = null;
 
 long startIP = NetUtils.ip2Long(start);
 long endIP = NetUtils.ip2Long(end);
@@ -125,17 +124,17 @@ public class DataCenterIpAddressDaoImpl extends 
GenericDaoBaseDataCenterIpAddre
 txn.start();
 
 while (startIP = endIP) {
-stmt = txn.prepareStatement(insertSql);
-stmt.setString(1, NetUtils.long2Ip(startIP++));
-stmt.setLong(2, dcId);
-stmt.setLong(3, podId);
-stmt.setLong(4, dcId);
-stmt.executeUpdate();
-stmt.close();
-stmt = txn.prepareStatement(updateSql);
-stmt.setLong(1, dcId);
-stmt.executeUpdate();
-stmt.close();
+try(PreparedStatement insertPstmt = 
txn.prepareStatement(insertSql);) {
+insertPstmt.setString(1, NetUtils.long2Ip(startIP++));
+insertPstmt.setLong(2, dcId);
+insertPstmt.setLong(3, podId);
+insertPstmt.setLong(4, dcId);
+insertPstmt.executeUpdate();
+}
+try(PreparedStatement updatePstmt = 
txn.prepareStatement(updateSql);) {
+updatePstmt.setLong(1, dcId);
+updatePstmt.executeUpdate();
+}
 }
 txn.commit();
 } catch (SQLException ex) {



[35/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8650: Fix securitygroups ingress FW for protocol any and 0.0.0.0/0

Change way 0.0.0.0/0 + all is handles, as per feedback in Slack channel

Signed-off-by: wilderrodrigues wrodrig...@schubergphilis.com


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4705d75d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4705d75d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4705d75d

Branch: refs/heads/reporter
Commit: 4705d75d4a7fd58def45ec3e70ed5118e0334cf7
Parents: 2e79c62
Author: Frank Louwers fr...@openminds.be
Authored: Fri Jul 17 15:33:07 2015 +0200
Committer: wilderrodrigues wrodrig...@schubergphilis.com
Committed: Thu Jul 23 08:36:05 2015 +0200

--
 scripts/vm/network/security_group.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4705d75d/scripts/vm/network/security_group.py
--
diff --git a/scripts/vm/network/security_group.py 
b/scripts/vm/network/security_group.py
index 7279518..c4a6753 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -860,8 +860,10 @@ def add_network_rules(vm_name, vm_id, vm_ip, signature, 
seqno, vmMac, rules, vif
 for ip in ips:
 execute(iptables -I  + vmchain +  -p icmp --icmp-type  
+ range +   + direction +   + ip +  -j + action)
 
-if allow_any and protocol != 'all':
-if protocol != 'icmp':
+if allow_any
+if protocol == 'all':
+execute(iptables -I  + vmchain +  -m state --state NEW  + 
direction +  0.0.0.0/0 -j +action)
+elif protocol != 'icmp':
 execute(iptables -I  + vmchain +  -p  + protocol +  -m  
+ protocol +  --dport  + range +  -m state --state NEW -j + action)
 else:
 range = start + / + end



[46/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
BUG-ID: CLOUDSTACK-8483 - Private template not visible in project added new 
'projectId' parameter in createTemplate command and based current user, account 
and projectid decide the owner of the template.

Signed-off-by: Pierre-Luc Dion pdion...@apache.org


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fd17e47e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fd17e47e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fd17e47e

Branch: refs/heads/reporter
Commit: fd17e47e152f161d4d5a66b102dc8832c8858607
Parents: f8ef13c
Author: Sudhansu sudhansu.s...@citrix.com
Authored: Fri Mar 13 17:48:47 2015 +0530
Committer: Pierre-Luc Dion pdion...@apache.org
Committed: Sun Jul 26 10:27:48 2015 -0400

--
 .../api/command/user/template/CreateTemplateCmd.java  | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fd17e47e/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
--
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
index ae9205f..c8d6ce3 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
@@ -217,18 +217,18 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd 
{
 public long getEntityOwnerId() {
 Long volumeId = getVolumeId();
 Long snapshotId = getSnapshotId();
-Long accountId = null;
+Account callingAccount = CallContext.current().getCallingAccount();
 if (volumeId != null) {
 Volume volume = _entityMgr.findById(Volume.class, volumeId);
 if (volume != null) {
-
_accountService.checkAccess(CallContext.current().getCallingAccount(), 
SecurityChecker.AccessType.UseEntry, false, volume);
+_accountService.checkAccess(callingAccount, 
SecurityChecker.AccessType.UseEntry, false, volume);
 } else {
 throw new InvalidParameterValueException(Unable to find 
volume by id= + volumeId);
 }
 } else {
 Snapshot snapshot = _entityMgr.findById(Snapshot.class, 
snapshotId);
 if (snapshot != null) {
-
_accountService.checkAccess(CallContext.current().getCallingAccount(), 
SecurityChecker.AccessType.UseEntry, false, snapshot);
+_accountService.checkAccess(callingAccount, 
SecurityChecker.AccessType.UseEntry, false, snapshot);
 } else {
 throw new InvalidParameterValueException(Unable to find 
snapshot by id= + snapshotId);
 }
@@ -239,7 +239,7 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd {
 if (project != null) {
 if (project.getState() == Project.State.Active) {
 Account projectAccount= 
_accountService.getAccount(project.getProjectAccountId());
-
_accountService.checkAccess(CallContext.current().getCallingAccount(), 
SecurityChecker.AccessType.UseEntry, false, projectAccount);
+_accountService.checkAccess(callingAccount, 
SecurityChecker.AccessType.UseEntry, false, projectAccount);
 return project.getProjectAccountId();
 } else {
 final PermissionDeniedException ex =
@@ -253,7 +253,7 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd {
 }
 }
 
-return CallContext.current().getCallingAccount().getId();
+return callingAccount.getId();
 }
 
 @Override



[36/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
Sorry about the typo

Signed-off-by: wilderrodrigues wrodrig...@schubergphilis.com

This closes #601


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d8f37c5e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d8f37c5e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d8f37c5e

Branch: refs/heads/reporter
Commit: d8f37c5e173f90a35864ca5186ed045e9f0adaff
Parents: 4705d75
Author: Frank Louwers fr...@openminds.be
Authored: Wed Jul 22 17:15:32 2015 +0200
Committer: wilderrodrigues wrodrig...@schubergphilis.com
Committed: Thu Jul 23 08:36:05 2015 +0200

--
 scripts/vm/network/security_group.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d8f37c5e/scripts/vm/network/security_group.py
--
diff --git a/scripts/vm/network/security_group.py 
b/scripts/vm/network/security_group.py
index c4a6753..31984d2 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -860,7 +860,7 @@ def add_network_rules(vm_name, vm_id, vm_ip, signature, 
seqno, vmMac, rules, vif
 for ip in ips:
 execute(iptables -I  + vmchain +  -p icmp --icmp-type  
+ range +   + direction +   + ip +  -j + action)
 
-if allow_any
+if allow_any:
 if protocol == 'all':
 execute(iptables -I  + vmchain +  -m state --state NEW  + 
direction +  0.0.0.0/0 -j +action)
 elif protocol != 'icmp':



[22/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
CLOUDSTACK-8636: Verify failure of creation of Custom disk offering with 
disksize parameter -Modified list validation of volume list
This closes #590


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/faaf6b1f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/faaf6b1f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/faaf6b1f

Branch: refs/heads/reporter
Commit: faaf6b1f9891ad073ed69345d69b727a463fbca7
Parents: 837486a
Author: Priti Sarap priti.sa...@clogeny.com
Authored: Wed Jul 15 14:12:10 2015 +0530
Committer: sanjeev sanj...@apache.org
Committed: Mon Jul 20 12:29:05 2015 +0530

--
 test/integration/testpaths/testpath_revert_snap.py | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/faaf6b1f/test/integration/testpaths/testpath_revert_snap.py
--
diff --git a/test/integration/testpaths/testpath_revert_snap.py 
b/test/integration/testpaths/testpath_revert_snap.py
index 11db8c5..8026f34 100644
--- a/test/integration/testpaths/testpath_revert_snap.py
+++ b/test/integration/testpaths/testpath_revert_snap.py
@@ -31,6 +31,7 @@ from marvin.lib.common import (get_domain,
get_template,
list_volumes,
   )
+from marvin.codes import PASS
 
 class TestUnableToRevertSnapshot(cloudstackTestCase):
 
@@ -118,7 +119,6 @@ class TestUnableToRevertSnapshot(cloudstackTestCase):
 
 
 # Step 1
-# Create VM on cluster wide
 vm = VirtualMachine.create(
 self.userapiclient,
 self.testdata[small],
@@ -137,11 +137,13 @@ class TestUnableToRevertSnapshot(cloudstackTestCase):
 
 volume_list_validation = validateList(volumes_cluster_list)
 
-self.assertNotEqual(
-len(volume_list_validation),
-0,
-Check if volume gets attached properly
+   self.assertEqual(
+volume_list_validation[0],
+PASS,
+Event list validation failed due to %s %
+   volume_list_validation[2]
 )
+ 
 root_volume = volumes_cluster_list[0]
 
 #Step 2



[48/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d

2015-07-27 Thread widodh
dummy commit to close PR: close #620, close #606, close #334, close #586


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/31b486d3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/31b486d3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/31b486d3

Branch: refs/heads/reporter
Commit: 31b486d38aa300dc39e50ca3294d6d6fa21a08f5
Parents: 7f7026a
Author: Pierre-Luc Dion pdion...@apache.org
Authored: Sun Jul 26 10:40:50 2015 -0400
Committer: Pierre-Luc Dion pdion...@apache.org
Committed: Sun Jul 26 10:40:50 2015 -0400

--
 CONTRIBUTING.md | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31b486d3/CONTRIBUTING.md
--
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 95d7a85..c4ad197 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -105,4 +105,3 @@ $ git checkout master
 $ git branch -D feature_x
 $ git push origin :feature_x
 ```
-



  1   2   3   4   5   6   7   8   9   10   >