Connect file storage to a cloud server in a single pool
If you need to increase disk space using file storage, we recommend creating the storage in the same pool as the cloud server. If the file storage and the cloud server are in the same pool, you need to mount the storage to connect it.
If you plan to use file storage to store backups, we recommend creating the storage and cloud server in pools from different availability zones or regions to improve fault tolerance. Refer to the instruction Connect file storage to a cloud server in a different pool.
1. Create file storage
Control panel
OpenStack CLI
Terraform
-
In the Control panel, from the top menu click Products and select File Storage.
-
Click Create Storage.
-
Enter a name for the storage or keep the automatically generated one.
-
Select a location where the storage will be created.
If you need to increase disk space with file storage, select the location where your cloud server or Managed Kubernetes cluster is located.
If you plan to use the storage for backups, we recommend choosing a location different from your primary infrastructure location to increase fault tolerance.
-
Fill in the sections:
-
Check the cost of the file storage.
-
Click Create.
Subnet
-
Select a private subnet where the storage will be located. The subnet type depends on what you need to connect the storage to:
- cloud private subnet — the storage will be available for cloud servers and Managed Kubernetes clusters only in the pool you selected when creating the storage. To connect the storage, you will only need to mount it;
- global router subnet — the storage will be available for dedicated servers, as well as cloud servers and Managed Kubernetes clusters that are in other pools. To connect the storage, you need to configure network connectivity between the server or cluster and the storage via the global router. See examples of configuring network connectivity in the instructions in the Connect File Storage section.
Once the storage is created, the subnet cannot be changed.
-
Enter the private IP address for the storage or leave the first available address from the subnet, which is assigned by default. Once the storage is created, the IP address cannot be changed.
Settings
-
Select the file storage type:
- HDD Basic,
- SSD Universal,
- SSD Fast.
Once the storage is created, the storage type cannot be changed.
-
Specify the storage size: from 50 GB to 50 TB. After creation, you can increase the file storage, but you cannot decrease it.
-
Select a protocol:
- NFSv4 — for connecting storage to servers running Linux or other Unix-based OS;
- CIFS SMBv3 — for connecting storage to servers running Windows OS.
Once the storage is created, the protocol cannot be changed.
Access rules
NFSv4
CIFS SMBv3
-
Configure access rules for the file storage:
- accessible to everyone — the storage will be available for any IP address in the private subnet where it is created;
- access restricted — the storage will be available only for specific IP addresses or private subnets. If you create the file storage without rules, access will be restricted for all IP addresses.
-
If you selected Access restricted, click Add rule.
-
Enter the IP address or CIDR of the private subnet and select the access level.
After creating the storage, you can configure new access rules.
2. Mount file storage to a cloud server
The mounting process depends on the operating system on the server and the file storage protocol: NFSv4 or CIFS SMBv3.
NFSv4
CIFS SMBv3
Linux
Windows
-
Open the CLI.
-
Install the package for the NFS protocol:
sudo apt install nfs-common -
Create a folder for mounting the storage:
sudo mkdir -p /mnt/nfs -
Mount the file storage:
sudo mount -vt nfs "<filestorage_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/nfsSpecify:
<filestorage_ip_address>— file storage IP address. You can view it in the control panel: from the top menu, click Products → File Storage → storage page → Settings tab → IP field;<mountpoint_uuid>— mount point ID. You can view it in the control panel: from the top menu, click Products → File Storage → storage page → Connection block → GNU/Linux tab.