cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtutkow...@apache.org
Subject git commit: updated refs/heads/4.4 to ac35238
Date Tue, 01 Apr 2014 03:20:17 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 c388afc8c -> ac352388b


CLOUDSTACK-6170 (VMware root-disk support for managed storage)


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

Branch: refs/heads/4.4
Commit: ac352388b0c07671a54f993b53ef4141a938d808
Parents: c388afc
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Mon Mar 31 00:36:29 2014 -0600
Committer: Mike Tutkowski <mike.tutkowski@solidfire.com>
Committed: Mon Mar 31 21:17:11 2014 -0600

----------------------------------------------------------------------
 .../hypervisor/vmware/manager/VmwareHostService.java      |  2 +-
 .../cloud/hypervisor/vmware/resource/VmwareResource.java  |  9 +++++----
 .../resource/VmwareSecondaryStorageResourceHandler.java   |  2 +-
 .../cloud/storage/resource/VmwareStorageProcessor.java    | 10 +++++-----
 4 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac352388/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java
index db67b6b..c232a60 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java
@@ -38,7 +38,7 @@ public interface VmwareHostService {
             String chapTargetUsername, String chapTargetSecret) throws Exception;
 
     ManagedObjectReference prepareManagedStorage(VmwareHypervisorHost hyperHost, String iScsiName,
-            String storageHost, int storagePort, String chapInitiatorUsername, String chapInitiatorSecret,
+            String storageHost, int storagePort, String volumeName, String chapInitiatorUsername,
String chapInitiatorSecret,
             String chapTargetUsername, String chapTargetSecret, long size, Command cmd) throws
Exception;
 
     void handleDatastoreAndVmdkDetach(String iqn, String storageHost, int storagePort) throws
Exception;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac352388/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index d3fcc06..4f7d450 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -1834,14 +1834,14 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
 
     @Override
     public ManagedObjectReference prepareManagedStorage(VmwareHypervisorHost hyperHost, String
iScsiName,
-            String storageHost, int storagePort, String chapInitiatorUsername, String chapInitiatorSecret,
+            String storageHost, int storagePort, String volumeName, String chapInitiatorUsername,
String chapInitiatorSecret,
             String chapTargetUsername, String chapTargetSecret, long size, Command cmd) throws
