cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 14689d7
Date Tue, 25 Feb 2014 11:09:03 GMT
Add Gluster to the list of protocols in the Management Server

Gluster can now be used for Primary Storage just like NFS. This change adds the
Gluster protocol to the Management Server:

    Infrastructure -> Primary Storage -> Add Primary Storage

And also add the option to create Primary Storage on Gluster when
following the 'Add Zone' wizard from:

    Infrastructure -> Zones -> Add Zone

Some screenshots and verification:
- http://blog.nixpanic.net/2013/12/using-gluster-as-primary-storage-in.html


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

Branch: refs/heads/master
Commit: c02197ae86ba90ee4553fa437a1200e64915649f
Parents: e883877
Author: Niels de Vos <ndevos@redhat.com>
Authored: Sat Nov 23 14:30:40 2013 -0700
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Tue Feb 25 12:08:46 2014 +0100

----------------------------------------------------------------------
 .../classes/resources/messages.properties       |  1 +
 ui/dictionary.jsp                               |  1 +
 ui/scripts/sharedFunctions.js                   |  9 +++
 ui/scripts/system.js                            | 69 +++++++++++++++++++-
 ui/scripts/zoneWizard.js                        | 51 ++++++++++++++-
 5 files changed, 127 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c02197ae/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index bd4a27d..a1752f2 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -603,6 +603,7 @@ label.full=Full
 label.gateway=Gateway
 label.general.alerts=General Alerts
 label.generating.url=Generating URL
+label.gluster.volume=Volume
 label.go.step.2=Go to Step 2
 label.go.step.3=Go to Step 3
 label.go.step.4=Go to Step 4

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c02197ae/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 7ccb466..bf48417 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -607,6 +607,7 @@ dictionary = {
 'label.gateway': '<fmt:message key="label.gateway" />',
 'label.general.alerts': '<fmt:message key="label.general.alerts" />',
 'label.generating.url': '<fmt:message key="label.generating.url" />',
+'label.gluster.volume': '<fmt:message key="label.gluster.volume" />',
 'label.go.step.2': '<fmt:message key="label.go.step.2" />',
 'label.go.step.3': '<fmt:message key="label.go.step.3" />',
 'label.go.step.4': '<fmt:message key="label.go.step.4" />',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c02197ae/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 9fa70e3..f0afea5 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1340,6 +1340,15 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
         return url;
     }
 
+    function glusterURL(server, path) {
+        var url;
+        if (server.indexOf("://") == -1)
+            url = "gluster://" + server + path;
+        else
+            url = server + path;
+        return url;
+    }
+
 
     //VM Instance
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c02197ae/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 8159124..1f64a52 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -15171,6 +15171,10 @@
                                                     id: "clvm",
                                                     description: "CLVM"
                                                 });
+                                                items.push({
+                                                    id: "gluster",
+                                                    description: "Gluster"
+                                                });
                                                 args.response.success({
                                                     data: items
                                                 });
