Wednesday Jan 09, 2013

How to Treat an NFS File As a Block Storage Device

source

Wim actually beat me in blogging about this feature while I was on vacation, but I'd like to add a little more background about dm-nfs, which I gathered from our kernel developers:

What is dm-nfs?

The dm-nfs kernel module provides a device-mapper target that allows you to treat an NFS file as a block device. It provides loopback-style emulation of a block device using a regular file as backing storage. The backing file resides on a remote system and is accessed via the NFS protocol.

The general idea is to have a more-efficient-than-loop access to files on NFS. The device mapper module directly converts requests to the dm device into NFS RPC calls.

dm-nfs is used transparently by Oracle VM's Dom0 when mounting NFS-backed virtual disks. It essentially allows for asynchronous and direct I/O to an NFS-backed block device, which is a lot faster than normal NFS for virtual disks. The Xen block hotplug script has been modified on OVM to look for files which are on NFS filesystems. If the file is on NFS, OVM uses dm-nfs automatically, otherwise it falls back to using the regular (but slower) loop mount method.

The original dm-nfs module was written by Chuck Lever. It has been supported and used by Oracle VM since version 2.2 and is also included in the Unbreakable Enterprise Kernel for Oracle Linux.

Why this feature matters

This feature creates virtual disk devices (LUNs) where the data is stored in an NFS file instead of on local storage. Managed networked storage has many benefits over keeping virtual devices on a disk local to the physical host.

A sample use case is the fast migration of guest VMs for load balancing or if a physical host requires maintenance. This functionality is also possible using iSCSI LUNs, but the advantage of dm-nfs is that you can manage new virtual drives on a local host system, rather than requiring a storage administrator to initialize new LUNs on the storage subsystem. Host administrators can handle their own virtual disk provisioning.

For durability and performance, dm-nfs uses asynchronous and direct I/O so all I/O operations are performed efficiently and coherently. Guest disk data is not double cached on the underlying host. If the underlying host crashes, there's a lower probability of data corruption. If the guest is frozen, a clean backup can be taken of the virtual disk, as you can be certain that its data has been fully written out.

How to use it

You use dm-nfs by first loading the kernel module, then using dmsetup to create a device mapper device on your file. The syntax is very similar to the dm-linear module.

The following sample code demonstrates how to use dmsetup to create a mapped device (/dev/mapper/$dm_nfsdev) for the file $filename that is accessible on a mounted NFS file system:

nblks=`stat -c '%s' $filename`
echo -n "0 $nblks nfs $filename 0" | dmsetup create $dm_nfsdev

Now you can mount /dev/mapper/$dm_nfsdev like any other filesystem image.

- Lenz Grimmer (Oracle Linux Blog)

Website Newsletter Facebook Twitter

Thursday Dec 20, 2012

Top 10 Articles of 2012 Include Oracle Solaris, Linux, Virtualization

source

That's a 72 Norton Commando fashioned into a cafe racer. Heavy.com named a newer version the #1 bike in the 2012 New York International Motorcycle Show. (I didn't like Heavy.com's picture, so I found a better one from the blog listed as source, above.)

OTN also has an annual top 10. In that post by Bob Rhubart, from OTN's Architect community, six of the top ten technical articles were about technologies of interest to system admins and developers.

Boo-yah!

#2 - How Dell Migrated from SUSE Linux to Oracle Linux

by Jon Senger, Aik Zu Shyong, and Suzanne Zorn

In June of 2010, Dell made the decision to migrate 1,700 systems from SUSE Linux to Oracle Linux, while leaving the hardware and application layers unchanged. The people who worked on the migration describe how Dell planned and implemented the migration, including key conversion issues and an overview of their transition process.

#4 - Getting Started with Oracle Unbreakable Enterprise Kernel Release 2

by Lenz Grimmer

How to update your Oracle Linux systems to the latest version of the Unbreakable Enterprise Kernel. Switching is easy—applications and the operating system remain unchanged. There is no need to perform a full re-install; only the relevant RPM packages are replaced.

#6 - How to Use Oracle VM VirtualBox Templates

by Yuli Vasiliev

This article explains how to use Oracle VM VirtualBox Templates in Oracle VM VirtualBox. It is similar to the article that explains how to prepare an Oracle VM environment to use Oracle VM Templates, but it describes how to download, install, and configure the templates within Oracle VM VirtualBox, instead of on bare metal.

#7 - How to Update Oracle Solaris 11 Systems From Oracle Support Repositories

by Glynn Foster

You may already know that you don't have to worry about manually tracking and validating patch dependencies when you update a version of Oracle Solaris 11. This makes updates much easier. Glynn Foster demonstrates how easy it is to update the OS from a support repository, and how to make sure everything went well.

#8 - Tips for Hardening an Oracle Linux Server

by Lenz Grimmer and James Morris

General strategies for hardening an Oracle Linux server. Oracle Linux comes "secure by default," but the actions you take when deploying the server can increase or decrease its security. How to minimize active services, lock down network services, and many other tips.

#9 - How to Create a Local Yum Repository for Oracle Linux

by Jared Greenwald

How to create a local yum repository for Oracle Linux, and configure up2date and yum to install and update packages from the repositories.

More About OTN's Technical Articles

See all system admin- and systems developer-related technical articles published on OTN here.

Interested in publishing an article on OTN? Click here or join the conversation on the OTN Garage Facebook page.

- Rick

Website Newsletter Facebook Twitter
About

Contributors:
Rick Ramsey
Kemer Thomson
and members of the OTN community

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Blogs We Like