mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
add storage motion interface
This commit is contained in:
parent
b38d9b82b6
commit
cad75e7220
@ -92,6 +92,5 @@ public interface VirtualMachineTemplate extends ControlledEntity {
|
||||
Long getSourceTemplateId();
|
||||
|
||||
String getTemplateTag();
|
||||
|
||||
Map getDetails();
|
||||
}
|
||||
|
||||
@ -23,5 +23,5 @@ import org.apache.cloudstack.engine.entity.api.CloudStackEntity;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
|
||||
public interface TemplateEntity extends CloudStackEntity, VirtualMachineTemplate {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ public class StorageOrchestratorImpl implements StorageOrchestrator {
|
||||
PrimaryDataStore pd = primaryStorageMgr.getPrimaryDataStore(dataStoreId);
|
||||
boolean existsOnPrimaryStorage = pd.templateExists(template.getId());
|
||||
if (!existsOnPrimaryStorage) {
|
||||
|
||||
pd.installTemplate(template);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskTyp
|
||||
import org.apache.cloudstack.storage.HypervisorHostEndPoint;
|
||||
import org.apache.cloudstack.storage.datastore.db.DataStoreVO;
|
||||
import org.apache.cloudstack.storage.datastore.driver.PrimaryDataStoreDriver;
|
||||
import org.apache.cloudstack.storage.image.TemplateInfo;
|
||||
|
||||
import org.apache.cloudstack.storage.volume.VolumeEntityImpl;
|
||||
import org.apache.cloudstack.storage.volume.VolumeEvent;
|
||||
@ -63,13 +64,6 @@ public class DefaultPrimaryDataStoreImpl implements PrimaryDataStore {
|
||||
public boolean deleteVolume(long id) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VolumeInfo createVolume(VolumeInfo vol, VolumeDiskType diskType) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,4 +135,16 @@ public class DefaultPrimaryDataStoreImpl implements PrimaryDataStore {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean templateExists(long templateId) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createTemplate(TemplateObject template) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskType;
|
||||
import org.apache.cloudstack.storage.image.TemplateObject;
|
||||
import org.apache.cloudstack.storage.volume.VolumeObject;
|
||||
|
||||
|
||||
@ -37,4 +38,5 @@ public interface PrimaryDataStore extends PrimaryDataStoreInfo {
|
||||
PrimaryDataStoreInfo getDataStoreInfo();
|
||||
boolean exists(VolumeInfo vi);
|
||||
boolean templateExists(long templateId);
|
||||
boolean installTemplate(TemplateObject template);
|
||||
}
|
||||
|
||||
@ -18,6 +18,14 @@
|
||||
*/
|
||||
package org.apache.cloudstack.storage.image;
|
||||
|
||||
import org.apache.cloudstack.storage.image.store.ImageDataStoreInfo;
|
||||
|
||||
public class TemplateObject implements TemplateInfo {
|
||||
|
||||
@Override
|
||||
public ImageDataStoreInfo getImageDataStore() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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.image.motion;
|
||||
|
||||
public class DefaultImageMotionProvider implements ImageMotionProvider {
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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.image.motion;
|
||||
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
|
||||
import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
|
||||
|
||||
public interface ImageMotionProvider {
|
||||
public boolean canHandle(TemplateEntity template, PrimaryDataStore dataStoe);
|
||||
}
|
||||
@ -16,9 +16,12 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.storage.image;
|
||||
package org.apache.cloudstack.storage.image.motion;
|
||||
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
|
||||
|
||||
public interface ImageMotionService {
|
||||
boolean copyTemplate(String templateUri, String destTemplateUri);
|
||||
boolean copyTemplate(TemplateEntity template, PrimaryDataStoreInfo dataStore);
|
||||
boolean copyIso(String isoUri, String destIsoUri);
|
||||
}
|
||||
@ -16,20 +16,23 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.cloudstack.storage.image;
|
||||
package org.apache.cloudstack.storage.image.motion;
|
||||
|
||||
import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
|
||||
import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
|
||||
|
||||
public class ImageMotionServiceImpl implements ImageMotionService {
|
||||
|
||||
@Override
|
||||
public boolean copyTemplate(String templateUri, String destTemplateUri) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyIso(String isoUri, String destIsoUri) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTemplate(TemplateEntity template, PrimaryDataStore dataStore) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user