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/master to bd2d875
Date Mon, 26 Aug 2013 22:08:49 GMT
Updated Branches:
  refs/heads/master 652720a41 -> bd2d87507


Make Mutual CHAP optional for VMware.

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

Branch: refs/heads/master
Commit: bd2d87507396f939e5abdbb41ed17bb72aa71358
Parents: 652720a
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Mon Aug 26 16:08:37 2013 -0600
Committer: Mike Tutkowski <mike.tutkowski@solidfire.com>
Committed: Mon Aug 26 16:08:37 2013 -0600

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java | 12 ++++++++----
 .../driver/SolidfirePrimaryDataStoreDriver.java    | 17 +++++++++++++----
 .../SolidFirePrimaryDataStoreLifeCycle.java        | 11 +++++++++++
 .../storage/datastore/util/SolidFireUtil.java      |  2 ++
 4 files changed, 34 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd2d8750/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 5c743d5..64dfd20 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
@@ -4411,10 +4411,14 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         auth.setChapAuthenticationType(strAuthType);
         auth.setChapName(chapName);
         auth.setChapSecret(chapSecret);
-        auth.setMutualChapInherited(false);
-        auth.setMutualChapAuthenticationType(strAuthType);
-        auth.setMutualChapName(mutualChapName);
-        auth.setMutualChapSecret(mutualChapSecret);
+
+        if (StringUtils.isNotBlank(mutualChapName) &&
+            StringUtils.isNotBlank(mutualChapSecret)) {
+            auth.setMutualChapInherited(false);
+            auth.setMutualChapAuthenticationType(strAuthType);
+            auth.setMutualChapName(mutualChapName);
+            auth.setMutualChapSecret(mutualChapSecret);
+        }
 
         target.setAuthenticationProperties(auth);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd2d8750/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
index 8c00b8e..c73e409 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
@@ -203,13 +203,22 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver
{
 
         String chapInitiatorSecret = accountDetail.getValue();
 
-        accountDetail = _accountDetailsDao.findDetail(accountId, SolidFireUtil.CHAP_TARGET_USERNAME);
+        StoragePoolDetailVO storagePoolDetail = _storagePoolDetailsDao.findDetail(volumeInfo.getPoolId(),
SolidFireUtil.USE_MUTUAL_CHAP_FOR_VMWARE);
 
-        String chapTargetUsername = accountDetail.getValue();
+        boolean useMutualChapForVMware = new Boolean(storagePoolDetail.getValue());
 
-        accountDetail = _accountDetailsDao.findDetail(accountId, SolidFireUtil.CHAP_TARGET_SECRET);
+        String chapTargetUsername = null;
+        String chapTargetSecret = null;
 
-        String chapTargetSecret = accountDetail.getValue();
+        if (useMutualChapForVMware) {
+            accountDetail = _accountDetailsDao.findDetail(accountId, SolidFireUtil.CHAP_TARGET_USERNAME);
+
+            chapTargetUsername = accountDetail.getValue();
+
+            accountDetail = _accountDetailsDao.findDetail(accountId, SolidFireUtil.CHAP_TARGET_SECRET);
+
+            chapTargetSecret = accountDetail.getValue();
+        }
 
         return new ChapInfoImpl(chapInitiatorUsername, chapInitiatorSecret,
                 chapTargetUsername, chapTargetSecret);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd2d8750/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
index ab3ef61..f1ac3b3 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/lifecycle/SolidFirePrimaryDataStoreLifeCycle.java
@@ -157,6 +157,17 @@ public class SolidFirePrimaryDataStoreLifeCycle implements PrimaryDataStoreLifeC
         details.put(SolidFireUtil.CLUSTER_DEFAULT_MAX_IOPS, String.valueOf(lClusterDefaultMaxIops));
         details.put(SolidFireUtil.CLUSTER_DEFAULT_BURST_IOPS_PERCENT_OF_MAX_IOPS, String.valueOf(fClusterDefaultBurstIopsPercentOfMaxIops));
 
+        String useMutualChapForVMware = getValue(SolidFireUtil.USE_MUTUAL_CHAP_FOR_VMWARE,
url);
+
+        if (useMutualChapForVMware == null || new Boolean(useMutualChapForVMware)) {
+            useMutualChapForVMware = Boolean.TRUE.toString();
+        }
+        else {
+            useMutualChapForVMware = Boolean.FALSE.toString();
+        }
+
+        details.put(SolidFireUtil.USE_MUTUAL_CHAP_FOR_VMWARE, useMutualChapForVMware);
+
         // this adds a row in the cloud.storage_pool table for this SolidFire cluster
     	return dataStoreHelper.createPrimaryDataStore(parameters);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd2d8750/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/util/SolidFireUtil.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/util/SolidFireUtil.java
b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/util/SolidFireUtil.java
index e7ac042..ac11272 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/util/SolidFireUtil.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/util/SolidFireUtil.java
@@ -75,6 +75,8 @@ public class SolidFireUtil
     public static final String CHAP_TARGET_USERNAME = "chapTargetUsername";
     public static final String CHAP_TARGET_SECRET = "chapTargetSecret";
 
+    public static final String USE_MUTUAL_CHAP_FOR_VMWARE = "useMutualChapForVMware";
+
     public static long createSolidFireVolume(String strSfMvip, int iSfPort, String strSfAdmin,
String strSfPassword,
             String strSfVolumeName, long lSfAccountId, long lTotalSize, boolean bEnable512e,
             long lMinIops, long lMaxIops, long lBurstIops)


Mime
View raw message