Exception {
         ManagedObjectReference morDs = prepareManagedDatastore(hyperHost, iScsiName, storageHost,
storagePort,
                 chapInitiatorUsername, chapInitiatorSecret, chapTargetUsername, chapTargetSecret);
 
         DatastoreMO dsMo = new DatastoreMO(getServiceContext(null), morDs);
 
-        String volumeDatastorePath = String.format("[%s] %s.vmdk", dsMo.getName(), dsMo.getName());
+        String volumeDatastorePath = String.format("[%s] %s.vmdk", dsMo.getName(), volumeName
!= null ? volumeName : dsMo.getName());
 
         if (!dsMo.fileExists(volumeDatastorePath)) {
             createVmdk(cmd, dsMo, volumeDatastorePath, size);
@@ -2350,12 +2350,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                         if (morDatastore == null) {
                             morDatastore = prepareManagedStorage(hyperHost, iScsiName,
                                     details.get(DiskTO.STORAGE_HOST), Integer.parseInt(details.get(DiskTO.STORAGE_PORT)),
+                                    volumeTO.getVolumeType() == Volume.Type.ROOT ? volumeTO.getName()
: null,
                                     details.get(DiskTO.CHAP_INITIATOR_USERNAME), details.get(DiskTO.CHAP_INITIATOR_SECRET),
                                     details.get(DiskTO.CHAP_TARGET_USERNAME), details.get(DiskTO.CHAP_TARGET_SECRET),
                                     Long.parseLong(details.get(DiskTO.VOLUME_SIZE)), cmd);
 
                             DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDatastore);
-                            String datastoreVolumePath = dsMo.getDatastorePath(dsMo.getName()
+ ".vmdk");
+                            String datastoreVolumePath = dsMo.getDatastorePath((volumeTO.getVolumeType()
== Volume.Type.ROOT ? volumeTO.getName() : dsMo.getName()) + ".vmdk");
 
                             volumeTO.setPath(datastoreVolumePath);
                             vol.setPath(datastoreVolumePath);
@@ -3433,7 +3434,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
             ManagedObjectReference morDs = null;
 
             if (cmd.getAttach() && cmd.isManaged()) {
-                morDs = prepareManagedStorage(hyperHost, cmd.get_iScsiName(), cmd.getStorageHost(),
cmd.getStoragePort(),
+                morDs = prepareManagedStorage(hyperHost, cmd.get_iScsiName(), cmd.getStorageHost(),
cmd.getStoragePort(), null,
                         cmd.getChapInitiatorUsername(), cmd.getChapInitiatorPassword(),
                         cmd.getChapTargetUsername(), cmd.getChapTargetPassword(), cmd.getVolumeSize(),
cmd);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac352388/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
index f23e74c..96c6d32 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java
@@ -323,7 +323,7 @@ public class VmwareSecondaryStorageResourceHandler implements SecondaryStorageRe
 
     @Override
     public ManagedObjectReference prepareManagedStorage(VmwareHypervisorHost hyperHost, String
iScsiName,
-            String storageHost, int storagePort, String chapInitiatorUsername, String chapInitiatorSecret,
+            String storageHost, int storagePort, String volumeName, String chapInitiatorUsername,
String chapInitiatorSecret,
             String chapTargetUsername, String chapTargetSecret, long size, Command cmd) throws
Exception {
         throw new OperationNotSupportedException();
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac352388/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
index b6639f4..7ecc2ac 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
@@ -277,10 +277,10 @@ public class VmwareStorageProcessor implements StorageProcessor {
                         managed ? managedStoragePoolRootVolumeName : templateUuidName);
 
                 if (managed) {
-                    String[] vmwareLayoutFilePair = VmwareStorageLayoutHelper.getVmdkFilePairDatastorePath(dsMo,
managedStoragePoolRootVolumeName, managedStoragePoolRootVolumeName,
-                        VmwareStorageLayoutType.VMWARE, false);
-                    String[] legacyCloudStackLayoutFilePair = VmwareStorageLayoutHelper.getVmdkFilePairDatastorePath(dsMo,
null, managedStoragePoolRootVolumeName,
-                        VmwareStorageLayoutType.CLOUDSTACK_LEGACY, false);
+                    String[] vmwareLayoutFilePair = VmwareStorageLayoutHelper.getVmdkFilePairDatastorePath(dsMo,
managedStoragePoolRootVolumeName,
+                        managedStoragePoolRootVolumeName, VmwareStorageLayoutType.VMWARE,
false);
+                    String[] legacyCloudStackLayoutFilePair = VmwareStorageLayoutHelper.getVmdkFilePairDatastorePath(dsMo,
null,
+                        managedStoragePoolRootVolumeName, VmwareStorageLayoutType.CLOUDSTACK_LEGACY,
false);
 
                     dsMo.moveDatastoreFile(vmwareLayoutFilePair[0], dcMo.getMor(), dsMo.getMor(),
legacyCloudStackLayoutFilePair[0], dcMo.getMor(), true);
                     dsMo.moveDatastoreFile(vmwareLayoutFilePair[1], dcMo.getMor(), dsMo.getMor(),
legacyCloudStackLayoutFilePair[1], dcMo.getMor(), true);
@@ -1254,7 +1254,7 @@ public class VmwareStorageProcessor implements StorageProcessor {
             if (isAttach && isManaged) {
                 Map<String, String> details = disk.getDetails();
 
-                morDs = hostService.prepareManagedStorage(hyperHost, iScsiName, storageHost,
storagePort,
+                morDs = hostService.prepareManagedStorage(hyperHost, iScsiName, storageHost,
storagePort, null,
                             details.get(DiskTO.CHAP_INITIATOR_USERNAME), details.get(DiskTO.CHAP_INITIATOR_SECRET),
                             details.get(DiskTO.CHAP_TARGET_USERNAME), details.get(DiskTO.CHAP_TARGET_SECRET),
                             volumeTO.getSize(), cmd);


Mime
View raw message