Tuesday 23 February 2016

Different ways of creating a vserver in c-mode / also added how to delete a vserver.

OPTIONS:

  • systems manager (not illustrated in the example)
  • vserver setup
  • vserver create

The major difference between these two are the allocation of Junction path. when we create a vserver via vserver setup, we can choose the junction path to be /vol/vol_name

But when we use vserver create, we don't get the option. The junction path is /vol_name
But don't worry, we can for sure change it in the later stage or tweak it as we want. But lets see how the creation and deletion works.




CREATING VSERVER with vserver setup COMMAND

The next option is to use a vserver setup command. The advantage of this is that it takes care of all the related things, like the junction path, lifs and data vols.

below is the example to show how it works.
cluster600::> vserver setup
Welcome to the Vserver Setup Wizard, which will lead you through
the steps to create a virtual storage server that serves data to clients.

You can enter the following commands at any time:
"help" or "?" if you want to have a question clarified,
"back" if you want to change your answers to previous questions, and
"exit" if you want to quit the Vserver Setup Wizard. Any changes
you made before typing "exit" will be applied.

You can restart the Vserver Setup Wizard by typing "vserver setup". To accept a default
or omit a question, do not enter a value.

Vserver Setup wizard creates and configures only data Vservers.
If you want to create a Vserver with Infinite Volume use the vserver create command.


Step 1. Create a Vserver.
You can type "back", "exit", or "help" at any question.

Enter the Vserver name: nfs_test
Choose the Vserver data protocols to be configured {nfs, cifs, fcp, iscsi, ndmp}: nfs
Choose the Vserver client services to be configured {ldap, nis, dns}:
Enter the Vserver's root volume aggregate [aggr1]:
Enter the Vserver language setting, or "help" to see all languages [C.UTF-8]:
Enter the Vserver root volume's security style {mixed, ntfs, unix} [unix]:
Vserver creation might take some time to finish....

Vserver nfs_test with language set to C.UTF-8 created.  The permitted protocols are nfs.

Step 2: Create a data volume
You can type "back", "exit", or "help" at any question.

Do you want to create a data volume? {yes, no} [yes]:
Enter the volume name [vol1]: nfs_test_vol1
Enter the name of the aggregate to contain this volume [aggr1]:
Enter the volume size: 100m
Enter the volume junction path [/vol/nfs_test_vol1]:
It can take up to a minute to create a volume...


Volume nfs_test_vol1 of size 100MB created on aggregate aggr1 successfully.
Do you want to create an additional data volume? {yes, no} [no]: no


Step 3: Create a logical interface.
You can type "back", "exit", or "help" at any question.

Do you want to create a logical interface? {yes, no} [yes]:
Enter the LIF name [lif1]: nfs_test_lif1
Which protocols can use this interface {nfs, cifs, iscsi}: nfs, cifs

Error: Input contains a protocol disallowed on the Vserver. Allowed protocols are nfs.

Enter the list of storage protocols that will be used on this LIF.

You can type "back", "exit", or "help" at any question.

Which protocols can use this interface {nfs, cifs, iscsi} [nfs,cifs]: nfs
Enter the home node [cluster600-01]:
Enter the home port {e0a, e0b, e0c, e0d} [e0a]:
Enter the IP address: 192.168.199.188
Enter the network mask: 255.255.255.0
Enter the default gateway IP address: 192.168.199.2

LIF nfs_test_lif1 on node cluster600-01, on port e0a with IP address 192.168.199.188 was created.
Do you want to create an additional LIF now? {yes, no} [no]:


Step 4: Configure NFS.
You can type "back", "exit", or "help" at any question.

NFS configuration for Vserver nfs_test created successfully.

Vserver nfs_test, with protocol(s) nfs has been configured successfully.


DELETING THE VSERVER
  • Now I deleted the vserver that we just created:
  • We need to delete the volumes 
  • Then delete the route
  • then the routing group
  • then the vserver.

cluster600::> volume offline -vserver nfs_test -volume nfs_test_vol1

Warning: Volume "nfs_test_vol1" on Vserver "nfs_test" must be unmounted before being taken offline or restricted.  Clients will not be able to access the affected volume and related junction paths
         after that.  Do you still want to unmount the volume and continue? {y|n}: y
Volume "nfs_test:nfs_test_vol1" is now offline.

Volume modify successful on volume: nfs_test_vol1
cluster600::> volume offline -vserver nfs_test -volume rootvol

Warning: Offlining root volume rootvol of Vserver nfs_test will make all volumes on that Vserver inaccessible.
Do you want to continue? {y|n}: y
Volume "nfs_test:rootvol" is now offline.

Volume modify successful on volume: rootvol
cluster600::> volume destroy -vserver nfs_test -volume nfs_test_vol1

Warning: Are you sure you want to delete volume "nfs_test_vol1" in Vserver "nfs_test" ? {y|n}: y
Volume "nfs_test:nfs_test_vol1" destroyed.

cluster600::> volume destroy -vserver nfs_test -volume rootvol

Warning: Are you sure you want to delete volume "rootvol" in Vserver "nfs_test" ? {y|n}: y
Volume "nfs_test:rootvol" destroyed.

cluster600::> vserver delete -vserver nfs_test

