This commit is contained in:
Fred Park 2017-03-30 19:48:17 -07:00
Родитель 667d273c09
Коммит b426ce9c39
6 изменённых файлов: 42 добавлений и 8 удалений

Просмотреть файл

@ -38,6 +38,7 @@
"ssh": ["*"],
"nfs": ["1.2.3.0/24", "2.3.4.5"],
"glusterfs": ["1.2.3.0/24", "2.3.4.5"],
"smb": ["6.7.8.9"],
"custom_inbound_rules": {
"myrule": {
"destination_port_range": "5000-5001",

Просмотреть файл

@ -2101,8 +2101,10 @@ def stat_storage_cluster(
compute_client, network_client, config, sc_id, None, vm.name,
nic=nic, pip=pip)
offset = settings.get_offset_from_virtual_machine_name(vm.name)
script_cmd = '/opt/batch-shipyard/{sf} {f}{m}{n}{r}{s}'.format(
script_cmd = '/opt/batch-shipyard/{sf} {c}{f}{m}{n}{r}{s}'.format(
sf=status_script,
c=' -c' if util.is_not_empty(
rfs.storage_cluster.file_server.samba.share_name) else '',
f=' -f {}'.format(
rfs.storage_cluster.vm_disk_map[offset].filesystem),
m=' -m {}'.format(

Просмотреть файл

@ -2594,11 +2594,19 @@ def remotefs_settings(config, sc_id=None):
list):
raise ValueError(
'expected list for glusterfs network security rule')
if 'smb' in ns_conf:
sc_ns_inbound['smb'] = InboundNetworkSecurityRule(
destination_port_range='445',
source_address_prefix=_kv_read_checked(ns_conf, 'smb'),
protocol='tcp',
)
if not isinstance(sc_ns_inbound['smb'].source_address_prefix, list):
raise ValueError('expected list for smb network security rule')
if 'custom_inbound_rules' in ns_conf:
# reserve keywords (current and expected possible future support)
_reserved = frozenset(
['ssh', 'nfs', 'glusterfs', 'zfs', 'beegfs', 'samba', 'cifs']
)
_reserved = frozenset([
'ssh', 'nfs', 'glusterfs', 'smb', 'cifs', 'samba', 'zfs', 'beegfs'
])
for key in ns_conf['custom_inbound_rules']:
# ensure key is not reserved
if key.lower() in _reserved:

Просмотреть файл

@ -46,6 +46,7 @@ The remote filesystem schema is as follows:
"ssh": ["*"],
"nfs": ["1.2.3.0/24", "2.3.4.5"],
"glusterfs": ["1.2.3.0/24", "2.3.4.5"],
"smb": ["6.7.8.9"],
"custom_inbound_rules": {
"myrule": {
"destination_port_range": "5000-5001",
@ -219,6 +220,11 @@ to each virtual machine in the storage cluster.
brick ports to be exposed to the specified address prefix. Multiple
address prefixes can be specified. This property is ignored for nfs
clusters.
* (optional) `smb` rule allows the the direct host SMB port to be exposed if
a `samba` configuration is specified under `file_server`. This requires
Windows 2000 or later. Please note the name of this rule is `smb` which
refers to the protocol rather than the `samba` implementation for
providing this service on a non-Windows host.
* (optional) `custom_inbound_rules` are custom inbound rules for other
services that you need to expose.
* (required) `<rule name>` is the name of the rule; the example uses
@ -272,10 +278,10 @@ to each virtual machine in the storage cluster.
automatically provisions the proper GlusterFS FUSE client on compute
nodes that require access to GlusterFS-based storage clusters.
* (optional) `samba` defines properties required for enabling
[SMB/CIFS](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365233(v=vs.85).aspx)
[SMB](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365233(v=vs.85).aspx)
support on storage cluster nodes. This support is accomplished by
running [Samba](https://www.samba.org/) alongside the NFS or GlusterFS
server software. If this section is omitted, SMB/CIFS will be disabled.
server software. If this section is omitted, SMB access will be disabled.
* (required) `share_name` name of the share. The path of this share is
automatically mapped.
* (optional) `account` is a user identity to mount the file share as.

Просмотреть файл

@ -30,6 +30,8 @@ scale up and scale out scenarios.
## Major Features
* Support for multiple file server types: NFS or GlusterFS
* Support for SMB/CIFS on top of NFS or GlusterFS mountpoints to enable
file sharing to Windows clients
* Automatic provisioning of all required resources for the storage cluster
including managed disks, virtual networks, subnets, network interfaces, IP
addresses and DNS labels, network security groups, availability sets, virtual

Просмотреть файл

@ -8,6 +8,7 @@ DEBIAN_FRONTEND=noninteractive
gluster_brick_mountpath=/gluster/brick
# vars
samba=0
filesystem=
mountpath=
gluster_volname=
@ -15,11 +16,12 @@ raid_level=-1
server_type=
# begin processing
while getopts "h?f:m:n:r:s:" opt; do
while getopts "h?cf:m:n:r:s:" opt; do
case "$opt" in
h|\?)
echo "shipyard_remotefs_stat.sh parameters"
echo ""
echo "-c samba enabled"
echo "-f [filesystem] filesystem"
echo "-m [mountpoint] mountpoint"
echo "-n [volume name] volume name"
@ -28,6 +30,9 @@ while getopts "h?f:m:n:r:s:" opt; do
echo ""
exit 1
;;
c)
samba=1
;;
f)
filesystem=${OPTARG,,}
;;
@ -113,10 +118,10 @@ else
echo "$mountpath not mounted"
exit 1
fi
echo ""
# get raid status
if [ $raid_level -ge 0 ]; then
echo ""
if [ $filesystem == "btrfs" ]; then
echo "btrfs device status:"
for disk in "${data_disks[@]}"; do
@ -141,3 +146,13 @@ if [ $raid_level -ge 0 ]; then
mdadm --detail $target
fi
fi
# get samba status
if [ $samba -eq 1 ]; then
echo ""
echo "smbd service status:"
systemctl status smbd.service
echo ""
echo "smbstatus:"
smbstatus
fi