Creating File Service Domain
You can create file service domain using the vSphere Client during the vSAN File Service configuration process. To begin the configuration process, navigate to the vSAN cluster and click Configure > vSAN > Services. On the File Service row, click Enable. Follow the wizard to configure the vSAN File Service including creating the file service domain.
Here is an example of how to create file service domain using the vSAN Management API. This example is based on the code in the vsanfssamples.py sample file located under the Python sample code directory.
# Create file service domain fsDomainConfig = getFileServiceDomainConfig() domainName = fsDomainConfig.name print("Creating file service domain") vsanTask = vcfs.CreateFileServiceDomain(fsDomainConfig, cluster) vcTask = vsanapiutils.ConvertVsanTaskToVcTask(vsanTask, si._stub) vsanapiutils.WaitForTasks([vcTask], si) if vcTask.info.state != 'success': print("Failed to create file service domain with error: %s" % vcTask.info.error) return -1 print("Created file service domain %s successfully" % domainName)