Warning: There are 1 routing group(s) associated with Vserver nfs_test. All these objects will be removed while deleting the Vserver.Are you sure you want to delete Vserver nfs_test and all objects
         associated with it? {y|n}: n

cluster600::> vserver delete -vserver nfs_test

Warning: There are 1 routing group(s) associated with Vserver nfs_test. All these objects will be removed while deleting the Vserver.Are you sure you want to delete Vserver nfs_test and all objects
         associated with it? {y|n}: n

cluster600::> routing-groups route delete -vserver nfs
    nfs600   nfs700   nfs800   nfs_test

cluster600::> routing-groups route delete -vserver nfs_test -routing-group d192.168.199.0/24 *
  (network routing-groups route delete)
1 entry was deleted.

cluster600::> routing-groups delete -vserver nfs_test -routing-group d192.168.199.0/24
  (network routing-groups delete)

cluster600::> vserver delete -vserver nfs_test

cluster600::>

CREATING VSERVER with vserver create command.

This includes creating all the associated parameters seperately.
  • Create vserver. 
  • Create routing group
  • create route
  • create interface
  • create data volume
  • mount the data volume

We will go through each of the steps in this example:

CREATE VSERVER

cluster600::> vserver create -vserver nfs_test -rootvolume rootvol -aggregate aggr1 -ns-switch nis -nm-switch file -rootvolume-security-style unix -language C.UTF-8 -snapshot-policy default        [Job 76] Job is queued: Create nfs_test.

Warning: NIS or LDAP has been specified as one of the sources for "-ns-switch". To avoid possible issues with Vserver's functionality and performance, configure NIS using the "vserver services
         nis-domain" commands, or LDAP using the "vserver services ldap" commands.
[Job 76] Job succeeded:
Vserver creation completed

cluster600::>

CREATE ROUTING GROUP and ROUTE CREATE
cluster600::> routing-groups create -vserver nfs_test -routing-group d192.168.199.0/24 -subnet 192.168.199.0/24 -role data -metric 20
  (network routing-groups create)

cluster600::>

cluster600::> routing-groups route create -vserver nfs_test -routing-group d192.168.199.0/24 -destination 0.0.0.0/0 -gateway 192.168.199.2 -metric 20
  (network routing-groups route create)

cluster600::>

CREATE INTERFACE

cluster600::> network interface create -vserver nfs_test -lif nfs_test_lif1 -role data -data-protocol cifs,nfs,fcache -home-node cluster600-01 -home-port e0a -address 192.168.199.188 -netmask 255.255.255.0 -routing-group d192.168.199.0/24 -status-admin up -failover-policy nextavail -firewall-policy data

cluster600::> network interface create -vserver nfs_test -lif nfs_test_lif1 -role data -data-protocol cifs,nfs,fcache -home-node cluster600-01 -home-port e0a -address 192.168.199.188 -netmask 255.255.255.0 -routing-group d192.168.199.0/24 -status-admin up -failover-policy nextavail -firewall-policy data

cluster600::>
cluster600::> network interface show
    show               show-routing-group show-zones

cluster600::> network interface show
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
cluster600
            cluster_mgmt up/up    192.168.199.170/24 cluster600-01 e0a     true
cluster600-01
            mgmt1        up/up    192.168.199.171/24 cluster600-01 e0a     true
nfs600
            nfs600_lif1  up/up    192.168.199.180/24 cluster600-01 e0c     true
nfs700
            nfs700_lif1  up/up    192.168.199.181/24 cluster600-01 e0d     true
nfs800
            nfs800_nfs_lif1
                         up/up    192.168.199.182/24 cluster600-01 e0c     true
nfs_test
            nfs_test_lif1
                         up/up    192.168.199.188/24 cluster600-01 e0a     true
6 entries were displayed.

cluster600::>
cluster600::> exit
Goodbye


Connection to 192.168.199.170 closed.

CHECKING WITH PING TO CONFIRM 
xxxxx@ubuntu:~/monitoring/netapp/test$ ping 192.168.199.188
PING 192.168.199.188 (192.168.199.188) 56(84) bytes of data.
64 bytes from 192.168.199.188: icmp_seq=1 ttl=255 time=1.16 ms
64 bytes from 192.168.199.188: icmp_seq=2 ttl=255 time=0.477 ms

MOUNT THE DATA VOLUME:
The Junction path which I mentioned before:
If you try to mount the volume on /vol/vol_name you get a error. because the mount point does not exit.

cluster600::> volume mount -vserver nfs_test -volume nfs_test_vol1 -junction-path /vol/nfs_test_vol1

Error: command failed: Failed to create or determine if a junction exists within volume "rootvol". Error occurred with the remaining junction path of "/vol/nfs_test_vol1" for the given path of
       "/vol/nfs_test_vol1"  Reason: Junction create failed (2).

cluster600::> volume mount -vserver nfs_test -volume nfs_test_vol1 -junction-path /nfs_test_vol1


In the next section , we will create the mount point from the system shell and then mount the volume to 
/vol/nfs_test_vol1

Stay tuned :)
And don't forget to leave your comments.


1 comment:

  1. Using the terminal, administrators can input specific commands to create a vServer. Why Bad Games This method offers precise control and scripting capabilities.

    ReplyDelete

Featured post

Netapp monitoring solution from scratch

I created a netapp monitoring solution on a UNIX machine... and have uploaded the static files to a free php server for so that you under...