Bare Metal Cloud Storage Management via Portal and API

September 12, 2022

Introduction

The Bare Metal Cloud portal and the Network Storage API offer a flexible way to expand storage capacity on a network through Network File Storage (NFS). The storage solution provides the performance of a general purpose SSD on-demand at an affordable price.

High-throughput and latency-sensitive projects benefit from adding NFS, allowing servers to grow in capacity and performance through a distributed file system.

This guide provides a complete overview of the BMC Network File Storage feature via the BMC portal and the Network Storage API.

BMC storage management via portal and api

Prerequisites

BMC Network File Storage (NFS) via Portal

The Storage section lets you expand your BMC storage on-demand. Use this feature to increase storage capacity through a private network attached storage with SSD performance.

Note: A network file storage creates a private network. Only servers in the same network have access to the storage.

Create Network File Storage

Log into the BMC portal and navigate to the Storage page. Three sections appear on the page, including Network File Storage.

The Storage page allows you to create a network file storage or manage an existing one.

Bare Metal Cloud Storage page buttons

Select the Create Network File Storage button to start the creation process.

1. Choose the data center location for the network file storage.

Network file storage location Phoenix

Note: The network file storage and the deployed server instance must be in the same location. The available data center locations are Phoenix and Ashburn. Additionally, only one storage and one volume are available per network.

For example, to create a network file storage for servers deployed in Phoenix, choose Phoenix for the storage location. A matching location enables accessing and mounting the storage to a server.

The network storage creates a private network for the provided location. If you have reached the maximum number of networks, you cannot create network file storage.

2. Enter a descriptive name in the Storage Name field. Open the Add Description dropdown to add an optional description.

Storage info entry UI

The end of the Storage section states the maximum capacity as 3 TB (3000GB). To increase the size, contact sales or click the request a quota increase link.

3. Enter a Volume Name to help identify the storage volume.

4. Add a Path Suffix for the volume. Open the Add Description dropdown to provide an optional description for the volume.

Create file storage volume details UI

The suffix represents a custom part of the volume path and helps visually identify a volume. The path suffix is optional but recommended.

5. Set the volume size in TB. The size cannot exceed the maximum capacity stated in the Volumes section. The price per TB-Hour is next to the volume size. For more information, refer to the Billing models article.

Note: The total price is calculated based on the quantity and unit price. Quantity is a calculated value that depends on the volume size and the number of hours.

For example, a 1TB storage used for 10 hours yields a quantity of 10 TB-hours (1TB*10h).

For a storage with a quantity of 10TB-hours at a unit price of $0.12 per 1TB-hour gives a total price of $1.20 (10TB-hours * $0.12).

6. Review the network file storage in the summary box. Click Create Network File Storage when ready to complete the creation process.

The network storage list loads. While the storage creation is in progress, the status is set to BUSY. You cannot delete the storage until the status changes.

network file storage listing ready

When completed, the status changes to READY. If the status is ERROR, try repeating the creation process or contact support for further assistance.

View Network Storage Details

To see the details of a network storage:

1. Navigate to Storage -> Manage Your Network File Storage.

Bare Metal Cloud Storage NFS manage your NFS button

The page shows brief details about your storage. The columns include storage ID, name, location, network, size, creation time, and the management column.

2. Locate the network file storage for which you want to view the details.

3. Click Actions -> Storage Details.

Network file storage actions storage details

The storage details page loads with Storage Info and Volumes tabs.

Network file storage details tabs

Storage Info

The Storage Info tab shows the following sections:

  • Storage Configuration. Shows the basic details about the storage, such as the storage ID, name, maximum capacity, the number of volumes, the storage size, and the date of creation.
Storage configuration details UI
  • Storage Network. Displays the private network information for the network storage and its IP addresses. The details include the network ID, name, CIDR, VLAN ID, and the IP addresses of the storage network. The server instances that reside on this network can mount and access the NFS. Click the Private Networks link to add/remove servers to the storage network and set up the servers.
Storage network details UI
  • Billing. Shows the billing model, the start date, and the price per unit (measured in TB/hour).
Storage network billing UI

Volumes

The Volumes tab shows the following volume details:

Volumes tab volume details page
  • Volume ID. A unique identifier for the volume. Note the information if you plan to use the API to view and manage the volume.
  • Name. The volume name in a human-readable format.
  • Size. The volume size in GB.
  • Path. The path is the combination of the Volume ID and path suffix provided during creation. Use this information to mount the storage.
  • Status. Shows the status of the volume as either BUSY, READY, or ERROR.
  • Created on. Displays the creation time for the volume.
  • Action. Contains the option to delete the volume and the link to the mount command for Linux-based servers. The volume must be in a READY state to mount. Click the Mount Command link, copy the command, and run on a server instance to mount the volume. Replace <local directory> with the path to a local empty directory.
Mount command popout UI

Click Close to close the Mount Command box.

Add Volumes to a Network File Storage

To add additional volumes to a network file storage:

1. Navigate to Storage->Manage Your Network Storage.

2. Click Actions->Add Volume.

Network file storage actions add volume

3. In the Volume section, enter a descriptive Volume Name.

4. Add a Path Suffix for the volume.

Volume name and path suffix additional volume

5. Optionally, expand the Add Description field and enter the volume's description.

6. Enter the Volume Size in terabytes (TB). The minimum is 1TB and cannot exceed the total maximum capacity across all storages.

Volume description and volume size additional volume

7. Review the details in the right pane. Once ready, click the Add Volume button to add the new volume to the network file storage.

Delete Network File Storage

Deleting a network file storage deletes the private network and all the data on it. You must remove all servers residing on the network before deleting a network file storage.

Warning: The delete action cannot be undone and all data on the network file storage is also deleted. Before deleting the network file storage, backup all critical data.

To delete a network file storage, do the following:

1. Navigate to Storage -> Manage Your Network File Storage.

2. Locate the network file storage on the list.

3. Click Actions -> Delete Storage in the Manage column.

4. Enter the storage name to confirm deletion and click Delete Storage.

Delete storage popout UI

BMC Network File Storage (NFS) via API

The BMC Network Storage API lets you create and manage a network file storage. The API creates a private network, and BMC servers added to the private network have access to the storage volume.

The HTTP Request URL for the Network Storage API is:

https://api-dev.phoenixnap.com/network-storage/v1/

Create Network Storage and Volume

Use the POST method and the /storage-networks endpoint to create a network storage and volume.

Note: The maximum number per network is one storage and volume.

The body consists of the following fields:

  • name (required)
  • location (required) – available locations are PHX and ASH.
  • description (optional)
  • volumes (required) – additional information for the volume with the following fields:
    • name (required)
    • capacityInGb (required) – maximum for individual and total volume capacity is 3000.
    • description (optional)
    • pathSuffix (optional)

For example, to create a network storage a volume, use:

{
  "name":"My Network Storage",
  "location":"PHX",
  "description":"My first network file storage",
  "volumes": [
    {
      "name":"My Volume",
      "capacityInGb":1000
      "description":"1TB capacity for My Network Storage",
      "pathSuffix":"/my-documents",
    }
  ]
}

The request accepts when the 202 response shows. The output prints the object with the status BUSY.

Use the POST method and the
/storage-networks/{storageNetworkId}/volumes endpoint to create additional volumes on an existing storage.

The body consists of the following fields:

  • name (required)
  • description (optional)
  • pathSuffix (optional)
  • capacityInGb (required) - Total maximum for all volumes cannot exceed 3000GB (3TB).
  • permissions (optional) - Permissions for the volume.
    • nfs - Network file storage permissions. Controls the read and write operations and the squash policy. Omitting permissions defaults to readWrite and rootSquash for all servers in the CIDR block.

For example, to create a 1TB volume to an existing network storage, use:

{
  "name":"My Volume",
  "capacityInGb":1000
  "description":"1TB capacity for My Network Storage",
  "pathSuffix":"/my-documents",
  "permissions": {
    "nfs": {
      "readWrite": ["1.1.1.1"],
      "rootSquash": ["1.1.1.1"]
    }
  }
}

The volume capacity cannot exceed the 3TB total quota for all volumes.

Retrieve Network Storage and Volume Details

Use the GET method and the /storage-networks endpoint to retrieve the details of all storage networks owned by the account.

To filter the result by location, use the following endpoint:

https://api-dev.phoenixnap.com/network-storage/v1/storage-networks?location=PHX

