CLOUDSTACK-9044: Add RBD Primary Storage to the Zone Wizard.

This commit is contained in:
Boris Schrijver 2015-11-08 18:22:39 +01:00
parent f948e96299
commit c4f64dce21

View File

@ -1371,6 +1371,10 @@
id: "SharedMountPoint",
description: "SharedMountPoint"
});
items.push({
id: "rbd",
description: "RBD"
});
items.push({
id: "clvm",
description: "CLVM"
@ -1444,6 +1448,10 @@
id: "SharedMountPoint",
description: "SharedMountPoint"
});
items.push({
id: "rbd",
description: "RBD"
});
args.response.success({
data: items
});
@ -1489,9 +1497,15 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').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');
@ -1508,6 +1522,11 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').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();
@ -1527,6 +1546,11 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "PreSetup") {
$form.find('[rel=server]').hide();
@ -1547,6 +1571,11 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "iscsi") {
$form.find('[rel=server]').css('display', 'block');
@ -1566,6 +1595,11 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').hide();
} else if ($(this).val() == "clvm") {
$form.find('[rel=server]').hide();
@ -1585,6 +1619,11 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "vmfs") {
$form.find('[rel=server]').css('display', 'block');
@ -1604,6 +1643,11 @@
$form.find('[rel=vCenterDataCenter]').css('display', 'block');
$form.find('[rel=vCenterDataStore]').css('display', 'block');
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "SharedMountPoint") { //"SharedMountPoint" show the same fields as "nfs" does.
$form.find('[rel=server]').hide();
@ -1623,6 +1667,11 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "gluster") {
$form.find('[rel=server]').css('display', 'block');
@ -1642,7 +1691,38 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').css('display', 'block');
} else if (protocol == "rbd") {
$form.find('[rel=rbdmonitor]').css('display', 'inline-block');
$form.find('[rel=rbdmonitor]').find(".name").find("label").text("RADOS Monitor:");
$form.find('[rel=rbdpool]').css('display', 'inline-block');
$form.find('[rel=rbdpool]').find(".name").find("label").text("RADOS Pool:");
$form.find('[rel=rbdid]').css('display', 'inline-block');
$form.find('[rel=rbdid]').find(".name").find("label").text("RADOS User:");
$form.find('[rel=rbdsecret]').css('display', 'inline-block');
$form.find('[rel=rbdsecret]').find(".name").find("label").text("RADOS Secret:");
$form.find('[rel=server]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=path]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=glustervolume]').hide();
} else {
$form.find('[rel=server]').css('display', 'block');
$form.find('[rel=server]').find(".value").find("input").val("");
@ -1659,6 +1739,11 @@
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=rbdmonitor]').hide();
$form.find('[rel=rbdpool]').hide();
$form.find('[rel=rbdid]').hide();
$form.find('[rel=rbdsecret]').hide();
$form.find('[rel=glustervolume]').hide();
}
});
@ -1758,6 +1843,40 @@
isHidden: true
},
// RBD
rbdmonitor: {
label: 'label.rbd.monitor',
docID: 'helpPrimaryStorageRBDMonitor',
validation: {
required: true
},
isHidden: true
},
rbdpool: {
label: 'label.rbd.pool',
docID: 'helpPrimaryStorageRBDPool',
validation: {
required: true
},
isHidden: true
},
rbdid: {
label: 'label.rbd.id',
docID: 'helpPrimaryStorageRBDId',
validation: {
required: false
},
isHidden: true
},
rbdsecret: {
label: 'label.rbd.secret',
docID: 'helpPrimaryStorageRBDSecret',
validation: {
required: false
},
isHidden: true
},
//always appear (begin)
storageTags: {
label: 'label.storage.tags',
@ -4398,6 +4517,12 @@
if (vg.substring(0, 1) != "/")
vg = "/" + vg;
url = clvmURL(vg);
} else if (args.data.primaryStorage.protocol == "rbd") {
var rbdmonitor = args.data.primaryStorage.rbdmonitor;
var rbdpool = args.data.primaryStorage.rbdpool;
var rbdid = args.data.primaryStorage.rbdid;
var rbdsecret = args.data.primaryStorage.rbdsecret;
url = rbdURL(rbdmonitor, rbdpool, rbdid, rbdsecret);
} else if (args.data.primaryStorage.protocol == "vmfs") {
var path = args.data.primaryStorage.vCenterDataCenter;
if (path.substring(0, 1) != "/")