Welcome to StarWind Forum.
NFS should also be available with the free license in GUI.
Try doing the following
- replace the /opt/starwind/starwind-mgmt-scripts/fileservices/get_shares_list.py with
Code: Select all
#!/usr/bin/env python3
import argparse
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
import decorators
import management_rest
from logger import fslog
from schema import Schema
from utils import (
get_instance_ips,
get_instance_shares,
get_node_id,
get_owner,
get_share_uid,
get_used_space,
get_volume_data,
)
@decorators.AddJsonStatus()
def get_shares_list():
# Initialize
result = []
token = management_rest.create_jwt_token()
node_id = get_node_id()
owner = get_owner()
# Fetch volumes and networks concurrently
with ThreadPoolExecutor() as executor:
volumes_future = executor.submit(management_rest.get_volumes, token, node_id)
networks_future = executor.submit(management_rest.get_networks, token, node_id)
# Wait for results
volumes = volumes_future.result()
networks = networks_future.result()
ips = get_instance_ips(networks)
shares = get_instance_shares()
# Process each share concurrently
def process_share(share):
try:
file_share_uid = get_share_uid(node_id, share['pathOnVolume'], share['fileShareType'])
volume_data = get_volume_data(volumes['rows'], share['volumeName'])
if not volume_data:
fslog.error(f'Failed to retrieve volume data for "{share["volumeName"]}".')
return None
used_capacity = get_used_space(share['pathOnVolume'])
free_capacity = volume_data['freeSpaceBytes']
network_paths = [
f"\\\\{ip}\{share['fileShareName']}" if share['fileShareType'] == 'SMB' else f"{ip}:{share['pathOnVolume']}"
for ip in ips
]
# Build the share entry
share.update({
'nodeId': node_id,
'fileShareUid': file_share_uid,
'networkPath': network_paths,
'owner': owner,
'usedCapacityBytes': used_capacity,
'freeCapacityBytes': free_capacity,
})
return share
except Exception as e:
fslog.error(f"Error processing share {share}: {e}")
return None
# Run share processing in parallel
with ThreadPoolExecutor() as executor:
futures = [executor.submit(process_share, share) for share in shares]
for future in as_completed(futures):
share_result = future.result()
if share_result:
result.append(share_result)
# Validate schema
Schema.validate_schema(result, 'get_shares_list')
# Log and return the result
fslog.info(f"Response: {result}")
return json.dumps(result)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.set_defaults(func=get_shares_list)
args = parser.parse_args()
args.func()
- Navigate to WEB and see if the shares are there. (Please wait for ~30 s)
The problem you are referring to is a known issue, we plan fixing it in future builds.
please also note that the triall version is not intended for production.