Configure an NFS Datastore

Configuration Steps

There are 4 steps to configure and use an external NFS datastore.

  1. Configure the network interfaces in the VM Squared cluster to connect to the external infrastructure and to access to the NFS datastore.

    • The VM Squared dashboard must have access to the NFS server
    • Every individual VM Squared host must have access to the NFS server
  2. Create the NFS datastore on VM Squared.

  3. Create a VM Template that uses the NFS datastore.

  4. Create a VM instance from the new VM Template.

Configure network interfaces

VM Squared configures the network interfaces to the external infrastructure through the dashboard console using the manage-networking command.

Warning

A unique IP address must be allocated for the dashboard AND every host.

VMsquared:vmsquared\dashboard> manage-networking -h

Configure external networking
-----------------------------
0) Quit
1) Create new network

Please select [0-1]:

VMsquared:vmsquared\dashboard>

In this example, we create a new network for the nfs service and supply a range of unique IP addresses.

  1. Select Option [1] to create a new network. Enter the network name nfsnet and subnet 192.168.3.0/24.
VMsquared:vmsquared\dashboard> manage-networking

Configure external networking
-----------------------------
0) Quit
1) Create new network

Please select [0-1]: 1
Enter a name for the network: nfsnet
Enter a subnet in CIDR format: 192.168.3.0/24

Configure Network
-----------------

   Name: nfsnet
   Subnet: 192.168.3.0/24
   VLAN: None
   Default gateway: None
   Routes:
   Included ranges:
   Excluded ranges:
   Statically assigned hosts:
   Excluded hosts:

0) Back
1) Edit VLAN
2) Edit default gateway
3) Edit routes
4) Edit included ranges
5) Edit excluded ranges
6) Edit statically assigned hosts
7) Edit excluded hosts

Please select [0-7]:
  1. Select Option [4] to specify a range of IP addresses to use. In this case, the start address is 192.168.3.100, and the end address is 192.168.3.200.
Edit included ranges for nfsnet
----------------------------
0) Back
1) Add new included range

Please select [0-1]: 1
Enter address at start of range: 192.168.3.100
Enter address at end of range:   192.168.3.200

Edit included ranges for nfsnet
----------------------------
0) Back
1) Add new included range
2) Remove 192.168.3.100 - 192.168.3.200

Please select [0-2]: 0

Configure Network
-----------------

   Name: nfsnet
   Subnet: 192.168.3.0/24
   VLAN: None
   Default gateway: None
   Routes:
   Included ranges:
      192.168.3.100 - 192.168.3.200
   Excluded ranges:
   Statically assigned hosts:
   Excluded hosts:

0) Back
1) Edit VLAN
2) Edit default gateway
3) Edit routes
4) Edit included ranges
5) Edit excluded ranges
6) Edit statically assigned hosts
7) Edit excluded hosts

Please select [0-7]:
  1. Select Option [3] to specify a route.
Edit routes for nfsnet
-------------------
0) Back
1) Add new route

Please select [0-1]: 1
Enter target subnet (as CIDR): 10.11.12.0/24
Enter gateway: 192.168.3.1

Edit routes for nfsnet
-------------------
0) Back
1) Add new route
2) Remove 192.168.3.1 -> 10.11.12.0/24

Please select [0-2]: 0

Configure Network
-----------------

   Name: nfsnet
   Subnet: 192.168.3.0/24
   VLAN: None
   Default gateway: None
   Routes:
      192.168.3.1 -> 10.11.12.0/24
   Included ranges:
      192.168.3.100 - 192.168.3.200
   Excluded ranges:
   Statically assigned hosts:
   Excluded hosts:

0) Back
1) Edit VLAN
2) Edit default gateway
3) Edit routes
4) Edit included ranges
5) Edit excluded ranges
6) Edit statically assigned hosts
7) Edit excluded hosts

Please select [0-7]:
  1. The user can choose to specify a range of IPs to exclude, statically assign IPs to specific hosts, or exclude hosts from this network. In this example, we skip these options and select Option [0] to return to the main menu. Once back at the main menu, select Option [5] to commit changes.
Configure external networking
-----------------------------
0) Quit
1) Create new network
2) Edit nfsnet
3) Remove nfsnet
4) Open in text editor
5) Commit changes

Please select [0-5]: 5

At this point a new network has been created and is available to the VM Squared cluster. The next step is to create the NFS datastore.

Create an NFS datastore

Once the external infrastructure has been configured on every host and on the VM Squared dashboard, an NFS datastore can be created. NFS datastores are configured on VM Squared through the dashboard console.

Datastore creation

Log into the VM Squared dashboard console and run the manage-nfs command:

VMsquared:vmsquared\dashboard> manage-nfs

NFS Image Datastore Configuration
---------------------------------
0) Quit
1) Create new datastore

Please select [0-1]: 

Select Option 1 to create a new datastore. You will be prompted to enter the name of the new datastore and the path to the NFS server:

VMsquared:vmsquared\dashboard> manage-nfs

NFS Image Datastore Configuration
---------------------------------
0) Quit
1) Create new datastore

Please select [0-1]: 1
Configuring new image datastore on NFS
Enter a name for the datastore: nfs1
Enter the path of the NFS server for the datastore: 192.168.3.99:/mnt
Testing NFS connection
Success

NFS Image Datastore Configuration
---------------------------------
0) Quit
1) Create new datastore
2) Delete nfs1

Please select [0-2]:

Validate

Launch Glasshouse and navigate to Storage/Datastores. Confirm the new NFS datastore is present in the list.

NFS-datastore

Datastore management

Once a datastore has been created it can be deleted using the manage-datastores command.

VMsquared:vmsquared\dashboard> manage-datastores

NFS Image Datastore Configuration
---------------------------------
0) Quit
1) Create new datastore
2) Delete nfs1

Please select [0-2]:

VM Squared places a lock on all datastores that prevents its deletion before its contents. All VM instances and Templates that use a specific datastore’s assets must first be deleted before the datastore can be deleted.

Create VM Template

To create a VM that uses NFS as a datastore we must first create a template that uses NFS as a resource.

  1. Navigate to the Apps section and select the desired template.

NFS-app

  1. Click on the Import into Datastore button.

NFS-import

  1. Specify the name of the new template and click next.

NFS-name

  1. Select the NFS datastore and click Finish. At this point we have created a VM template that uses the NFS datastore.

This step assigns the VM Template and any subsequent VM instances to the NFS datastore.

NFS-datastore

Create the VM Instance

  1. To create a VM instance, navigate to the VM Templates, select the new template, and click on the Deploy button.

NFS-template

  1. Navigate to the VMs and select the new instance. Select the Storage tab and confirm the datastore is NFS.

NFS-vm

Next Steps

Next steps

Now that an NFS datastore has been created you can:

  • Upload images to the datastore
  • Create more VM Templates that use the datastore