mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
fix compile
This commit is contained in:
parent
42e25a22fc
commit
e444867e61
@ -91,17 +91,6 @@ public class TemplateDataFactoryImpl implements TemplateDataFactory {
|
||||
return this.getTemplate(templateId, store);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TemplateInfo getTemplate(long templateId, long zoneId) {
|
||||
TemplateDataStoreVO tmplStore = templateStoreDao.findByTemplateZoneDownloadStatus(templateId, zoneId, VMTemplateStorageResourceAssoc.Status.DOWNLOADED);
|
||||
if (tmplStore != null) {
|
||||
DataStore store = this.storeMgr.getDataStore(tmplStore.getDataStoreId(), DataStoreRole.Image);
|
||||
return this.getTemplate(templateId, store);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TemplateInfo getTemplate(long templateId, DataStoreRole storeRole, Long zoneId) {
|
||||
VMTemplateVO templ = imageDataDao.findById(templateId);
|
||||
|
||||
@ -29,6 +29,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.storage.to.TemplateObjectTO;
|
||||
import org.apache.cloudstack.storage.to.VolumeObjectTO;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.xmlrpc.XmlRpcException;
|
||||
|
||||
@ -90,6 +92,10 @@ import com.cloud.agent.api.storage.CreatePrivateTemplateAnswer;
|
||||
import com.cloud.agent.api.storage.DestroyCommand;
|
||||
import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer;
|
||||
import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
|
||||
import com.cloud.agent.api.to.DataStoreTO;
|
||||
import com.cloud.agent.api.to.DataTO;
|
||||
import com.cloud.agent.api.to.DiskTO;
|
||||
import com.cloud.agent.api.to.NfsTO;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
@ -527,25 +533,35 @@ public class OvmResourceBase implements ServerResource, HypervisorResource {
|
||||
}
|
||||
|
||||
protected void createVbds(OvmVm.Details vm, VirtualMachineTO spec) throws URISyntaxException {
|
||||
for (VolumeTO volume : spec.getDisks()) {
|
||||
for (DiskTO volume : spec.getDisks()) {
|
||||
if (volume.getType() == Volume.Type.ROOT) {
|
||||
VolumeObjectTO vol = (VolumeObjectTO)volume.getData();
|
||||
OvmDisk.Details root = new OvmDisk.Details();
|
||||
root.path = volume.getPath();
|
||||
root.path = vol.getPath();
|
||||
root.type = OvmDisk.WRITE;
|
||||
root.isIso = false;
|
||||
vm.rootDisk = root;
|
||||
} else if (volume.getType() == Volume.Type.ISO) {
|
||||
if (volume.getPath() != null) {
|
||||
DataTO isoTO = volume.getData();
|
||||
if (isoTO.getPath() != null) {
|
||||
TemplateObjectTO template = (TemplateObjectTO)isoTO;
|
||||
DataStoreTO store = template.getDataStore();
|
||||
if (!(store instanceof NfsTO)) {
|
||||
throw new CloudRuntimeException("unsupported protocol");
|
||||
}
|
||||
NfsTO nfsStore = (NfsTO)store;
|
||||
String isoPath = nfsStore.getUrl() + File.separator + template.getPath();
|
||||
OvmDisk.Details iso = new OvmDisk.Details();
|
||||
URI path = new URI(volume.getPath());
|
||||
URI path = new URI(isoPath);
|
||||
iso.path = path.getHost() + ":" + path.getPath();
|
||||
iso.type = OvmDisk.READ;
|
||||
iso.isIso = true;
|
||||
vm.disks.add(iso);
|
||||
}
|
||||
} else if (volume.getType() == Volume.Type.DATADISK){
|
||||
|
||||
OvmDisk.Details data = new OvmDisk.Details();
|
||||
data.path = volume.getPath();
|
||||
data.path = volume.getData().getPath();
|
||||
data.type = OvmDisk.SHAREDWRITE;
|
||||
data.isIso = false;
|
||||
vm.disks.add(data);
|
||||
|
||||
@ -23,6 +23,7 @@ import javax.inject.Inject;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.to.DataTO;
|
||||
import com.cloud.agent.api.to.DiskTO;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
@ -102,7 +103,7 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
|
||||
}
|
||||
|
||||
to.setNics(nics);
|
||||
to.setDisks(vmProfile.getDisks().toArray(new DataTO[vmProfile.getDisks().size()]));
|
||||
to.setDisks(vmProfile.getDisks().toArray(new DiskTO[vmProfile.getDisks().size()]));
|
||||
|
||||
if(vmProfile.getTemplate().getBits() == 32) {
|
||||
to.setArch("i686");
|
||||
|
||||
@ -142,8 +142,9 @@ class deployDataCenters():
|
||||
secondarycmd.url = secondary.url
|
||||
secondarycmd.provider = secondary.providerName
|
||||
secondarycmd.details = []
|
||||
for item in secondary.details:
|
||||
secondarycmd.details.append(item.__dict__)
|
||||
if secondary.providerName != "NFS":
|
||||
for item in secondary.details:
|
||||
secondarycmd.details.append(item.__dict__)
|
||||
if secondarycmd.provider == "NFS":
|
||||
secondarycmd.zoneid = zoneId
|
||||
self.apiClient.addImageStore(secondarycmd)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user