cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [7/7] git commit: updated refs/heads/object_store to e444867
Date Fri, 10 May 2013 16:49:25 GMT
fix compile


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e444867e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e444867e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e444867e

Branch: refs/heads/object_store
Commit: e444867e619e88a68af0a06974f63ed892e8d39d
Parents: 42e25a2
Author: Edison Su <edison.su@citrix.com>
Authored: Fri May 10 09:47:09 2013 -0700
Committer: Edison Su <edison.su@citrix.com>
Committed: Fri May 10 09:47:09 2013 -0700

----------------------------------------------------------------------
 .../storage/image/TemplateDataFactoryImpl.java     |   11 ------
 .../com/cloud/ovm/hypervisor/OvmResourceBase.java  |   26 ++++++++++++---
 .../com/cloud/hypervisor/HypervisorGuruBase.java   |    3 +-
 tools/marvin/marvin/deployDataCenter.py            |    5 ++-
 4 files changed, 26 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e444867e/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
index 09c79b2..52c79e6 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
@@ -90,17 +90,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)
{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e444867e/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
index 7d8d90c..61ac54e 100755
--- a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
+++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
@@ -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);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e444867e/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
index 2300953..e11aa50 100644
--- a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
+++ b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
@@ -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");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e444867e/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 164af74..956d2bc 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -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)


Mime
View raw message