mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5819:extractTemplate fails with Vmware host on migration of
NFS to S3.
This commit is contained in:
parent
8b6e89c012
commit
64b8d1044d
|
|
@ -16,6 +16,8 @@
|
|||
// under the License.
|
||||
package com.cloud.hypervisor.vmware.manager;
|
||||
|
||||
import org.apache.cloudstack.storage.to.TemplateObjectTO;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.BackupSnapshotCommand;
|
||||
import com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand;
|
||||
|
|
@ -50,4 +52,6 @@ public interface VmwareStorageManager {
|
|||
boolean execute(VmwareHostService hostService, CreateEntityDownloadURLCommand cmd);
|
||||
|
||||
public void createOva(String path, String name);
|
||||
|
||||
public String createOvaForTemplate(TemplateObjectTO template);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
|
|||
_timeout = NumbersUtil.parseInt(value, 1440) * 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createOvaForTemplate(TemplateObjectTO template) {
|
||||
DataStoreTO storeTO = template.getDataStore();
|
||||
if (!(storeTO instanceof NfsTO)) {
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ public class VmwareStorageSubsystemCommandHandler extends StorageSubsystemComman
|
|||
String name = path.substring(index + 1);
|
||||
storageManager.createOva(parentPath + File.separator + path, name);
|
||||
vol.setPath(path + File.separator + name + ".ova");
|
||||
} else if (srcData.getObjectType() == DataObjectType.TEMPLATE) {
|
||||
// sync template from NFS cache to S3 in NFS migration to S3 case
|
||||
storageManager.createOvaForTemplate((TemplateObjectTO)srcData);
|
||||
} else if (srcData.getObjectType() == DataObjectType.SNAPSHOT && destData.getObjectType() == DataObjectType.TEMPLATE) {
|
||||
//create template from snapshot on src at first, then copy it to s3
|
||||
TemplateObjectTO cacheTemplate = (TemplateObjectTO)destData;
|
||||
|
|
|
|||
Loading…
Reference in New Issue