mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
volume related operation works
This commit is contained in:
parent
fdee284395
commit
2d544e7127
@ -1,3 +1,4 @@
|
||||
package com.cloud.agent.api.storage;
|
||||
// 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
|
||||
@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
||||
public class CopyCommandResult extends CommandResult {
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
||||
public class CreateCmdResult extends CommandResult {
|
||||
@ -26,6 +28,7 @@ public class CreateCmdResult extends CommandResult {
|
||||
public CreateCmdResult(String path, Answer answer) {
|
||||
super();
|
||||
this.path = path;
|
||||
this.answer = answer;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
|
||||
@ -21,6 +21,7 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
import com.cloud.agent.api.to.DataStoreTO;
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
public interface PrimaryDataStoreDriver extends DataStoreDriver {
|
||||
public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback);
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
|
||||
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
||||
public class SnapshotResult extends CommandResult {
|
||||
|
||||
@ -20,6 +20,7 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
|
||||
import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.apache.cloudstack.storage.command;
|
||||
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
|
||||
public class AttachPrimaryDataStoreCmd extends Command implements StorageSubSystemCommand {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.engine.subsystem.api.storage;
|
||||
package org.apache.cloudstack.storage.command;
|
||||
|
||||
public class CommandResult {
|
||||
private boolean success;
|
||||
@ -16,6 +16,7 @@
|
||||
// under the License.
|
||||
package org.apache.cloudstack.storage.command;
|
||||
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataTO;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
// under the License.
|
||||
package org.apache.cloudstack.storage.command;
|
||||
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
|
||||
public class CreatePrimaryDataStoreCmd extends Command implements StorageSubSystemCommand {
|
||||
|
||||
@ -18,14 +18,14 @@
|
||||
*/
|
||||
package org.apache.cloudstack.storage.command;
|
||||
|
||||
import org.apache.cloudstack.storage.to.VolumeObjectTO;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataTO;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
|
||||
public class DeleteCommand extends Command implements StorageSubSystemCommand {
|
||||
private String uri;
|
||||
public DeleteCommand(String uri) {
|
||||
this.uri = uri;
|
||||
private DataTO data;
|
||||
public DeleteCommand(DataTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
protected DeleteCommand() {
|
||||
@ -37,8 +37,8 @@ public class DeleteCommand extends Command implements StorageSubSystemCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return this.uri;
|
||||
public DataTO getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ public class VolumeObjectTO implements DataTO {
|
||||
private long size;
|
||||
private String path;
|
||||
private Long volumeId;
|
||||
private String vmName;
|
||||
private long accountId;
|
||||
|
||||
public VolumeObjectTO() {
|
||||
@ -48,7 +49,7 @@ public class VolumeObjectTO implements DataTO {
|
||||
} else {
|
||||
this.dataStore = null;
|
||||
}
|
||||
//this.name = volume.getName();
|
||||
this.vmName = volume.getAttachedVmName();
|
||||
this.size = volume.getSize();
|
||||
this.setVolumeId(volume.getId());
|
||||
}
|
||||
@ -121,5 +122,13 @@ public class VolumeObjectTO implements DataTO {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public String getVmName() {
|
||||
return vmName;
|
||||
}
|
||||
|
||||
public void setVmName(String vmName) {
|
||||
this.vmName = vmName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,6 @@ import java.util.concurrent.ExecutionException;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -38,6 +37,7 @@ import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.cache.allocator.StorageCacheAllocator;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.command.CopyCmdAnswer;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
@ -29,7 +29,6 @@ import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService;
|
||||
@ -51,6 +50,7 @@ import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.DataObjectManager;
|
||||
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
|
||||
@ -377,7 +377,7 @@ public class TemplateServiceImpl implements TemplateService {
|
||||
}
|
||||
}
|
||||
|
||||
for (String uniqueName : templateInfos.keySet()) {
|
||||
/* for (String uniqueName : templateInfos.keySet()) {
|
||||
TemplateProp tInfo = templateInfos.get(uniqueName);
|
||||
List<UserVmVO> userVmUsingIso = _userVmDao.listByIsoId(tInfo.getId());
|
||||
//check if there is any Vm using this ISO.
|
||||
@ -396,7 +396,7 @@ public class TemplateServiceImpl implements TemplateService {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests {
|
||||
private String s3SecretKey;
|
||||
private String s3EndPoint;
|
||||
private String s3TemplateBucket;
|
||||
private String primaryStorageUuid;
|
||||
private boolean s3UseHttps;
|
||||
|
||||
protected void injectMockito() {
|
||||
@ -70,11 +71,11 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests {
|
||||
|
||||
@Parameters({"devcloud-host-uuid", "devcloud-host-gateway", "devcloud-host-cidr",
|
||||
"devcloud-host-ip", "template-url", "devcloud-local-storage-uuid",
|
||||
"primary-storage-want-to-add", "devcloud-secondary-storage", "s3-accesskey", "s3-secretkey", "s3-endpoint", "s3-template-bucket", "s3-usehttps", "image-install-path"})
|
||||
"primary-storage-want-to-add", "devcloud-secondary-storage", "s3-accesskey", "s3-secretkey", "s3-endpoint", "s3-template-bucket", "s3-usehttps", "image-install-path", "primary-storage-uuid-want-to-add"})
|
||||
protected void setup(String hostuuid, String gateway, String cidr,
|
||||
String hostIp, String templateUrl, String localStorageUuid,
|
||||
String primaryStorage, String secondaryStorage, String s3_accessKey, String s3_secretKey, String s3_endpoint, String s3_template_bucket,
|
||||
String s3_usehttps, String imageInstallPath) {
|
||||
String s3_usehttps, String imageInstallPath, String primaryStorageUuid) {
|
||||
this.hostGuid = hostuuid;
|
||||
this.hostGateway = gateway;
|
||||
this.hostCidr = cidr;
|
||||
@ -82,6 +83,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests {
|
||||
this.templateUrl = templateUrl;
|
||||
this.localStorageUuid = localStorageUuid;
|
||||
this.primaryStorageUrl = primaryStorage;
|
||||
this.primaryStorageUuid = primaryStorageUuid;
|
||||
this.imageInstallPath = imageInstallPath;
|
||||
this.setSecondaryStorage(secondaryStorage);
|
||||
// set S3 parameters
|
||||
@ -157,4 +159,12 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests {
|
||||
this.imageInstallPath = imageInstallPath;
|
||||
}
|
||||
|
||||
public String getPrimaryStorageUuid() {
|
||||
return primaryStorageUuid;
|
||||
}
|
||||
|
||||
public void setPrimaryStorageUuid(String primaryStorageUuid) {
|
||||
this.primaryStorageUuid = primaryStorageUuid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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.storage.test;
|
||||
|
||||
public class SnapshotTest {
|
||||
|
||||
}
|
||||
@ -26,11 +26,14 @@ import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.storage.TemplateProfile;
|
||||
import com.cloud.storage.VMTemplateVO;
|
||||
import com.cloud.storage.Storage.TemplateType;
|
||||
import com.cloud.storage.dao.VMTemplateDao;
|
||||
import com.cloud.storage.download.DownloadMonitor;
|
||||
import com.cloud.storage.download.DownloadMonitorImpl;
|
||||
import com.cloud.template.HypervisorTemplateAdapter;
|
||||
import com.cloud.template.TemplateAdapter;
|
||||
import com.cloud.utils.component.ComponentContext;
|
||||
|
||||
@ContextConfiguration(locations={"classpath:/storageContext.xml"})
|
||||
@ -53,6 +56,8 @@ public class TemplateTest extends CloudStackTestNGBase {
|
||||
EndPointSelector epSelector;
|
||||
@Inject
|
||||
DownloadMonitorImpl downloadMonitor;
|
||||
|
||||
|
||||
long dcId;
|
||||
long templateId;
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@ -37,6 +38,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManag
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.type.RootDisk;
|
||||
@ -44,6 +46,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateService;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.storage.LocalHostEndpoint;
|
||||
import org.apache.cloudstack.storage.RemoteHostEndPoint;
|
||||
import org.apache.cloudstack.storage.command.CopyCmdAnswer;
|
||||
@ -58,6 +61,7 @@ import org.apache.cloudstack.storage.volume.db.VolumeDao2;
|
||||
import org.apache.cloudstack.storage.volume.db.VolumeVO;
|
||||
import org.mockito.Mockito;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.testng.AssertJUnit;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
@ -68,6 +72,7 @@ import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.dc.dao.ClusterDao;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
import com.cloud.dc.dao.HostPodDao;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.Host.Type;
|
||||
import com.cloud.host.HostVO;
|
||||
@ -78,9 +83,12 @@ import com.cloud.org.Managed.ManagedState;
|
||||
import com.cloud.resource.ResourceManager;
|
||||
import com.cloud.resource.ResourceState;
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
import com.cloud.storage.ScopeType;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
|
||||
import com.cloud.storage.VMTemplateVO;
|
||||
import com.cloud.storage.Storage.StoragePoolType;
|
||||
import com.cloud.storage.Storage.TemplateType;
|
||||
import com.cloud.storage.dao.VMTemplateDao;
|
||||
import com.cloud.utils.component.ComponentContext;
|
||||
@ -255,7 +263,7 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
return this.dataStoreMgr.getPrimaryDataStore(pools.get(0).getId());
|
||||
}
|
||||
|
||||
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("cloudstack primary data store provider");
|
||||
/*DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("cloudstack primary data store provider");
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
URI uri = new URI(this.getPrimaryStorageUrl());
|
||||
params.put("url", this.getPrimaryStorageUrl());
|
||||
@ -274,7 +282,24 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
DataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle();
|
||||
DataStore store = lifeCycle.initialize(params);
|
||||
ClusterScope scope = new ClusterScope(clusterId, podId, dcId);
|
||||
lifeCycle.attachCluster(store, scope);
|
||||
lifeCycle.attachCluster(store, scope);*/
|
||||
|
||||
StoragePoolVO pool = new StoragePoolVO();
|
||||
pool.setClusterId(clusterId);
|
||||
pool.setDataCenterId(dcId);
|
||||
URI uri = new URI(this.getPrimaryStorageUrl());
|
||||
pool.setHostAddress(uri.getHost());
|
||||
pool.setPath(uri.getPath());
|
||||
pool.setPort(0);
|
||||
pool.setName(this.primaryName);
|
||||
pool.setUuid(this.getPrimaryStorageUuid());
|
||||
pool.setStatus(StoragePoolStatus.Up);
|
||||
pool.setPoolType(StoragePoolType.NetworkFilesystem);
|
||||
pool.setPodId(podId);
|
||||
pool.setScope(ScopeType.CLUSTER);
|
||||
pool.setStorageProviderName("cloudstack primary data store provider");
|
||||
pool = this.primaryStoreDao.persist(pool);
|
||||
DataStore store = this.dataStoreMgr.getPrimaryDataStore(pool.getId());
|
||||
return store;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
@ -283,18 +308,75 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
|
||||
private VolumeVO createVolume(Long templateId, long dataStoreId) {
|
||||
VolumeVO volume = new VolumeVO(1000, new RootDisk().toString(), UUID.randomUUID().toString(), templateId);
|
||||
//volume.setPoolId(dataStoreId);
|
||||
volume.setPoolId(dataStoreId);
|
||||
volume = volumeDao.persist(volume);
|
||||
return volume;
|
||||
}
|
||||
|
||||
@Test
|
||||
//@Test
|
||||
public void testCopyBaseImage() {
|
||||
DataStore primaryStore = createPrimaryDataStore();
|
||||
primaryStoreId = primaryStore.getId();
|
||||
primaryStore = this.dataStoreMgr.getPrimaryDataStore(primaryStoreId);
|
||||
VolumeVO volume = createVolume(image.getId(), primaryStore.getId());
|
||||
VolumeInfo volInfo = this.volFactory.getVolume(volume.getId());
|
||||
this.volumeService.createVolumeFromTemplateAsync(volInfo, this.primaryStoreId, this.templateFactory.getTemplate(this.image.getId()));
|
||||
AsyncCallFuture<VolumeApiResult> future = this.volumeService.createVolumeFromTemplateAsync(volInfo, this.primaryStoreId, this.templateFactory.getTemplate(this.image.getId()));
|
||||
try {
|
||||
VolumeApiResult result = future.get();
|
||||
|
||||
AssertJUnit.assertTrue(result.isSuccess());
|
||||
|
||||
VolumeInfo newVol = result.getVolume();
|
||||
this.volumeService.destroyVolume(newVol.getId());
|
||||
VolumeInfo vol = this.volFactory.getVolume(volume.getId());
|
||||
this.volumeService.expungeVolumeAsync(vol);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ExecutionException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ConcurrentOperationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateDataDisk() {
|
||||
DataStore primaryStore = createPrimaryDataStore();
|
||||
primaryStoreId = primaryStore.getId();
|
||||
primaryStore = this.dataStoreMgr.getPrimaryDataStore(primaryStoreId);
|
||||
VolumeVO volume = createVolume(null, primaryStore.getId());
|
||||
VolumeInfo volInfo = this.volFactory.getVolume(volume.getId());
|
||||
this.volumeService.createVolumeAsync(volInfo, primaryStore);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteDisk() {
|
||||
DataStore primaryStore = createPrimaryDataStore();
|
||||
primaryStoreId = primaryStore.getId();
|
||||
primaryStore = this.dataStoreMgr.getPrimaryDataStore(primaryStoreId);
|
||||
VolumeVO volume = createVolume(null, primaryStore.getId());
|
||||
VolumeInfo volInfo = this.volFactory.getVolume(volume.getId());
|
||||
AsyncCallFuture<VolumeApiResult> future = this.volumeService.createVolumeAsync(volInfo, primaryStore);
|
||||
try {
|
||||
VolumeApiResult result = future.get();
|
||||
VolumeInfo vol = result.getVolume();
|
||||
|
||||
this.volumeService.destroyVolume(volInfo.getId());
|
||||
volInfo = this.volFactory.getVolume(vol.getId());
|
||||
this.volumeService.expungeVolumeAsync(volInfo);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ExecutionException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ConcurrentOperationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,6 @@ import java.util.concurrent.ExecutionException;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
|
||||
@ -50,6 +49,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeAp
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.type.RootDisk;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.storage.RemoteHostEndPoint;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
|
||||
@ -22,7 +22,6 @@ import java.util.concurrent.ExecutionException;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService;
|
||||
@ -42,6 +41,7 @@ import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreDao;
|
||||
|
||||
@ -18,11 +18,11 @@
|
||||
*/
|
||||
package org.apache.cloudstack.storage.datastore;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
public interface DataObjectManager {
|
||||
public void createAsync(DataObject data, DataStore store, AsyncCompletionCallback<CreateCmdResult> callback, boolean noCopy);
|
||||
|
||||
@ -20,7 +20,6 @@ package org.apache.cloudstack.storage.datastore;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService;
|
||||
@ -32,6 +31,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreState
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
*/
|
||||
package org.apache.cloudstack.storage.image.motion;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.db.ObjectInDataStoreVO;
|
||||
import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo;
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataTO;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
|
||||
import org.apache.cloudstack.storage.command.CopyCmdAnswer;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectAnswer;
|
||||
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
|
||||
import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO;
|
||||
@ -380,6 +381,13 @@ public class VolumeObject implements VolumeInfo {
|
||||
vol.setPath(newVol.getPath());
|
||||
vol.setSize(newVol.getSize());
|
||||
volumeDao.update(vol.getId(), vol);
|
||||
} else if (answer instanceof CreateObjectAnswer) {
|
||||
CreateObjectAnswer createAnswer =(CreateObjectAnswer)answer;
|
||||
VolumeObjectTO newVol = (VolumeObjectTO)createAnswer.getData();
|
||||
VolumeVO vol = this.volumeDao.findById(this.getId());
|
||||
vol.setPath(newVol.getPath());
|
||||
vol.setSize(newVol.getSize());
|
||||
volumeDao.update(vol.getId(), vol);
|
||||
}
|
||||
} else if (this.dataStore.getRole() == DataStoreRole.Image) {
|
||||
if (answer instanceof DownloadAnswer) {
|
||||
|
||||
@ -26,7 +26,6 @@ import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService;
|
||||
@ -44,6 +43,7 @@ import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.DataObjectManager;
|
||||
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
|
||||
import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
|
||||
@ -165,7 +165,7 @@ public class VolumeServiceImpl implements VolumeService {
|
||||
DataObject vo = context.getVolume();
|
||||
String errMsg = null;
|
||||
if (result.isSuccess()) {
|
||||
vo.processEvent(Event.OperationSuccessed);
|
||||
vo.processEvent(Event.OperationSuccessed, result.getAnswer());
|
||||
} else {
|
||||
vo.processEvent(Event.OperationFailed);
|
||||
errMsg = result.getResult();
|
||||
|
||||
@ -54,9 +54,10 @@ import javax.naming.ConfigurationException;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import com.cloud.agent.api.*;
|
||||
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
|
||||
import com.cloud.agent.api.to.*;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
|
||||
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.xmlrpc.XmlRpcException;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
@ -42,11 +42,12 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataTO;
|
||||
import org.apache.cloudstack.storage.command.AttachPrimaryDataStoreAnswer;
|
||||
import org.apache.cloudstack.storage.command.AttachPrimaryDataStoreCmd;
|
||||
import org.apache.cloudstack.storage.command.CopyCommand;
|
||||
import org.apache.cloudstack.storage.command.CopyCmdAnswer;
|
||||
import org.apache.cloudstack.storage.command.CopyCommand;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectAnswer;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectCommand;
|
||||
import org.apache.cloudstack.storage.command.CreatePrimaryDataStoreCmd;
|
||||
import org.apache.cloudstack.storage.command.DeleteCommand;
|
||||
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
|
||||
import org.apache.cloudstack.storage.datastore.protocol.DataStoreProtocol;
|
||||
import org.apache.cloudstack.storage.to.ImageStoreTO;
|
||||
@ -113,8 +114,8 @@ public class XenServerStorageResource {
|
||||
return execute((CreatePrimaryDataStoreCmd) command);
|
||||
} else if (command instanceof CreateObjectCommand) {
|
||||
return execute((CreateObjectCommand) command);
|
||||
} else if (command instanceof DeleteVolumeCommand) {
|
||||
return execute((DeleteVolumeCommand)command);
|
||||
} else if (command instanceof DeleteCommand) {
|
||||
return execute((DeleteCommand)command);
|
||||
}
|
||||
return new Answer((Command)command, false, "not implemented yet");
|
||||
}
|
||||
@ -222,15 +223,14 @@ public class XenServerStorageResource {
|
||||
return new CreateObjectAnswer(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
protected Answer execute(DeleteVolumeCommand cmd) {
|
||||
VolumeObjectTO volume = null;
|
||||
|
||||
protected Answer deleteVolume(VolumeObjectTO volume) {
|
||||
Connection conn = hypervisorResource.getConnection();
|
||||
String errorMsg = null;
|
||||
try {
|
||||
VDI vdi = VDI.getByUuid(conn, volume.getUuid());
|
||||
VDI vdi = VDI.getByUuid(conn, volume.getPath());
|
||||
deleteVDI(conn, vdi);
|
||||
return new Answer(cmd);
|
||||
return new Answer(null);
|
||||
} catch (BadServerResponse e) {
|
||||
s_logger.debug("Failed to delete volume", e);
|
||||
errorMsg = e.toString();
|
||||
@ -241,8 +241,19 @@ public class XenServerStorageResource {
|
||||
s_logger.debug("Failed to delete volume", e);
|
||||
errorMsg = e.toString();
|
||||
}
|
||||
return new Answer(null, false, errorMsg);
|
||||
}
|
||||
|
||||
return new Answer(cmd, false, errorMsg);
|
||||
protected Answer execute(DeleteCommand cmd) {
|
||||
DataTO data = cmd.getData();
|
||||
Answer answer = null;
|
||||
if (data.getObjectType() == DataObjectType.VOLUME) {
|
||||
answer = deleteVolume((VolumeObjectTO)data);
|
||||
} else {
|
||||
answer = new Answer(cmd, false, "unsupported type");
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
/* protected Answer execute(CreateVolumeFromBaseImageCommand cmd) {
|
||||
|
||||
@ -24,7 +24,6 @@ import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -38,6 +37,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
|
||||
import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao;
|
||||
|
||||
@ -26,7 +26,6 @@ import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -40,6 +39,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
|
||||
|
||||
@ -22,7 +22,6 @@ import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -32,6 +31,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataTO;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectAnswer;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectCommand;
|
||||
import org.apache.cloudstack.storage.image.ImageStoreDriver;
|
||||
|
||||
@ -26,7 +26,6 @@ import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -39,6 +38,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
|
||||
|
||||
@ -22,7 +22,6 @@ import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -30,11 +29,14 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataTO;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectCommand;
|
||||
import org.apache.cloudstack.storage.command.DeleteCommand;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
import org.apache.cloudstack.storage.to.SnapshotObjectTO;
|
||||
import org.apache.cloudstack.storage.volume.VolumeObject;
|
||||
@ -80,6 +82,7 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
|
||||
@Inject SnapshotDao snapshotDao;
|
||||
@Inject PrimaryDataStoreDao primaryStoreDao;
|
||||
@Inject SnapshotManager snapshotMgr;
|
||||
@Inject EndPointSelector epSelecotor;
|
||||
@Override
|
||||
public String grantAccess(DataObject data, EndPoint ep) {
|
||||
// TODO Auto-generated method stub
|
||||
@ -117,7 +120,8 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
|
||||
}
|
||||
|
||||
CreateObjectCommand cmd = new CreateObjectCommand(volume.getTO());
|
||||
Answer answer = storageMgr.sendToPool((StoragePool)volume.getDataStore(), null, cmd);
|
||||
EndPoint ep = epSelecotor.select(volume);
|
||||
Answer answer = ep.sendMessage(cmd);
|
||||
return answer;
|
||||
}
|
||||
|
||||
@ -149,28 +153,17 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
|
||||
@Override
|
||||
public void deleteAsync(DataObject data,
|
||||
AsyncCompletionCallback<CommandResult> callback) {
|
||||
|
||||
String vmName = null;
|
||||
VolumeVO vol = this.volumeDao.findById(data.getId());
|
||||
|
||||
|
||||
StoragePool pool = (StoragePool)data.getDataStore();
|
||||
|
||||
DestroyCommand cmd = new DestroyCommand(pool, vol, vmName);
|
||||
DeleteCommand cmd = new DeleteCommand(data.getTO());
|
||||
|
||||
CommandResult result = new CommandResult();
|
||||
try {
|
||||
Answer answer = this.storageMgr.sendToPool(pool, cmd);
|
||||
EndPoint ep = epSelecotor.select(data);
|
||||
Answer answer = ep.sendMessage(cmd);
|
||||
if (answer != null && !answer.getResult()) {
|
||||
result.setResult(answer.getDetails());
|
||||
s_logger.info("Will retry delete of " + vol + " from " + pool.getId());
|
||||
}
|
||||
} catch (StorageUnavailableException e) {
|
||||
s_logger.error("Storage is unavailable currently. Will retry delete of "
|
||||
+ vol + " from " + pool.getId(), e);
|
||||
result.setResult(e.toString());
|
||||
} catch (Exception ex) {
|
||||
s_logger.debug("Unable to destoy volume" + vol + " from " + pool.getId(), ex);
|
||||
s_logger.debug("Unable to destoy volume" + data.getId(), ex);
|
||||
result.setResult(ex.toString());
|
||||
}
|
||||
callback.complete(result);
|
||||
|
||||
@ -21,7 +21,6 @@ import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -34,6 +33,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.framework.async.AsyncRpcConext;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectAnswer;
|
||||
import org.apache.cloudstack.storage.command.CreateObjectCommand;
|
||||
import org.apache.cloudstack.storage.command.DeleteCommand;
|
||||
|
||||
@ -18,7 +18,6 @@ package org.apache.cloudstack.storage.datastore.driver;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
|
||||
@ -28,6 +27,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
|
||||
import com.cloud.agent.api.to.DataStoreTO;
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ public class TemplateProfile {
|
||||
VMTemplateVO template;
|
||||
String templateTag;
|
||||
Map details;
|
||||
|
||||
|
||||
public TemplateProfile(Long templateId, Long userId, String name, String displayText, Integer bits, Boolean passwordEnabled, Boolean requiresHvm,
|
||||
String url, Boolean isPublic, Boolean featured, Boolean isExtractable, ImageFormat format, Long guestOsId, Long zoneId,
|
||||
|
||||
@ -61,7 +61,7 @@ import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
@Local(value=TemplateAdapter.class)
|
||||
public class HypervisorTemplateAdapter extends TemplateAdapterBase implements TemplateAdapter {
|
||||
public class HypervisorTemplateAdapter extends TemplateAdapterBase {
|
||||
private final static Logger s_logger = Logger.getLogger(HypervisorTemplateAdapter.class);
|
||||
@Inject DownloadMonitor _downloadMonitor;
|
||||
@Inject AgentManager _agentMgr;
|
||||
|
||||
@ -50,7 +50,6 @@ import org.apache.cloudstack.api.command.user.template.ListTemplatePermissionsCm
|
||||
import org.apache.cloudstack.api.command.user.template.RegisterTemplateCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.UpdateTemplateCmd;
|
||||
import org.apache.cloudstack.api.command.user.template.UpdateTemplatePermissionsCmd;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
|
||||
@ -65,6 +64,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
|
||||
import org.apache.cloudstack.framework.async.AsyncCallFuture;
|
||||
import org.apache.cloudstack.storage.command.CommandResult;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user