To show the details for a single network storage, use the /storage-networks/{storageNetworkId} endpoint.

For example:

https://api-dev.phoenixnap.com/network-storage/v1/storage-networks/63088b16a0c7de215b88bb1d
Network storage get response

The storage network has:

  • IPs x.x.x.4 and x.x.x.5 for accessing and mounting the volumes.
  • The networkId of the storage network. The ID can further be viewed through the private networks API.
NetworkId and IPs Network storage API response

Note: To optimize the NFS and achieve load balancing, add a hostname (A record) with both IP addresses.

To display the storage network volume array, use the /storage-networks/{storageNetworkId}/volumes endpoint.

The full HTTP link with an example storageNetworkId looks like the following:

https://api-dev.phoenixnap.com/network-storage/v1/storage-networks/63088b16a0c7de215b88bb1d/volumes

For a specific volume belonging to a storage network, use the /storage-networks/{storageNetworkId}/volumes/{volumeId} endpoint.

For example:

https://api-dev.phoenixnap.com/network-storage/v1/storage-networks/63088b16a0c7de215b88bb1d/volumes/0c28c9eb-f359-4f5e-b08b-45612c98f51f

Update Network Storage and Volume Details

Use the PATCH method and the /storage-networks/{storageNetworkId} endpoint to update storage network and/or volume details.

The fields you can update for the storage are:

  • name - Specify a new name for the network storage or leave as is.
  • description - Update the public network description.

For example:

{
  "name":"New storage network name",
  "description:"Updated description for storage network"
}

To update the volume information, use the /storage-networks/{storageNetworkId}/volumes/{volumeId} endpoint.

The fields you can update for the volume are:

  • name - Provide a new name to change the current value.
  • description - Update the volume description.
  • capacityInGB - Change volume capacity.
  • pathSuffix - Update the last part of the volume's path.
  • permissions - Change storage permissions.
    • nfs - Update the NFS permissions. The read/write operation fields are: readWrite and readOnly. The squash policy fields are: rootSquash, noSquash, and allSquash. Add at least one read/write operation and squash policy.

For example:

{
  "name":"New volume name",
  "description:"Updated description for the volume"
  "capacityInGb":<updated capacity>
  "pathsuffix:"<new suffix>
  "permissions": {
    "nfs": {
      <new permissions>
    }
  }
}

State the capacity in gigabytes as a multiple of 1000 (which corresponds to whole number terabytes). For instance, to update the volume capacity to 3TB, enter 3000.

To set up the permissions, use:

  • CIDR notation to indicate a subnet. For example:
{
  "permissions": {
    "nfs": {
      ...
      readWrite: ["1.1.1.0/24"]
    }
  }
}

This field gives read/write permissions to all servers in the 1.1.1.0-1.1.1.255 range.

  • Wildcard notation to indicate a range. For instance:
{
  "permissions": {
    "nfs": {
      ...
      rootSquash: ["1.1.*.*"]
    }
  }
}

The permission applies root squash policy to all servers in the 1.1.0.0-1.1.255.255 range.

  • An empty array to remove a permission for all servers. For example:
{
  "permissions": {
    "nfs": {
      ...
      readOnly: []
    }
  }
}

The permission indicates there are no servers with read only access.

Delete Network Storage and Volume

Warning: Before deleting a storage network and volume, remove all servers from the network and backup any critical data. Deleting the storage and volume removes all information from the private network storage.

Use the DELETE method and the /storage-networks/{storageNetworkId} endpoint to remove a storage and its volume.

Mount Network File Storage (NFS)

Depending on the server OS, the mount process and commands differ. Below are instructions for both Linux and Windows servers.

Mount NFS on Linux (Ubuntu, Debian, CentOS)

To mount the storage on a Linux server, do the following:

1. Create a local directory to serve as a mountpoint:

mkdir <local directory>

2. Show the available volumes for mounting and provide the storage IP as an endpoint:

showmount -e <storage IP>
showmount -e linux terminal output

The output lists the available volumes for mounting in the format <volume ID>/<path suffix>. Use the listed volume ID and path suffix in the following step.

3. Run the mount command as sudo:

sudo mount <storage IP>:/<volume ID>/<path suffix> /<local directory>

