Skip to content

Commit 801e526

Browse files
committed
Merge branch 'master' into vim51_win8
2 parents bcaac32 + 6f19895 commit 801e526

31 files changed

Lines changed: 890 additions & 179 deletions

File tree

server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java renamed to api/src/com/cloud/agent/api/ScaleVmAnswer.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,15 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package com.cloud.vm.dao;
17+
package com.cloud.agent.api;
1818

19+
public class ScaleVmAnswer extends Answer {
1920

20-
import javax.ejb.Local;
21-
22-
import org.apache.log4j.Logger;
23-
import org.springframework.context.annotation.Primary;
24-
import org.springframework.stereotype.Component;
25-
26-
@Local(value = { UserVmDao.class })
27-
public class RandomlyIncreasingVMInstanceDaoImpl extends UserVmDaoImpl {
28-
29-
public static final Logger s_logger = Logger.getLogger(RandomlyIncreasingVMInstanceDaoImpl.class);
30-
31-
@Override
32-
public <K> K getNextInSequence(final Class<K> clazz, final String name) {
33-
return getRandomlyIncreasingNextInSequence(clazz, name);
21+
protected ScaleVmAnswer() {
3422
}
3523

24+
public ScaleVmAnswer(ScaleVmCommand cmd, boolean result, String detail) {
25+
super(cmd, result, detail);
26+
}
27+
3628
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.agent.api;
18+
19+
import com.cloud.agent.api.to.VirtualMachineTO;
20+
21+
public class ScaleVmCommand extends Command {
22+
23+
VirtualMachineTO vm;
24+
String vmName;
25+
int cpus;
26+
Integer speed;
27+
long minRam;
28+
long maxRam;
29+
30+
public VirtualMachineTO getVm() {
31+
return vm;
32+
}
33+
34+
public void setVm(VirtualMachineTO vm) {
35+
this.vm = vm;
36+
}
37+
38+
public int getCpus() {
39+
return cpus;
40+
}
41+
42+
public ScaleVmCommand(String vmName, int cpus,
43+
Integer speed, long minRam, long maxRam) {
44+
super();
45+
this.vmName = vmName;
46+
this.cpus = cpus;
47+
//this.speed = speed;
48+
this.minRam = minRam;
49+
this.maxRam = maxRam;
50+
this.vm = new VirtualMachineTO(1L, vmName, null, cpus, null, minRam, maxRam, null, null, false, false, null);
51+
/*vm.setName(vmName);
52+
vm.setCpus(cpus);
53+
vm.setRam(minRam, maxRam);*/
54+
}
55+
56+
public void setCpus(int cpus) {
57+
this.cpus = cpus;
58+
}
59+
60+
public Integer getSpeed() {
61+
return speed;
62+
}
63+
64+
public void setSpeed(Integer speed) {
65+
this.speed = speed;
66+
}
67+
68+
public long getMinRam() {
69+
return minRam;
70+
}
71+
72+
public void setMinRam(long minRam) {
73+
this.minRam = minRam;
74+
}
75+
76+
public long getMaxRam() {
77+
return maxRam;
78+
}
79+
80+
public void setMaxRam(long maxRam) {
81+
this.maxRam = maxRam;
82+
}
83+
84+
public String getVmName() {
85+
return vmName;
86+
}
87+
88+
public void setVmName(String vmName) {
89+
this.vmName = vmName;
90+
}
91+
92+
public VirtualMachineTO getVirtualMachine() {
93+
return vm;
94+
}
95+
96+
@Override
97+
public boolean executeInSequence() {
98+
return true;
99+
}
100+
101+
protected ScaleVmCommand() {
102+
}
103+
104+
public ScaleVmCommand(VirtualMachineTO vm) {
105+
this.vm = vm;
106+
}
107+
108+
public boolean getLimitCpuUse() {
109+
// TODO Auto-generated method stub
110+
return false;
111+
}
112+
113+
}

‎api/src/org/apache/cloudstack/api/ACL.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@
2222
import java.lang.annotation.RetentionPolicy;
2323
import java.lang.annotation.Target;
2424

25+
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
26+
2527
@Retention(RetentionPolicy.RUNTIME)
2628
@Target({ FIELD })
2729
public @interface ACL {
2830

31+
AccessType accessType() default AccessType.ListEntry;
32+
2933
boolean checkKeyAccess() default false;
3034
boolean checkValueAccess() default false;
3135
}

‎api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.List;
2525
import java.util.Map;
2626

27+
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
2728
import org.apache.cloudstack.api.ACL;
2829
import org.apache.cloudstack.api.APICommand;
2930
import org.apache.cloudstack.api.ApiConstants;
@@ -53,7 +54,6 @@
5354
import com.cloud.exception.ResourceAllocationException;
5455
import com.cloud.exception.ResourceUnavailableException;
5556
import com.cloud.hypervisor.Hypervisor.HypervisorType;
56-
import com.cloud.network.IpAddress;
5757
import com.cloud.network.Network;
5858
import com.cloud.network.Network.IpAddresses;
5959
import com.cloud.offering.DiskOffering;
@@ -103,7 +103,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
103103
private Long domainId;
104104

105105
//Network information
106-
@ACL
106+
@ACL(accessType = AccessType.UseNetwork)
107107
@Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.UUID, entityType=NetworkResponse.class,
108108
description="list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter")
109109
private List<Long> networkIds;

‎client/WEB-INF/web.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<context-param>
2424
<param-name>log4jConfigLocation</param-name>
25-
<param-value>/WEB-INF/classes/log4j-cloud.xml</param-value>
25+
<param-value>classpath:log4j-cloud.xml</param-value>
2626
</context-param>
2727
<listener>
2828
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>

‎client/tomcatconf/classpath.conf.in‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818

19-
# We use WEB-INF/lib in the webapp for including things into
20-
# the classpath nowdays
21-
22-
for jar in /usr/share/tomcat6/lib/*.jar; do
23-
CLASSPATH=$jar:$CLASSPATH
19+
SYSTEMJARS="@SYSTEMJARS@"
20+
SCP=$(build-classpath $SYSTEMJARS 2>/dev/null) ; if [ $? != 0 ] ; then export SCP="@SYSTEMCLASSPATH@" ; fi
21+
MCP="@MSCLASSPATH@"
22+
DCP="@DEPSCLASSPATH@"
23+
CLASSPATH=$SCP:$DCP:$MCP:@MSCONF@:@SETUPDATADIR@
24+
for jarfile in "@PREMIUMJAVADIR@"/* ; do
25+
if [ ! -e "$jarfile" ] ; then continue ; fi
26+
CLASSPATH=$jarfile:$CLASSPATH
27+
done
28+
for plugin in "@PLUGINJAVADIR@"/* ; do
29+
if [ ! -e "$plugin" ] ; then continue ; fi
30+
CLASSPATH=$plugin:$CLASSPATH
31+
done
32+
for vendorconf in "@MSCONF@"/vendor/* ; do
33+
if [ ! -d "$vendorconf" ] ; then continue ; fi
34+
CLASSPATH=$vendorconf:$CLASSPATH
2435
done
25-
CLASSPATH=${CLASSPATH}/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/mysql-connector-java-5.1.21.jar
2636
export CLASSPATH
37+
PATH=/sbin:/usr/sbin:$PATH
38+
export PATH

‎client/tomcatconf/componentContext.xml.in‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.ConsoleProxyManagerImpl" />
4949
<bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
5050
<bean id="premiumSecondaryStorageManagerImpl" class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl" />
51-
<!-- <bean id="randomlyIncreasingVMInstanceDaoImpl" class="com.cloud.vm.dao.RandomlyIncreasingVMInstanceDaoImpl" /> -->
5251
<bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
5352
<bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
5453

‎client/tomcatconf/nonossComponentContext.xml.in‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
<bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.ConsoleProxyManagerImpl" />
5050
<bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
5151
<bean id="premiumSecondaryStorageManagerImpl" class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl" />
52-
<!-- <bean id="randomlyIncreasingVMInstanceDaoImpl" class="com.cloud.vm.dao.RandomlyIncreasingVMInstanceDaoImpl" /> -->
5352
<bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
5453

5554
<bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
@@ -123,13 +122,14 @@
123122
<!--
124123
Storage pool allocators
125124
-->
126-
<bean id="LocalStoragePoolAllocator" class="com.cloud.storage.allocator.LocalStoragePoolAllocator">
125+
<bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
127126
<property name="name" value="LocalStorage"/>
128127
</bean>
129-
<bean id="FirstFitStoragePoolAllocator" class="com.cloud.storage.allocator.FirstFitStoragePoolAllocator">
128+
<!--
129+
<bean id="FirstFitStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.FirstFitStoragePoolAllocator">
130130
<property name="name" value="Storage"/>
131131
</bean>
132-
132+
-->
133133
<bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
134134
<property name="name" value="User First"/>
135135
</bean>

‎debian/control‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Source: cloudstack
22
Section: libs
33
Priority: extra
44
Maintainer: Wido den Hollander <wido@widodh.nl>
5-
Build-Depends: debhelper (>= 7), openjdk-6-jdk, tomcat6, genisoimage,
5+
Build-Depends: debhelper (>= 7), openjdk-6-jdk | openjdk-7-jdk, tomcat6, genisoimage,
66
python-mysqldb, maven3 | maven (>= 3), python (>= 2.6.6-3~)
77
Standards-Version: 3.8.1
88
Homepage: http://www.cloudstack.org/
@@ -22,7 +22,7 @@ Description: CloudStack server library
2222

2323
Package: cloudstack-agent
2424
Architecture: all
25-
Depends: openjdk-6-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc
25+
Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc
2626
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
2727
Description: CloudStack agent
2828
The CloudStack agent is in charge of managing shared computing resources in
@@ -31,7 +31,7 @@ Description: CloudStack agent
3131

3232
Package: cloudstack-usage
3333
Architecture: all
34-
Depends: openjdk-6-jre, cloudstack-common (= ${source:Version}), jsvc
34+
Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), jsvc
3535
Description: CloudStack usage monitor
3636
The CloudStack usage monitor provides usage accounting across the entire cloud for
3737
cloud operators to charge based on usage parameters.

‎debian/rules‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ install:
6060
# cloudstack-agent
6161
mkdir debian/tmp/etc/cloud/agent
6262
mkdir debian/tmp/var/log/cloudstack/agent
63-
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar
63+
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar
6464
install -D packaging/debian/init/cloud-agent debian/tmp/etc/init.d/
6565
install -D agent/bindir/cloud-setup-agent.in debian/tmp/usr/bin/cloud-setup-agent
6666
install -D agent/bindir/cloud-ssh.in debian/tmp/usr/bin/cloud-ssh
@@ -80,14 +80,14 @@ install:
8080
mkdir debian/tmp/var/lib/cloud/management
8181
mkdir debian/tmp/var/lib/cloud/mnt
8282
cp -r client/target/utilities/scripts/db/* debian/tmp/usr/share/cloudstack-management/setup/
83-
cp -r client/target/cloud-client-ui-4.1.0-SNAPSHOT/* debian/tmp/usr/share/cloudstack-management/webapps/client/
83+
cp -r client/target/cloud-client-ui-4.2.0-SNAPSHOT/* debian/tmp/usr/share/cloudstack-management/webapps/client/
8484
cp server/target/conf/* debian/tmp/etc/cloud/server/
8585
cp client/target/conf/* debian/tmp/etc/cloud/management/
8686
ln -s tomcat6-nonssl.conf debian/tmp/etc/cloud/management/tomcat6.conf
8787
mkdir -p debian/tmp/etc/cloud/management/Catalina/localhost/client
8888
install -D packaging/debian/init/cloud-management debian/tmp/etc/init.d/cloud-management
8989
install -D client/bindir/cloud-update-xenserver-licenses.in debian/tmp/usr/bin/cloud-update-xenserver-licenses
90-
install -D server/target/cloud-server-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-management/lib/cloudstack-server.jar
90+
install -D server/target/cloud-server-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-management/lib/cloudstack-server.jar
9191
ln -s /usr/share/tomcat6/bin debian/tmp/usr/share/cloudstack-management/bin
9292
ln -s ../../../etc/cloud/management debian/tmp/usr/share/cloudstack-management/conf
9393
ln -s /usr/share/tomcat6/lib debian/tmp/usr/share/cloudstack-management/lib
@@ -109,9 +109,9 @@ install:
109109
install -D client/target/utilities/bin/cloud-set-guest-sshkey debian/tmp/usr/bin
110110
install -D client/target/utilities/bin/cloud-setup-databases debian/tmp/usr/bin
111111
install -D client/target/utilities/bin/cloud-setup-management debian/tmp/usr/bin
112-
install -D console-proxy/dist/systemvm.iso debian/tmp/usr/share/cloudstack-common/vms/systemvm.iso
113-
install -D core/target/cloud-core-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-core.jar
114-
install -D api/target/cloud-api-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-api.jar
112+
install -D services/console-proxy/server/dist/systemvm.iso debian/tmp/usr/share/cloudstack-common/vms/systemvm.iso
113+
install -D core/target/cloud-core-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-core.jar
114+
install -D api/target/cloud-api-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-api.jar
115115

116116
# cloudstack-python
117117
mkdir -p debian/tmp/usr/lib/python2.7/dist-packages
@@ -120,7 +120,7 @@ install:
120120
# cloudstack-usage
121121
mkdir debian/tmp/etc/cloud/usage
122122
mkdir debian/tmp/var/log/cloudstack/usage
123-
install -D usage/target/cloud-usage-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-usage/lib/cloudstack-usage.jar
123+
install -D usage/target/cloud-usage-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-usage/lib/cloudstack-usage.jar
124124
cp usage/target/transformed/* debian/tmp/etc/cloud/usage/
125125
ln -s ../management/db.properties debian/tmp/etc/cloud/usage/db.properties
126126
install -D packaging/debian/init/cloud-usage debian/tmp/etc/init.d

0 commit comments

Comments
 (0)