Skip to content

Commit 54f32a8

Browse files
author
Alex Huang
committed
Moved the controlling logic for secondary storage vm into place
1 parent 03a424e commit 54f32a8

6 files changed

Lines changed: 49 additions & 13 deletions

File tree

client/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@
266266
<artifactId>cloud-engine-storage-cache</artifactId>
267267
<version>${project.version}</version>
268268
</dependency>
269+
<dependency>
270+
<groupId>org.apache.cloudstack</groupId>
271+
<artifactId>cloud-controller-secondary-storage</artifactId>
272+
<version>${project.version}</version>
273+
</dependency>
269274
<dependency>
270275
<groupId>org.apache.cloudstack</groupId>
271276
<artifactId>cloud-engine-storage-image</artifactId>

server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@
8686

8787
<bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
8888

89-
<bean id="premiumSecondaryStorageManagerImpl"
90-
class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl">
91-
<property name="secondaryStorageVmAllocators"
92-
value="#{secondaryStorageVmAllocatorsRegistry.registered}" />
93-
</bean>
94-
9589
<bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
9690

9791

services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyThumbnailHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public ConsoleProxyThumbnailHandler() {
4141
}
4242

4343
@Override
44+
@SuppressWarnings("access")
4445
public void handle(HttpExchange t) throws IOException {
4546
try {
4647
Thread.currentThread().setName("JPG Thread " + Thread.currentThread().getId() + " " + t.getRemoteAddress());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
<beans xmlns="http://www.springframework.org/schema/beans"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xmlns:context="http://www.springframework.org/schema/context"
22+
xmlns:aop="http://www.springframework.org/schema/aop"
23+
xsi:schemaLocation="http://www.springframework.org/schema/beans
24+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
25+
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
26+
http://www.springframework.org/schema/context
27+
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
28+
>
29+
<bean id="premiumSecondaryStorageManagerImpl" class="org.apache.cloudstack.secondarystorage.PremiumSecondaryStorageManagerImpl">
30+
<property name="secondaryStorageVmAllocators"
31+
value="#{secondaryStorageVmAllocatorsRegistry.registered}" />
32+
</bean>
33+
</beans>

server/src/com/cloud/secstorage/PremiumSecondaryStorageManagerImpl.java renamed to services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
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.secstorage;
17+
package org.apache.cloudstack.secondarystorage;
1818

1919
import java.util.Date;
2020
import java.util.List;
@@ -32,7 +32,8 @@
3232
import com.cloud.host.Status;
3333
import com.cloud.host.dao.HostDao;
3434
import com.cloud.resource.ResourceManager;
35-
import com.cloud.storage.secondary.SecondaryStorageManagerImpl;
35+
import com.cloud.secstorage.CommandExecLogDao;
36+
import com.cloud.secstorage.CommandExecLogVO;
3637
import com.cloud.storage.secondary.SecondaryStorageVmManager;
3738
import com.cloud.utils.DateUtil;
3839
import com.cloud.utils.NumbersUtil;

server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java renamed to services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
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.storage.secondary;
17+
package org.apache.cloudstack.secondarystorage;
1818

1919
import java.net.URI;
2020
import java.net.URISyntaxException;
@@ -30,6 +30,8 @@
3030
import javax.inject.Inject;
3131
import javax.naming.ConfigurationException;
3232

33+
import org.apache.log4j.Logger;
34+
3335
import org.apache.cloudstack.config.ApiServiceConfiguration;
3436
import org.apache.cloudstack.context.CallContext;
3537
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
@@ -42,7 +44,6 @@
4244
import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
4345
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
4446
import org.apache.cloudstack.utils.identity.ManagementServerNode;
45-
import org.apache.log4j.Logger;
4647

4748
import com.cloud.agent.AgentManager;
4849
import com.cloud.agent.api.Answer;
@@ -104,6 +105,10 @@
104105
import com.cloud.storage.dao.StoragePoolHostDao;
105106
import com.cloud.storage.dao.UploadDao;
106107
import com.cloud.storage.dao.VMTemplateDao;
108+
import com.cloud.storage.secondary.SecStorageVmAlertEventArgs;
109+
import com.cloud.storage.secondary.SecondaryStorageListener;
110+
import com.cloud.storage.secondary.SecondaryStorageVmAllocator;
111+
import com.cloud.storage.secondary.SecondaryStorageVmManager;
107112
import com.cloud.storage.template.TemplateConstants;
108113
import com.cloud.template.TemplateManager;
109114
import com.cloud.user.Account;
@@ -188,9 +193,6 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
188193
protected NetworkModel _networkModel;
189194
@Inject
190195
protected SnapshotDao _snapshotDao;
191-
@Inject
192-
private ClusterManager _clusterMgr;
193-
194196
private SecondaryStorageListener _listener;
195197

196198
private ServiceOfferingVO _serviceOffering;

0 commit comments

Comments
 (0)