The command contains the following fields:

  • <storage IP> is the network storage IP.
  • <volume ID>/<path suffix> is the NFS volume path.
  • <local directory> is the local mountpoint directory.

4. View the mount with:

df -h
df -h mounted nfs terminal output

The mount does not persist after restart.

(Optional) Persist Mount on Linux

To persist the mount after restart, do the following:

1. Edit the /etc/fstab file using a text editor:

sudo nano /etc/fstab

2. Append the following information:

<server IP>:/<volume ID>/<path suffix> <local directory> nfs defaults 0 0
etc fstab persistent nfs mount file contents

Save and close the file.

3. Mount the NFS using one of the following command formats:

sudo mount <local directory>

Or alternatively:

sudo mount <storage IP>:/<volume ID>/<path suffix>

The mount command reads from the /etc/fstab file and the storage persists upon reboot.

Mount NFS on Windows Server

Use the GUI or Powershell to mount the storage on a Windows server. In both cases, install the NFS-Client Windows feature to enable mounting.

Option 1: Mount Through Powershell

Mount the NFS using the Powershell by following the steps below:

1. Install the NFS client to enable the mount command. Run PowerShell as administrator and use the following command:

Install-WindowsFeature NFS-Client

2. List all mountable volumes and provide the storage IP as an endpoint:

showmount -e <storage IP>
showmount -e windows powershell output

The output lists all mountable volumes.

4. Close the Powershell and run again as a normal user.

5. Mount the storage with the following command:

mount.exe -o anon \\<storage IP>\<volume ID>\<path suffix> <drive letter | *>

The command has the following fields:

  • <storage IP> represents the network storage IP.
  • <volume ID>\<path suffix> is the NFS volume path.
  • <drive letter | *> is the local drive (for example X:). Provide an asterisk (*) to mount on the first available drive.
mount.exe mount nfs powershell output

The mount is visible as a mounted disk in File Explorer -> This PC.

windows mounted nfs volume

Option 2: Mount Through the GUI

To mount an NFS through the Windows GUI, follow the steps below:

1. Navigate to Start -> Server Manager.

Windows server manager

2. Choose Add roles and features from the dashboard.

server manager add roles and features

3. Click Next until you navigate to the Features page.

4. Check the Client for NFS checkbox and click Next.

Client for NFS Windows feature install wizard

5. Click Install to confirm the installation.

6. Open File explorer -> This PC.

7. In the top bar, click Computer -> Map network drive.

Map network drive file explorer

8. Choose a drive letter and specify the folder in the following format:

\\<storage IP>\<volume ID>\<path suffix>
map network drive nfs path
  • <storage IP> is the network storage IP.
  • <volume ID>\<path suffix> is the NFS volume path.

9. Click Finish to complete the mount. The mount is now visible from the File explorer.

(Optional) Persist Mount on Windows

To persist the mount on a Windows server, do the following:

1. Press Start and search for the Run tool.

2. Enter shell:startup and press Enter.

3. Create a nfsmount.bat file and add the mount command:

mount.exe -o anon \\<storage IP>\<volume ID>\<path suffix> <drive letter | *>

Save and close the file. The file is automatically read after reboot and the NFS mounts on startup.

Conclusion

This guide showed you how to use the Network File Storage functionality through the BMC portal and API.

To learn more about different phoenixNAP APIs, visit the Developers Portal.

Was this article helpful?
YesNo
Milica Dancuk
Milica Dancuk is a technical writer at phoenixNAP who is passionate about programming. Her background in Electrical Engineering and Computing combined with her teaching experience give her the ability to easily explain complex technical concepts through her content.
Next you should read
BMC Public IP Management via Portal and API
February 22, 2022

Follow the instructions in this guide to learn how to buy a public IP allocation, assign it to a resource and delete it via the BMC Portal...
Read more
BMC Server Management via API
December 2, 2021

This guide shows you how to effectively manage BMC servers by using phoenixNAP APIs. This includes Server Tag Manager...
Read more
Configure BMC Server to Work with New Public IP Block
April 6, 2022

The BMC portal offers server instances and public IP allocations that cater to multiple use cases. Depending on...
Read more
How to Deploy a Bare Metal Cloud Server
March 23, 2021

This article shows how to deploy a new Bare Metal Cloud server in nine simple steps. Follow the instructions to create a server and view...
Read more