{section}
{column:width=80%}
{column}
{column:width=20%}
[!back-org-small.png|xvmOC2dot0:alt="back"! Virtual Image Library|Virtual Image Library]
{column}
{section}
----
{excerpt}
h1. Setting Up the NFS Server
A virtual image library is required to store disk and guest images. The libraries can be based on the shares of an NFS server. The NFS-based libraries can be created by one of the following methods:
* Create a library locally to the Sun xVM Server prior to attaching to Sun xVM Ops Center. After attaching the Sun xVM Server, associate the library to the virtual pool.
* Create a library from Sun xVM Ops Center BUI and add it to a virtual pool.
*Note --* The NFS protocol (specifically version 4) requires agreement on the Domain Name System (DNS) to which the NFS server and NFS clients belong. The server and the client should agree on the identity of the authorized users accessing the share.
h2. To Set Up a Share on the NFS Server
The following procedure describes how to set up an NFS server in your environment.
# The domain is set up in a number of locations. On the NFS server, edit the _/etc/default/nfs_ file. In this file, the NFSMAPID_DOMAIN variable will be set as Uninitialized. Change the variable value to the domain name which will be agreed upon by the NFS client.
# Define a common user (and userid) shared between the NFS server and the NFS clients. The user should be created with uid 60. For example, use the following command to create a user named xvm.
Create the xvm group id:
{{*groupadd -g 60 xvm*}}
Create the xvm user:
{{*useradd -u 60 -g 60 -d / -c 'xVM User' -s /bin/true xvm*}}
# Create the share on the NFS server. The share on the NFS server should be created with initial correct privileges. For example, assume that the share on the NFS server is _/export/virtlib/lib0_ and execute the following command:
{{*mkdir /export/virtlib/lib0*}}
{{*chmod 777 /export/virtlib/lib0*}}
{{*chown xvm:xvm /export/virtlib/lib0*}}
# Execute the following command to share the directory through NFS:
{{*share -F nfs -o rw,root=_<domain name>_,anon=60 -d "Share 0" /directorypath/ofthe/share*}}
The share setup allows the xvm user on the NFS clients to have write privileges. It also allows the root user on the NFS client to have write access on the share. The special options allow to share the directory with write access, the root user in the domain, and specifies that the anonymous user will be seen on the clients as the user with uid 60 (xvm).
If you want the NFS shares to be accessible outside your domain, then execute the following {{share}} command. Use the {{rw}} option to give the optional domain list.
{{share -F nfs -o rw=_<domain name>_,anon=60 -d "Share 0" /directorypath/tothe/share}}
*Note --* Ensure that the domain name is added in the _/etc/nsswitch.conf_ file so that {{root=_<domain name>_}} is effective.
Always try to use DNS instead of Network Information Service (NIS). DNS maps the host names to the IP addresses. Change the host line to DNS in the _/etc/nsswitch.conf_ file.
After setting up a share on the NFS server, the NFS client has to be prepared to mount the share.
h2. To Set Up an NFS Client
Follow the procedure given below to set up an NFS client.
# As that of the NFS server, edit the _/etc/default/nfs_ file on the NFS client for the domain name.
# Verify that the xvm user has been created by the Sun xVM Server setup.
{{*grep xvm /etc/passwd*}}
The output should be:
{{xvm:x:60:60:xVM User:/:}}
# Verify the NFS share is visible on the client. An example of the mounted share is given below:
{{*showmount -e <server-name>*}}
{{export list for <server-name>:
/export/virtlib/lib0 (everyone)}}
When you create a library, the NFS share is automatically mounted on to the NFS client.
h2. Troubleshooting Library Creation
When a NFS-based library creation fails, check the mount directory and look for permissions for all the files in the directory. For example:
{code}
bash-3.00# cd /var/mnt/virtlibs/1238622271388
bash-3.00# ls -all
total 6
drwxrwxrwx 3 nobody nobody 512 Apr 1 12:53 .
drwxr-xr-x 5 root sys 512 Apr 1 15:50 ..
drwxr-xr-x 2 nobody nobody 512 Apr 1 10:51 blobs
{code}
If there is {{nobody}} in the permissions, the NFS configuration is incorrect. The permissions should be {{xvm}} for both the user and group. To resolve this error, follow the below steps:
# Open the {{nfs}} file at {{/etc/default/nfs}}.
# Locate the term NFSMAPID_DOMAIN.
# Edit NFSMAPID_DOMAIN=_<domain name>_.
# Restart the NFS client service.
{{svcadm disable svc:/network/nfs/client:default}}
{{svcadm enable svc:/network/nfs/client:default}}
# Check for the same settings in the NFS server. If the NFSMAPID_DOMAIN is not correctly configured, edit the {{nfs}} file.
# Restart the NFS server again.
h2. Troubleshooting Library Mounts
You can verify the NFS share mount by manually mounting the NFS share on the NFS client. Ensure that you unmount on the NFS client after verifying.
Whenever there is an issue on NFS share, check the following:
* Check the NFS setup on the Server.
* Check the NFS setup on the Client.
* Check the mount table on the client. For example, on Solaris, execute the following command:
{{*cat /etc/mnttab*}}
The output gives the mount point on the client for the NFS share. Check the mount point directory for the list of files for further investigation.
h2. Troubleshooting DNS and NIS Configuration
When you cannot access a storage library, one of the possible reason is that the NFS server name could not be resolved by the Sun xVM Servers. The NFS server host name is specified through the user interface. The user interface is hosted by the Enterprise Controller. If the Enterprise Controller is in a different DNS than the Sun xVM Servers, the storage libraries cannot be accessed.
If either the Enterprise Controller or the Sun xVM Servers are configured through the NIS, then the host name of the NFS server cannot be resolved by both of them. In such scenarios, follow the necessary steps:
* Provide a fully qualified domain name of the NFS server.
* Ping the NFS server from the Sun xVM Servers to check whether the host name can be resolved.
If some Sun xVM servers are not able to resolve the NFS server host name, it indicates that the name services are not configured properly on the Sun xVM Servers.
* Check the _/etc/nsswitch.conf_ file in the Enterprise Controller and the Sun xVM Servers whether they express the same order.
* If NIS is used, ensure that all the systems are on the same NIS.
* If DNS is used, ensure that the _/etc/resolv.conf_ file has the same search order in all the systems.
h2. Using Linux OS Enterprise Controller
When you use Solaris 10 OS in the Enterprise Controller, there will be no difference while creating a NFS-based library. If you have Linux OS on the Enterprise Controller, then no action is enabled on the library until a virtual pool is created. The size of the library is displayed as -2MB. The library is not mounted and it will be in the UNKNOWN state. The actual mounting of the NFS library takes place after a virtual pool is created. The mounting is done on the Sun xVM Servers attached to the virtual pool rather than the Enterprise Controller.
After the virtual pool creation, all the actions for the library are enabled and displays the size of the library correctly.
{excerpt}
----
{panel:borderStyle=none|titleBGColor=#BDBEC0|bgColor=#f5f5f5}
*Where to Go From Here*
See [Creating a Library] to create a library and [Associating or Disassociating Libraries] to associate libraries to virtual pools.
{panel}
{column:width=80%}
{column}
{column:width=20%}
[!back-org-small.png|xvmOC2dot0:alt="back"! Virtual Image Library|Virtual Image Library]
{column}
{section}
----
{excerpt}
h1. Setting Up the NFS Server
A virtual image library is required to store disk and guest images. The libraries can be based on the shares of an NFS server. The NFS-based libraries can be created by one of the following methods:
* Create a library locally to the Sun xVM Server prior to attaching to Sun xVM Ops Center. After attaching the Sun xVM Server, associate the library to the virtual pool.
* Create a library from Sun xVM Ops Center BUI and add it to a virtual pool.
*Note --* The NFS protocol (specifically version 4) requires agreement on the Domain Name System (DNS) to which the NFS server and NFS clients belong. The server and the client should agree on the identity of the authorized users accessing the share.
h2. To Set Up a Share on the NFS Server
The following procedure describes how to set up an NFS server in your environment.
# The domain is set up in a number of locations. On the NFS server, edit the _/etc/default/nfs_ file. In this file, the NFSMAPID_DOMAIN variable will be set as Uninitialized. Change the variable value to the domain name which will be agreed upon by the NFS client.
# Define a common user (and userid) shared between the NFS server and the NFS clients. The user should be created with uid 60. For example, use the following command to create a user named xvm.
Create the xvm group id:
{{*groupadd -g 60 xvm*}}
Create the xvm user:
{{*useradd -u 60 -g 60 -d / -c 'xVM User' -s /bin/true xvm*}}
# Create the share on the NFS server. The share on the NFS server should be created with initial correct privileges. For example, assume that the share on the NFS server is _/export/virtlib/lib0_ and execute the following command:
{{*mkdir /export/virtlib/lib0*}}
{{*chmod 777 /export/virtlib/lib0*}}
{{*chown xvm:xvm /export/virtlib/lib0*}}
# Execute the following command to share the directory through NFS:
{{*share -F nfs -o rw,root=_<domain name>_,anon=60 -d "Share 0" /directorypath/ofthe/share*}}
The share setup allows the xvm user on the NFS clients to have write privileges. It also allows the root user on the NFS client to have write access on the share. The special options allow to share the directory with write access, the root user in the domain, and specifies that the anonymous user will be seen on the clients as the user with uid 60 (xvm).
If you want the NFS shares to be accessible outside your domain, then execute the following {{share}} command. Use the {{rw}} option to give the optional domain list.
{{share -F nfs -o rw=_<domain name>_,anon=60 -d "Share 0" /directorypath/tothe/share}}
*Note --* Ensure that the domain name is added in the _/etc/nsswitch.conf_ file so that {{root=_<domain name>_}} is effective.
Always try to use DNS instead of Network Information Service (NIS). DNS maps the host names to the IP addresses. Change the host line to DNS in the _/etc/nsswitch.conf_ file.
After setting up a share on the NFS server, the NFS client has to be prepared to mount the share.
h2. To Set Up an NFS Client
Follow the procedure given below to set up an NFS client.
# As that of the NFS server, edit the _/etc/default/nfs_ file on the NFS client for the domain name.
# Verify that the xvm user has been created by the Sun xVM Server setup.
{{*grep xvm /etc/passwd*}}
The output should be:
{{xvm:x:60:60:xVM User:/:}}
# Verify the NFS share is visible on the client. An example of the mounted share is given below:
{{*showmount -e <server-name>*}}
{{export list for <server-name>:
/export/virtlib/lib0 (everyone)}}
When you create a library, the NFS share is automatically mounted on to the NFS client.
h2. Troubleshooting Library Creation
When a NFS-based library creation fails, check the mount directory and look for permissions for all the files in the directory. For example:
{code}
bash-3.00# cd /var/mnt/virtlibs/1238622271388
bash-3.00# ls -all
total 6
drwxrwxrwx 3 nobody nobody 512 Apr 1 12:53 .
drwxr-xr-x 5 root sys 512 Apr 1 15:50 ..
drwxr-xr-x 2 nobody nobody 512 Apr 1 10:51 blobs
{code}
If there is {{nobody}} in the permissions, the NFS configuration is incorrect. The permissions should be {{xvm}} for both the user and group. To resolve this error, follow the below steps:
# Open the {{nfs}} file at {{/etc/default/nfs}}.
# Locate the term NFSMAPID_DOMAIN.
# Edit NFSMAPID_DOMAIN=_<domain name>_.
# Restart the NFS client service.
{{svcadm disable svc:/network/nfs/client:default}}
{{svcadm enable svc:/network/nfs/client:default}}
# Check for the same settings in the NFS server. If the NFSMAPID_DOMAIN is not correctly configured, edit the {{nfs}} file.
# Restart the NFS server again.
h2. Troubleshooting Library Mounts
You can verify the NFS share mount by manually mounting the NFS share on the NFS client. Ensure that you unmount on the NFS client after verifying.
Whenever there is an issue on NFS share, check the following:
* Check the NFS setup on the Server.
* Check the NFS setup on the Client.
* Check the mount table on the client. For example, on Solaris, execute the following command:
{{*cat /etc/mnttab*}}
The output gives the mount point on the client for the NFS share. Check the mount point directory for the list of files for further investigation.
h2. Troubleshooting DNS and NIS Configuration
When you cannot access a storage library, one of the possible reason is that the NFS server name could not be resolved by the Sun xVM Servers. The NFS server host name is specified through the user interface. The user interface is hosted by the Enterprise Controller. If the Enterprise Controller is in a different DNS than the Sun xVM Servers, the storage libraries cannot be accessed.
If either the Enterprise Controller or the Sun xVM Servers are configured through the NIS, then the host name of the NFS server cannot be resolved by both of them. In such scenarios, follow the necessary steps:
* Provide a fully qualified domain name of the NFS server.
* Ping the NFS server from the Sun xVM Servers to check whether the host name can be resolved.
If some Sun xVM servers are not able to resolve the NFS server host name, it indicates that the name services are not configured properly on the Sun xVM Servers.
* Check the _/etc/nsswitch.conf_ file in the Enterprise Controller and the Sun xVM Servers whether they express the same order.
* If NIS is used, ensure that all the systems are on the same NIS.
* If DNS is used, ensure that the _/etc/resolv.conf_ file has the same search order in all the systems.
h2. Using Linux OS Enterprise Controller
When you use Solaris 10 OS in the Enterprise Controller, there will be no difference while creating a NFS-based library. If you have Linux OS on the Enterprise Controller, then no action is enabled on the library until a virtual pool is created. The size of the library is displayed as -2MB. The library is not mounted and it will be in the UNKNOWN state. The actual mounting of the NFS library takes place after a virtual pool is created. The mounting is done on the Sun xVM Servers attached to the virtual pool rather than the Enterprise Controller.
After the virtual pool creation, all the actions for the library are enabled and displays the size of the library correctly.
{excerpt}
----
{panel:borderStyle=none|titleBGColor=#BDBEC0|bgColor=#f5f5f5}
*Where to Go From Here*
See [Creating a Library] to create a library and [Associating or Disassociating Libraries] to associate libraries to virtual pools.
{panel}