IBM Cloud File Share Mount Helper utility
Mount Helper is an open source automation tool that configures and establishes secure communication between the compute host and the file share. It ensures that the communication between the server and the zonal or regional file share is encrypted.
In-transit encryption types
IPsec encapsulated connection for zonal shares
The utility uses strongSwan and swanctl to configure IPsec on the compute host that's running a Linux OS.
File Storage for VPC IPsec connection requires mutual authentication. The Mount Helper retrieves the instance or bare metal server identity token from the Metadata service. Then, it requests the creation of the instance or bare metal server identity certificate by using the identity token.
The Mount Helper makes new certificate requests every 45 minutes, as the lifetime of the certificate is 1 hour. The new certificate is generated before the old certificate expires to ensure seamless connection. The certificates are generated with the shorter life span for security reasons.
You can use the utility for encrypted or unencrypted connections. For encrypted connections, the Mount Helper uses the metadata service protocol option that is set to either http or https. For more information, see
the API reference for metadata_service option of instance provisioning and bare metal server provisioning.
Stunnel secure connection for regional shares
The Mount Helper utility installs stunnel on the compute host that's running a Linux OS. Stunnel is an application that creates encrypted TLS tunnels between clients and servers for secure communication. In client mode, Stunnel initiates a
connection from your virtual server instance of bare metal server to the file share, and tunnels data over a secure connection. Stunnel requires a PEM file, which typically contains a private key and a certificate. When stunnel operates
in client mode, it relies on the system-wide SSL/TLS configuration and certificates. It can use the default PEM file provided by the Linux distribution rather than generating a custom certificate. The PEM file is often located in /etc/ssl/private or /etc/pki/tls/private folder.
Requirements
- For setting up a secure connection with zonal file share, the Metadata service must be enabled on the virtual server instance. If it is not enabled yet, follow the instructions for enabling metadata in the consoleenabling metadata from the CLIenabling metadata from the API for virtual server instances or enabling metadata in the consoleenabling metadata from the CLIenabling metadata from the API for bare metal servers.
- The zonal or regional file share must have security group access mode, so the VPC's security access groups can be used to define which compute host can mount the share.
- Data encryption in transit must be enabled for the mount target.
- The compute host and the mount target must be members of the same security group.
- The mount target must be created with a virtual network interface, so it has an IP address within the VPC that represents the virtual NFS server.
Restrictions
-
For IPsec encapsulation, the same certificates cannot be used across multiple regions.
-
The Mount Helper is supported on Linux hosts only. See the table for the supported distributions:
This table shows the supported host OS distributions. Supported OS Supported OS Supported OS UBUNTU_2204 UBUNTU_2404 SAP_SLES_15_SP3_HANA RHEL_8 [8.4, 8.6, 8.8, 8.10] RHEL_9 [9.0, 9.2, 9.4] SAP_SLES_15_SP3_APPLICATIONS CENTOS_STREAM_9 CENTOS_STREAM_10 SAP_SLES_15_SP4_HANA DEBIAN_11 DEBIAN_12 SAP_SLES_15_SP4_APPLICATIONS ROCKYLINUX_8 [8.9, 8.10] ROCKYLINUX_9 [9.4, 9.5] -
Installing the Mount Helper on Red Hat Enterprise Linux CoreOS is not supported.
Installation and configuration of the Mount Helper
-
Log in to the compute host where you want to mount the file share.
- Connect to your virtual server instance.
- Connect to your bare metal server.
- If you want to access the file shares from IBM Power Virtual Server instances, you must use a network path through a load balancer. For more information, see the following tutorial: Accessing File Storage for VPC shares from IBM Power Virtual Server instances and make sure that you completed Steps 1-3. Step 4 can be performed by the Mount Helper after it is installed on the Power VSI.
-
Then, you can download the package directly from GitHub, or build the utility from the source code.
If you want to mount a regional file share on an IBM Power VSI, download the installation package, and follow the steps of Installing the Mount Helper to mount regional file shares.
Downloading the installation package
-
Download the Mount Helper package from GitHub.
curl -LO https://github.com/IBM/vpc-file-storage-mount-helper/releases/download/latest/mount.ibmshare-latest.tar.gzTo establish an encrypted connection between a bare metal server and a file share, download Mount Helper version 0.2.1.
-
Extract the compressed file.
tar -xvf mount.ibmshare-latest.tar.gzThe file contains the following items: installation and uninstallation scripts,
rpmanddebpackages, root CA certificates, and the configuration file.Closed environments: To install Mount Helper on a virtual server instance without internet connection, create or update a local repository on the VSI based on the OS. Copy the Mount Helper package along with its dependencies to the local directory.
Installing the Mount Helper to mount zonal file shares
-
To install the Mount Helper and all the dependencies, use the following script and specify the region where the file share is going to be mounted.
./install.sh region=us-southThe
regionargument is used to copy region-specific root CA cert. If no region is specified, then the utility copies all the root CA certs. The following table shows the values that you can use to specify the region.This table shows the region values that the script accepts. Location New value Previous Value Australia - Sydney au-sydsydBrazil - Sao Paulo br-saosaoCanada - Montreal ca-monCanada - Toronto ca-tortorGermany - Frankfurt eu-defraJapan - Osaka jp-osaosaJapan - Tokyo jp-toktokSpain - Madrid eu-esmadUnited Kingdom - London eu-gblonUnited States - Washington, DC us-eastwdcUnited States - Dallas, TX us-southdal -
Optional - Every installation image is accompanied by a file that contains the checksum value for the image file. For example, the image file ibmshare-0.0.1.tar.gz is accompanied by the ibmshare-0.0.1.tar.gz.sha256 file that contains the checksum value. To verify the integrity of the downloaded package, use the following commands.
curl -LO https://github.com/IBM/vpc-file-storage-mount-helper/releases/download/latest/mount.ibmshare-latest.tar.gz.sha256sha256sum -c mount.ibmshare-latest.tar.gz.sha256A successful response shows "OK". The output looks like the following example.
# sha256sum -c mount.ibmshare-latest.tar.gz.sha256 ./mount.ibmshare-latest.tar.gz: OK -
Optional - By default, a certificate lasts 1 hour, and new certificates are fetched in every 45 minutes. However, you can modify the
certificate_duration_secondsoption in the configuration file/etc/ibmcloud/share.confto a different time interval. The new value must be between 5 minutes and 1 hour, and expressed in seconds.certificate_duration_seconds = 600The valid range for
certificate_duration_secondsvalue is 300 - 3600 seconds. The certificates are renewed when the current certs reach 70% of their lifetime. -
Optional - If you want to renew the certs immediately with the new expiration time, then run the following command.
/sbin/mount.ibmshare -RENEW_CERTIFICATE_NOW
Installing the Mount Helper to mount regional file shares
- To install the Mount Helper and all the dependencies, use the following script and specify the
--stunneloption../install.sh --stunnel - Optional - Every installation image is accompanied by a file that contains the checksum value for the image file. For example, the image file ibmshare-0.0.1.tar.gz is accompanied by the ibmshare-0.0.1.tar.gz.sha256 file that contains the
checksum value. To verify the integrity of the downloaded package, use the following commands.
curl -LO https://github.com/IBM/vpc-file-storage-mount-helper/releases/download/latest/mount.ibmshare-latest.tar.gz.sha256
A successful response shows "OK". The output looks like the following example.sha256sum -c mount.ibmshare-latest.tar.gz.sha256# sha256sum -c mount.ibmshare-latest.tar.gz.sha256 ./mount.ibmshare-latest.tar.gz: OK
Building the Mount Helper utility from the source code
-
On Debian-based instances, run the following commands:
apt-get update -y apt-get install git make python3 -y git clone https://github.com/IBM/vpc-file-storage-mount-helper.git cd vpc-file-storage-mount-helper make build-deb -
On rpm-based instances, run the following commands:
yum update -y dnf install git make python3 rpm-build -y git clone https://github.com/IBM/vpc-file-storage-mount-helper.git cd vpc-file-storage-mount-helper make build-rpm
Updating the Mount Helper
To update the installation package, run the install.sh script again.
./install.sh
Use the --stunnel option when you want to upgrade the stunnel package, too.
Uninstalling the Mount Helper
The following command uninstalls the utility.
./uninstall.sh
Troubleshooting Tips
-
If the IPsec installation fails, then check the mount-helper installation script logs that are displayed on the standard output.
-
If the IPsec is installed properly but failed to start the IPsec service, then check the
charonlogs. Thecharonlogs can be found in one of the following log files based on OS image:/var/log/syslogor/var/log/messages. -
You can run the following
swanctlcommand on another terminal to check the IPsec connection negotiation logs before you attempt the mount command.swanctl -T -
To manually start or disconnect the IPsec connection, use one of the following commands.
ipsec up <connection-name> ipsec down <connection-name> -
If IPsec command is not available, use the following
swanctlcommand.swanctl -i --ike <connection-name> swanctl -i --child <connection-name> swanctl -t --ike <connection-name> -
To list active connections with IPsec encryption, use one of the following commands.
ipsec statusOr
swanctl -l -
Command to restart the strongSwan service.
systemctl restart strongswan -
Location of the mount helper log.
/opt/ibm/mount-ibmshare/mount-ibmshare.log -
Location of the stunnel logs:
/var/log/stunnel/ibmshare_[MOUNT_PATH].log
Next steps
By default, NFS downgrades any files that were created with the root permissions to the nobody user. This security feature prevents privileges from being shared unless they are requested. By configuring no_root_squash,
root clients can retain root permissions on the remote NFS file share. For NFSv4.2, set the nfsv4 domain to: slnfsv4.com and start rpcidmapd or a similar service that is used by your OS. For more information, see
Implementing no_root_squash for NFS (optional).
Learn about Managing file shares.