Create a SMB File Storage with AD
Last updated
Last updated
Address
VNG CorporationTo create an SMB (Server Message Block) with Active Directory on the File Storage system, you can follow these steps:
Below is a basic guide for initializing Windows server on vServer, if you already have a server, skip this step.
Attention:
Security Groups on Windows server need to open the following ports to share data:
With NFS File Storage: open additional port 2049
With SMB File Storage with Basic Authentication: open additional port 445
With SMB File Storage with Active Directory Authentication: open additional port list to be able to connect from File Storage to AD.
Below is a basic guide for connecting to Windows server on vServer, if you have used Console directly on vServer Portal, please skip this step.
After you have connected to Windows server, you need to make sure your Windows server has a static IP address, you can check and configure static IP according to the following instructions:
Check the VM's network configuration by:
Go to Control Panel > Network & Internet > Network Connections .
Select the Ethernet adapter , right-click and select Properties .
Set up a static IP address:
In the Properties screen , select Internet Protocol Version 4 (TCP/IPv4) and then click the Properties button .
Select Use the following IP address to set up a static IP address.
Provide address information:
IP Address: static IP address of the VM.
Subnet Mask: Corresponding subnet, for example: 255.0.0.0
Preferred DNS server: IP address of DNS Domain (usually also the static IP address of VM) (you can add it after initializing DNS domain according to the instructions below)
To create an Active Directory on Windows Server, you need to do the following:
Install and configure DNS Server
Create a Forward Lookup Zone
Create a Reverse Lookup Zone
Check DNS Name
Install and configure Active Directory
Specifically, please follow the steps below:
To install and configure DNS Server on Windows Server, you can follow these steps:
From the Desktop screen , open the Start menu and select Server Manager.
Select All Servers, right click then select Add roles and Features
On the Before you begin page, click Next
On the Installation Type page : Select Role-based or feature-based installation then select Next
In Server Selection : select Select a server from the server pool and select the current server then select Next
In Server Roles : Tick DNS Server then click Next and Install to install.
At this point, you will be prompted to add the necessary features for the DNS Server, select Add Features if you agree with the defaults.
On the Confirmation page , review your selections and click Install to begin installing the DNS Server.
Once the installation is complete, click Close .
Next, you will need to create a Forward Lookup Zone to convert the domain to an IP address. Here are the steps:
Open DNS Manager by selecting Tools , then selecting DNS
In DNS Manager, select the existing DNS and continue to right-click on Forward Lookup Zones and select New Zone
The Create new zone screen appears, continue to select Next
At the Zone Type screen : select Primary zone, then select Next
At the Zone Name screen : enter your domain name and select Next . For example: example.local
. Remember this domain because this is the DNS domain you need to use to create AD and enter information when creating File Storage on the File Storage Portal system.
At the Zone File screen , select Next
At the Dynamic Update screen : Select Do not allow dynamic updates , then select Next
Select Finish to complete creating the New Zone.
After selecting Finish , you will see the forwarding lookup zone on the main screen as shown.
After creating the zone, you need to add a record for the Domain Controller by selecting the newly created Zone , right-clicking and selecting New Host (A or AAAA)
On the New Host screen , you need to:
Name : Enter your Windows server name (eg: demo-smb
).
IP Address : Enter the static IP address of the Domain Controller (eg: 10.50.3.9
).
Click Add Host .
If you choose Create associated pointer (PTR) record , you need to create a Reverse Loopup Zone , the initialization steps are similar to creating a Forward Lookup Zone .
Next, you will need to create a Reverse Lookup Zone to convert the IP to a domain. Specifically, the steps are as follows:
Open DNS Manager by selecting Tools , then selecting DNS
In DNS Manager, select the existing DNS and continue to right-click on Reverse Lookup Zones and select New Zone
At the Zone Type screen : select Primary zone, then select Next
The Create new zone screen appears, select IPv4 Reverse Lookup Zone and continue to select Next.
At the Reverse Lookup Zone Name screen : enter Network ID, the Network ID here is the subnet of the IP that you need to perform reverse lookup and select Next . For example: 10.50.3
.
At the Zone File screen , you can create a new Zone File or select an existing Zone File, then select Next.
At the Dynamic Update screen : Select Do not allow dynamic updates , then select Next
Select Finish to complete creating the New Zone.
After selecting Finish , you will see Reverse lookup zone on the main screen as shown
After creating a reverse lookup zone , you need to create a Pointer (PTR) by selecting the newly created Zone , right-clicking and selecting New Pointer (PTR)
On the New Resource Record screen , you need to:
Host IP Address : Enter the static IP address of the Domain Controller (eg: 10.50.3.9
).
Host Name: Enter your Windows server name (eg: demo-smb
).
Click OK .
On your Windows server, open Command Prompt and run:
For example:
The result displays an example as follows:
To install and configure Active Directory Domain Service on Windows Server, you can follow these steps:
From the Desktop screen , open the Start menu and select Server Manager
Select All Servers, right click then select Add roles and Features
In the Before You Begin section , select Next
In Installation Type : Select Role-based or feature-based installation then select Next
In Server Selection : select Select a server from the server pool and select the current server then select Next
In the Server Roles section : Tick Active Directory Domain Services.
At this point, you will be prompted to add the required features to Active Directory, select Add Features if you agree with the defaults, then select Next
On the Feature page , keep the default parameters and select Next
On the AD DS page, select Next
On the Confirmation page , review your selections and click Install to begin installing AD DS.
After selecting Install . The system will start installing, you do not need to restart the server immediately after installation.
When the installation is complete, you continue to select Promote this server to a domain controller
At the Deployment Configuration screen , select Add a new forest then enter the DNS domain name created (which is the Zone name created in the Create a Forward Lookup Zone step) then select Next
At the Domain Controller Options screen , enter the Password and Confirm Password for your DSRM.
In the DNS Option section, you skip it and just click Next.
In the Additional Options section , check the NetBIOS name again and change it if necessary, then select Next. The NetBIOS domain name is a shortened domain of the Root domain name,
At the Paths screen , you can change the paths to the Database folder, Log file folder, Sysvol or keep them as the system default, then select Next.
At the Review Options screen , review the parameters and select Next if the information is correct.
At the Prerequisites Check screen , you will see the test results, continue to select Install for the system to install AD.
After the installation process is complete, the system will automatically restart your server, you need to log back into the server with the Administrator account.
Attention:
You can grant permissions to AD accounts or groups through Group Policy or ACL access permissions. For more details, see here .
Step 1: Go to https://efs.console.vngcloud.vn/overview
Step 2: Select File Storage then select Create a File storage.
Step 3: At the File Storage initialization screen, you need to enter/select:
File Storage name: the descriptive name of the storage file. The file name must be between 5 and 50 characters long and can include the characters a-z, AZ, 0-9, '-', '_'
Description : enter a description for the storage file.
File storage type: select the type of drive you want to use. Currently we only provide Standard HDD drive type.
Protocol: select NFS and the NFS version you want
Tag: you can add tags to mark file storage as needed.
File Storage Max quota: in the file storage initialization step, you need to set a maximum quota limit for that file storage. This quota means the limit of storage capacity that the file storage can use, helping to manage resources effectively. The minimum quota you need to choose is 1 TB and the maximum quota we provide is 50 TB. If you need to use more than 50 TB for a file storage, please contact us.
Network type : for SMB file type, network type must be Private. At this point, you need to select VPC , Subnet that you have created from vServer Portal.
Window Authentication: Configure access rights via Active Directory Authentication
Active Directory Authentication: If your Windows server uses Active Directory to manage users and access, AD Authentication is easy to integrate and centrally manage. You can authenticate via Active Directory domain name, DNS server IP addresses, Username, Password on your Active Directory. For example, for the Active Directory created above, I would enter:
Active Directory domain name : This is the Root domain name you created in the step of Installing and configuring Active Directory Domain Services . For example:example.local
DNS server IP Address : DNS Server IP address, usually also the static IP address of the VM, for example: 10.50.3.9.
If you have 2 DNS IPs, you can enter according to the form 10.50.3.3,10.50.3.9
Username: Admin account name, for exampleAdministrator
Password : The password you created in the Install and configure Active Directory Domain Services step , for example:123456789aA@
Confirm Password: Confirm password, for example:123456789aA@
Step 5: Select Create File Storage.
Step 6: After the system has completed initializing the SMB File Storage, you can get the File Storage IP Address information in the File Storage details section and continue to perform the steps below.
On Windows Server, you can map SMB file storage through the interface or command line.
Open File Explorer.
Right click on This PC and select Map network drive .
In the Map Network Drive window :
Drive letter : Select a drive letter (eg: Z:
).
Folder : Enter the SMB share path, for example: \\<File Storage IP Address>\<File Storage Name>
. For example \\10.50.3.8\demo-smb
.
Select Finish , once done, you can check in File Explorer to see the mapped drive.
Attention:
To automatically map the SMB storage file each time Windows Server starts, you can save the information when mapping through the interface by checking the Reconnect at sign-in box before clicking Finish .
Use the following command in Command Prompt or PowerShell :
Z: : Is the drive letter you want to mount.
\\<File Storage IP Address>\<File Storage Name> : File Storage SMB path.
For example:
More simply, you can also directly access the SMB File Storage via File Explorer through the following steps:
Open File Explorer : Press Windows key + E or click the File Explorer icon.
Enter UNC Path : In the address bar, enter the UNC path to the file share. For example:
Press Enter .
After you have successfully mapped the SMB File Storage to Windows Server, you can write data to the File Storage as follows:
Open a text editor (Notepad):
On Windows Server, open Notepad by:
Click Start and type Notepad , then press Enter .
Or, press Windows key + R , type notepad
and press Enter .
Write content to file:
In Notepad, type something simple, for example:
Copy
Or enter whatever content you want.
Save file to SMB file storage:
Click File > Save As... .
In the Save As dialog box , navigate to the drive that you mapped the SMB share to (eg: Z:
).
Name the file (eg: testfile.txt
).
Click Save to save the file.
Check files in SMB share:
Open File Explorer (shortcut: Windows + E ).
Navigate to the SMB drive (eg. Z:
).
Find and open the file testfile.txt
you just saved to verify the contents.