@@ -15277,6 +15281,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if (protocol == "SMB") {
                                                     //"SMB" show almost the same fields as
"nfs" does, except 3 more SMB-specific fields.
                                                     $form.find('.form-item[rel=server]').css('display',
'inline-block');
@@ -15302,6 +15308,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if (protocol == "ocfs2") {
                                                     //ocfs2 is the same as nfs, except no
server field.
                                                     $form.find('.form-item[rel=server]').hide();
@@ -15327,6 +15335,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if (protocol == "PreSetup") {
                                                     $form.find('.form-item[rel=server]').hide();
                                                     $form.find('.form-item[rel=server]').find(".value").find("input").val("localhost");
@@ -15351,6 +15361,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if (protocol == "iscsi") {
                                                     $form.find('.form-item[rel=server]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=server]').find(".value").find("input").val("");
@@ -15373,6 +15385,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if ($(this).val() == "clvm") {
                                                     $form.find('.form-item[rel=server]').hide();
                                                     $form.find('.form-item[rel=server]').find(".value").find("input").val("localhost");
@@ -15395,6 +15409,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if (protocol == "vmfs") {
                                                     $form.find('.form-item[rel=server]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=server]').find(".value").find("input").val("");
@@ -15417,6 +15433,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if (protocol == "SharedMountPoint")
{
                                                     //"SharedMountPoint" show the same fields
as "nfs" does.
                                                     $form.find('.form-item[rel=server]').hide();
@@ -15442,6 +15460,8 @@
                                                     $form.find('.form-item[rel=rbdpool]').hide();
                                                     $form.find('.form-item[rel=rbdid]').hide();
                                                     $form.find('.form-item[rel=rbdsecret]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 } else if (protocol == "rbd") {
                                                     $form.find('.form-item[rel=rbdmonitor]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=rbdmonitor]').find(".name").find("label").text("RADOS
Monitor:");
@@ -15466,6 +15486,33 @@
                                                     $form.find('.form-item[rel=smbUsername]').hide();
                                                     $form.find('.form-item[rel=smbPassword]').hide();
                                                     $form.find('.form-item[rel=smbDomain]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
+                                                } else if (protocol == "gluster") {
+                                                    $form.find('.form-item[rel=server]').css('display',
'inline-block');
+                                                    $form.find('.form-item[rel=server]').find(".value").find("input");
+
+                                                    $form.find('.form-item[rel=glustervolume]').css('display',
'inline-block');
+                                                    $form.find('.form-item[rel=glustervolume]').find(".name").find("label").text("Volume:");
+
+                                                    $form.find('.form-item[rel=path]').hide();
+
+                                                    $form.find('.form-item[rel=smbUsername]').hide();
+                                                    $form.find('.form-item[rel=smbPassword]').hide();
+                                                    $form.find('.form-item[rel=smbDomain]').hide();
+
+                                                    $form.find('.form-item[rel=iqn]').hide();
+                                                    $form.find('.form-item[rel=lun]').hide();
+
+                                                    $form.find('.form-item[rel=volumegroup]').hide();
+
+                                                    $form.find('.form-item[rel=vCenterDataCenter]').hide();
+                                                    $form.find('.form-item[rel=vCenterDataStore]').hide();
+
+                                                    $form.find('.form-item[rel=rbdmonitor]').hide();
+                                                    $form.find('.form-item[rel=rbdpool]').hide();
+                                                    $form.find('.form-item[rel=rbdid]').hide();
+                                                    $form.find('.form-item[rel=rbdsecret]').hide();
                                                 } else {
                                                     $form.find('.form-item[rel=server]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=server]').find(".value").find("input").val("");
@@ -15486,6 +15533,8 @@
                                                     $form.find('.form-item[rel=smbUsername]').hide();
                                                     $form.find('.form-item[rel=smbPassword]').hide();
                                                     $form.find('.form-item[rel=smbDomain]').hide();
+
+                                                    $form.find('.form-item[rel=glustervolume]').hide();
                                                 }
                                             });
                                             
@@ -15613,7 +15662,16 @@
                                         },
                                         isHidden: true
                                     },
-                                    
+
+                                    //gluster
+                                    glustervolume: {
+                                        label: 'label.gluster.volume',
+                                        validation: {
+                                            required: true
+                                        },
+                                        isHidden: true
+                                    },
+
                                     //always appear (begin)
                                     storageTags: {
                                         label: 'label.storage.tags',
@@ -15698,6 +15756,12 @@
                                     path = "/" + path;
                                     path += "/" + args.data.vCenterDataStore;
                                     url = vmfsURL("dummy", path);
+                                } else if (args.data.protocol == "gluster") {
+                                    var glustervolume = args.data.glustervolume;
+
+                                    if (glustervolume.substring(0, 1) != "/")
+                                        glustervolume = "/" + glustervolume;
+                                    url = glusterURL(server, glustervolume);
                                 } else {
                                     var iqn = args.data.iqn;
                                     if (iqn.substring(0, 1) != "/")
@@ -16903,8 +16967,7 @@
                                                 }
                                             },
                                             //SMB (end)
-                                            
-                                            
+
                                             //S3 (begin)
                                             accesskey: {
                                                 label: 'label.s3.access_key',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c02197ae/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index fd5705b..2691586 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -1486,6 +1486,10 @@
                                     id: "clvm",
                                     description: "CLVM"
                                 });
+                                items.push({
+                                    id: "gluster",
+                                    description: "Gluster"
+                                });
                                 args.response.success({
                                     data: items
                                 });
@@ -1587,8 +1591,9 @@
                                     
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+                                    $form.find('[rel=glustervolume]').hide();
                                 } else if (protocol == "SMB") { //"SMB" show almost the same
fields as "nfs" does, except 3 more SMB-specific fields.                                 
                
-                                	$form.find('[rel=server]').css('display', 'block');    
                               
+                               	    $form.find('[rel=server]').css('display', 'block'); 
                                  
                                     $form.find('[rel=server]').find(".value").find("input").val("");
                                     
                                     $form.find('[rel=path]').css('display', 'block');   
                               
@@ -1604,6 +1609,8 @@
                                     
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').hide();
                                 } else if (protocol == "ocfs2") { //ocfs2 is the same as
nfs, except no server field.                                    
                                     $form.find('[rel=server]').hide();                  
                 
                                     $form.find('[rel=server]').find(".value").find("input").val("");
@@ -1621,6 +1628,8 @@
                                    
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').hide();
                                 } else if (protocol == "PreSetup") {                    
              
                                     $form.find('[rel=server]').hide();                  
                
                                     $form.find('[rel=server]').find(".value").find("input").val("localhost");
@@ -1639,6 +1648,8 @@
                                     
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').hide();
                                 } else if (protocol == "iscsi") {                       
            
                                     $form.find('[rel=server]').css('display', 'block'); 
                                 
                                     $form.find('[rel=server]').find(".value").find("input").val("");
@@ -1656,6 +1667,8 @@
                                     
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').hide();
                                 } else if ($(this).val() == "clvm") {                   
                
                                     $form.find('[rel=server]').hide();                  
                 
                                     $form.find('[rel=server]').find(".value").find("input").val("localhost");
@@ -1673,6 +1686,8 @@
                                    
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').hide();
                                 } else if (protocol == "vmfs") {                        
           
                                     $form.find('[rel=server]').css('display', 'block'); 
                                  
                                     $form.find('[rel=server]').find(".value").find("input").val("");
@@ -1690,6 +1705,8 @@
                                    
                                     $form.find('[rel=vCenterDataCenter]').css('display',
'block');
                                     $form.find('[rel=vCenterDataStore]').css('display', 'block');
+
+                                    $form.find('[rel=glustervolume]').hide();
                                 } else if (protocol == "SharedMountPoint") { //"SharedMountPoint"
show the same fields as "nfs" does.                                   
                                     $form.find('[rel=server]').hide();                  
                 
                                     $form.find('[rel=server]').find(".value").find("input").val("localhost");
@@ -1707,6 +1724,27 @@
                                    
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').hide();
+                                } else if (protocol == "gluster") {
+                                    $form.find('[rel=server]').css('display', 'block');
+                                    $form.find('[rel=server]').find(".value").find("input").val("");
+
+                                    $form.find('[rel=path]').hide();
+                                   
+                                    $form.find('[rel=smbUsername]').hide();
+                                    $form.find('[rel=smbPassword]').hide();
+                                    $form.find('[rel=smbDomain]').hide();
+
+                                    $form.find('[rel=iqn]').hide();
+                                    $form.find('[rel=lun]').hide();
+
+                                    $form.find('[rel=volumegroup]').hide();
+
+                                    $form.find('[rel=vCenterDataCenter]').hide();
+                                    $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').css('display', 'block');
                                 } else {                                    
                                     $form.find('[rel=server]').css('display', 'block'); 
                                  
                                     $form.find('[rel=server]').find(".value").find("input").val("");
@@ -1722,6 +1760,8 @@
                                     
                                     $form.find('[rel=vCenterDataCenter]').hide();
                                     $form.find('[rel=vCenterDataStore]').hide();
+
+                                    $form.find('[rel=glustervolume]').hide();
                                 }
                             });
 
@@ -1810,6 +1850,15 @@
                         isHidden: true
                     },
 
+                    //gluster
+                    glustervolume: {
+                        label: 'label.gluster.volume',
+                        validation: {
+                            required: true
+                        },
+                        isHidden: true
+                    },
+
                     //always appear (begin)
                     storageTags: {
                         label: 'label.storage.tags',


Mime
View raw message