Creating a KVM storage pool on a NFS

Hi,

I am trying to create a storage pool on a NFS location. In this case, for testing, my personal directory on the server. I can’t seem to get this working so I have two questions. First of all some information;

Host OS: OpenSUSE 12.3
KVM: 1.3.0-3.3.2
Server: Debian with Samba shares

When I go to the Connection Details of localhost and then the Storage tab I press the big + to add an storage pool. Then I give a name and as Type I choose netfs
Then I leave the target path default, this should be the local mount point as I understand it. Format, I leave that to auto but changing it to nfs doesn’t help.
In the Hostname box I enter the dns name or the IP adres of the server.
Source Path would be the share name plus directories: /home/username/kvm

When I press finish I get no error, it just adds it. But when I click the storage pool it provides me with information of the drive that hosts the mount point (/ ). When I create a new Volume the volumes will be created in the mount point, but in the /home/username/kvm directory. Also, when I go to the mount point in a bash shell I see no link. It is just a normal directory.

So question one would be: What am I doing wrong here?
And question two: What about the authentication for that server? It never asks me for a username and password. When I provide it with the host name, like you can with the smb://username:password@host command it still doesn’t work.

No experience in this specific kind of case, but what does “mount” give?

mount doesn’t mention this mount/mount point at all.

I’m just trying to reason with linux logic and use common sense, but lack actual experience, so it feels a bit like shooting in the dark. But, in the past I’ve seen something like this where NFS was involved.

But, shouldn’t it be something like this:

  • On the server side: export the share, f.e. /home/username/some_folder
  • On “localhost” in the storage pool the IPaddress of the server, it’s hostname, /home/username/some_folder as the share, /home/username/kvm as the mountpoint
  • then when changing directory to /home/username/kvm and doing an ls, one should see the content of the some_folder on the server side?

What happens if you export the same NFS share, but change the mountpoint of the storage pool to some folder outside /home, i.e. /mnt ?

Doesn’t work. Not with the KVM manager that is. Manually sure. But that’s not wanted.

Mmm, sorry, this seems to be out of my league, and I cannot simulate the situation.

Thanks so far! :slight_smile:

It probably can’t be done.

As I understand it, NFS is oriented toward file sharing rather than device sharing. In effect your question becomes one of creating KVM storage out of one or more files.

But it’s a given option in KVM and the documentation states the possibility.

Hello,
Although I haven’t done this, as Knurpht suggests this should be designed without any trouble (that I can foresee).

First,
Need to understand how you’re implementing your NFS mount on your client machine (what commands, methods, steps taken). Particularly important is <when> your mount is created, eg during bootup, during login, etc.

Then, I’d be curious <how> you’re able to access the mount point’s contents, eg from console, from a Desktop File Manager, from a web browser, etc.

And <then>, as you’ve described I think you’re not using KVM by itself, you seem to be using the libvirt vm managger… Can you <browse> to your mount point?

HTH,
TSU

Hi tsu2,

Sorry for the late reply :slight_smile:

It was my first meeting with KVM. I have seen all these manuals on the internet where they make it sound real easy and normal to use NFS. But I guess it’s more show then really using it.

I now made a KVM server, with local Storage Pools. I made a share of the folder representing the Storage Pool so we can now easily copy .img files to and from that machine. So basically I found an other and perhaps better work process.

Thanks for thinking with me!

Oh and I believe it’s called Qemu now? Or KVM/Qemu. I understand the product now, just not the name :wink:

When you install the KVM packages, you can install the KVM SUSE documentation package so you have a local version if you wish, otherwise you can access on the web. IMO is one of the best resources to be found anywhere
https://doc.opensuse.org/documentation/html/openSUSE/opensuse-kvm/

It’s my impression that KVM has been moving towards QEMU, and today “mostly” integrates with QEMU technology, but QEMU itself is still completely separate. KVM-QEMU implements paravirtualization which can provide greatly enhanced hardware acceleration, but because paravirtualization doesn’t support full emulation, you don’t have the extreme versatility.

So, in other words, if you’re running an x86/x64 Guest, then KVM-QEMU should be your choice, but if you’re doing something that’s not supported natively by your hardware, then take a look at QEMU.

TSU