cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/4.3 to 9a4a291
Date Thu, 09 Jan 2014 22:06:09 GMT
Updated Branches:
  refs/heads/4.3 644a9bc53 -> 9a4a2911d


CLOUDSTACK-5819:extractTemplate fails with Vmware host on migration of
NFS to S3.


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

Branch: refs/heads/4.3
Commit: 9a4a2911da1b6e22180b55f09317b0a858d6e186
Parents: 644a9bc
Author: Min Chen <min.chen@citrix.com>
Authored: Thu Jan 9 14:04:29 2014 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Jan 9 14:05:35 2014 -0800

----------------------------------------------------------------------
 .../vmware/manager/VmwareStorageManager.java    | 10 ++++++--
 .../manager/VmwareStorageManagerImpl.java       | 19 ++++++++-------
 .../VmwareStorageSubsystemCommandHandler.java   | 25 ++++++++++++--------
 3 files changed, 34 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a4a2911/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java
index 14f293a..5b76f40 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java
@@ -11,11 +11,13 @@
 // 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 
+// KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // 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;
@@ -24,7 +26,9 @@ import com.cloud.agent.api.CreateVMSnapshotCommand;
 import com.cloud.agent.api.CreateVolumeFromSnapshotCommand;
 import com.cloud.agent.api.DeleteVMSnapshotCommand;
 import com.cloud.agent.api.RevertToVMSnapshotCommand;
-import com.cloud.agent.api.storage.*;
+import com.cloud.agent.api.storage.CopyVolumeCommand;
+import com.cloud.agent.api.storage.CreateEntityDownloadURLCommand;
+import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
 
 public interface VmwareStorageManager {
     Answer execute(VmwareHostService hostService, PrimaryStorageDownloadCommand cmd);
@@ -38,4 +42,6 @@ public interface VmwareStorageManager {
     Answer execute(VmwareHostService hostService, RevertToVMSnapshotCommand cmd);
     boolean execute(VmwareHostService hostService, CreateEntityDownloadURLCommand cmd);
     public void createOva(String path, String name);
+
+    public String createOvaForTemplate(TemplateObjectTO template);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a4a2911/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index 268017c..7e71d90 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -29,9 +29,18 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.UUID;
 
+import org.apache.log4j.Logger;
+
+import com.vmware.vim25.FileInfo;
+import com.vmware.vim25.FileQueryFlags;
+import com.vmware.vim25.HostDatastoreBrowserSearchResults;
+import com.vmware.vim25.HostDatastoreBrowserSearchSpec;
+import com.vmware.vim25.ManagedObjectReference;
+import com.vmware.vim25.TaskInfo;
+import com.vmware.vim25.VirtualDisk;
+
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.BackupSnapshotAnswer;
@@ -80,13 +89,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.snapshot.VMSnapshot;
-import com.vmware.vim25.FileInfo;
-import com.vmware.vim25.FileQueryFlags;
-import com.vmware.vim25.HostDatastoreBrowserSearchResults;
-import com.vmware.vim25.HostDatastoreBrowserSearchSpec;
-import com.vmware.vim25.ManagedObjectReference;
-import com.vmware.vim25.TaskInfo;
-import com.vmware.vim25.VirtualDisk;
 
 public class VmwareStorageManagerImpl implements VmwareStorageManager {
     @Override
@@ -142,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)) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a4a2911/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
index ba72e8f..d1b8be8 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
@@ -18,6 +18,17 @@
  */
 package com.cloud.storage.resource;
 
+import java.io.File;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.storage.command.CopyCmdAnswer;
+import org.apache.cloudstack.storage.command.CopyCommand;
+import org.apache.cloudstack.storage.command.DeleteCommand;
+import org.apache.cloudstack.storage.to.SnapshotObjectTO;
+import org.apache.cloudstack.storage.to.TemplateObjectTO;
+import org.apache.cloudstack.storage.to.VolumeObjectTO;
+
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.to.DataObjectType;
 import com.cloud.agent.api.to.DataStoreTO;
@@ -27,15 +38,6 @@ import com.cloud.agent.api.to.S3TO;
 import com.cloud.agent.api.to.SwiftTO;
 import com.cloud.hypervisor.vmware.manager.VmwareStorageManager;
 import com.cloud.storage.DataStoreRole;
-import org.apache.cloudstack.storage.command.CopyCmdAnswer;
-import org.apache.cloudstack.storage.command.CopyCommand;
-import org.apache.cloudstack.storage.command.DeleteCommand;
-import org.apache.cloudstack.storage.to.SnapshotObjectTO;
-import org.apache.cloudstack.storage.to.TemplateObjectTO;
-import org.apache.cloudstack.storage.to.VolumeObjectTO;
-import org.apache.log4j.Logger;
-
-import java.io.File;
 
 public class VmwareStorageSubsystemCommandHandler extends StorageSubsystemCommandHandlerBase
{
     private static final Logger s_logger = Logger.getLogger(VmwareStorageSubsystemCommandHandler.class);
@@ -90,6 +92,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;
@@ -110,7 +115,7 @@ public class VmwareStorageSubsystemCommandHandler extends StorageSubsystemComman
                 } catch (Exception e) {
                     s_logger.debug("Failed to clean up staging area:", e);
                 }
-                return result;                
+                return result;
             }
             needDelegation = true;
         }


Mime
View raw message