12.3. Adding Storage to the Environment
12.3.1. Adding NFS Storage
12.3.1.1. Preparing NFS Storage
Summary
These steps must be taken to prepare an NFS file share on a server running Red Hat Enterprise Linux 6 for use with Red Hat Enterprise Virtualization.
Procedure 12.1. Preparing NFS Storage
Install nfs-utils
NFS functionality is provided by the nfs-utils package. Before file shares can be created, check that the package is installed by querying the RPM database for the system:$
rpm -qi nfs-utilsIf the nfs-utils package is installed then the package information will be displayed. If no output is displayed then the package is not currently installed. Install it usingyumwhile logged in as therootuser:#
yum install nfs-utilsConfigure Boot Scripts
To ensure that NFS shares are always available when the system is operational both thenfsandrpcbindservices must start at boot time. Use thechkconfigcommand while logged in asrootto modify the boot scripts.#
chkconfig --add rpcbind#chkconfig --add nfs#chkconfig rpcbind on#chkconfig nfs onOnce the boot script configuration has been done, start the services for the first time.#
service rpcbind start#service nfs startCreate Directory
Create the directory you wish to share using NFS.#
mkdir /exports/isoReplace /exports/iso with the name, and path of the directory you wish to use.Export Directory
To be accessible over the network using NFS the directory must be exported. NFS exports are controlled using the/etc/exportsconfiguration file. Each export path appears on a separate line followed by a tab character and any additional NFS options. Exports to be attached to the Red Hat Enterprise Virtualization Manager must have the read, and write, options set.To grant read, and write access to/exports/isousing NFS for example you add the following line to the/etc/exportsfile./exports/iso *(rw)
Again, replace /exports/iso with the name, and path of the directory you wish to use.Reload NFS Configuration
For the changes to the/etc/exportsfile to take effect the service must be told to reload the configuration. To force the service to reload the configuration run the following command asroot:#
service nfs reloadSet Permissions
The NFS export directory must be configured for read write access and must be owned by vdsm:kvm. If these users do not exist on your external NFS server use the following command, assuming that/exports/isois the directory to be used as an NFS share.#
chown -R 36:36 /exports/isoThe permissions on the directory must be set to allow read and write access to both the owner and the group. The owner should also have execute access to the directory. The permissions are set using thechmodcommand. The following command arguments set the required permissions on the/exports/isodirectory.#
chmod 0755 /exports/iso
Result
The NFS file share has been created, and is ready to be attached by the Red Hat Enterprise Virtualization Manager.
12.3.1.2. Attaching NFS Storage
Prerequisites:
Summary
An NFS type Storage Domain is a mounted NFS share that is attached to a data center. It is used to provide storage for virtualized guest images and ISO boot media. Once NFS storage has been exported it must be attached to the Red Hat Enterprise Virtualization Manager using the Administration Portal.
NFS data domains can be added to NFS data centers. You can add NFS, ISO, and export storage domains to data centers of any type.
Procedure 12.2. Attaching NFS Storage
- Click the resource tab to list the existing storage domains.
- Click to open the New Domain window.
- Enter the Name of the storage domain.
- Select the Data Center, Domain Function / Storage Type, and Use Host from the drop-down menus.If applicable, select the Format from the drop-down menu.
- Enter the Export Path to be used for the storage domain.The export path should be in the format of
192.168.0.10:/data or domain.example.com:/data - Click to enable further configurable settings. It is recommended that the values of these parameters not be modified.
Important
All communication to the storage domain is from the selected host and not directly from the Red Hat Enterprise Virtualization Manager. At least one active host must be attached to the chosen Data Center before the storage is configured. - Click OK to create the storage domain and close the window.
Result
The new NFS data domain is displayed on the Storage tab with a status of Locked while the disk prepares. It is automatically attached to the data center upon completion.
