Not able to upload iso file in shared NFS for iso in rhev-m

Latest response

Hi,

 

I have created the nfs share in RHEV-M server /root/nfs and below is the permission of the "nfs" folder;

 

drwxrwxrwx  3 vdsm kvm   4096 Jan  7 14:05 nfs

 

I have created the Shared-ISO while instaling RHEV-M

 

[root@rhev-m ~]# rhevm-iso-uploader list
Please provide the REST API password for RHEV-M (CTRL+D to abort):
ISO Storage Domain Name   | Datacenter                | ISO Domain Status
Shared-ISO                | Default                   | active
[root@rhev-m ~]# rhevm-iso-uploader list
Please provide the REST API password for RHEV-M (CTRL+D to abort):
ISO Storage Domain Name   | Datacenter                | ISO Domain Status
Shared-ISO                | Default                   | active
[root@rhev-m ~]# rhevm-iso-uploader list
Please provide the REST API password for RHEV-M (CTRL+D to abort):
ISO Storage Domain Name   | Datacenter                | ISO Domain Status
Shared-ISO                           | Default                     | active
 

I am getting below error message while uploading the image 

 

 

[root@rhev-m ~]# rhevm-iso-uploader upload -i Shared-ISO /mnt/hgfs/ALL\ OS\ Image/WinXP/WinXP.iso
Please provide the REST API password for RHEV-M (CTRL+D to abort):
ERROR: mount.nfs: access denied by server while mounting rhev-m.srinfotec.com:/root/nfs/
 
[root@rhev-m ~]#
[root@rhev-m ~]# rhevm-iso-uploader upload -i Shared-ISO /mnt/hgfs/ALL\ OS\ Image/WinXP/WinXP.iso
Please provide the REST API password for RHEV-M (CTRL+D to abort):
ERROR: mount.nfs: access denied by server while mounting rhev-m.srinfotec.com:/root/nfs/
 
 
 
 
 
 

Responses

First, from a security perspective I generally do not recommend exporting any part of the root user's home directory via NFS.  You would do much better to create a directory under /mnt, /data, or somwhere else on the root filesystem and export it.

 

Second, the fact that you have elected to use the root user's home directory as the NFS export is the reason that you're getting access denied.  When the NFS client attempts to mount the export it cannot CWD into /root because /root has 550 permissions.  There are various ways to fix this but they all involve making root's home dir less secure.  So, I highly recommend you select another directory for your export.

 

 

 

Thanks for the support, 

 

But While instaltion of rhev-m i have already mensioned this path (/root/nfs), How i can give the diffrent path so that i can upload the iso file through "rhevm-iso-uploader"

 

You'll have to create an NFS export on the RHEV Manager server, with permissions for user vdsm:kvm manually and then add it through the RHEV Manager GUI as a new ISO share.

 

Do you know how to do that or do you need some instruction on how to create an NFS share? You can look at /etc/exports to see how the current share was exported, just do the same for the new path.

hi,

 

Could you please tell me the process to create the nfs mount point so that i can attach as a ISO

now i have already created the nfs folder under root (/nfs) and below is the export file details

 

[root@rhev-m /]# vi /etc/exports
/nfs            0.0.0.0/0.0.0.0(rw)     #rhev installer
/root/nfs       0.0.0.0/0.0.0.0(rw)     #rhev installer
/root/nfs/      0.0.0.0/0.0.0.0(rw)     #rhev installer
 

and

 

drwxr-xr-x    2 vdsm kvm   4096 Jan  9 14:55 nfsshare

As I stated earlier, exporting root's home directory (i.e. /root/nfs) is a bad idea.  I would  delete those two lines if I were you.

 

Second, I'm not exactly sure what you're trying to point out with the directory listing of "nfsshare".  This directory is not listed in your "exports" file.

 

Here is what I recommend...

0. chown 36:36 /nfs; chmod 770 /nfs

1. Delete the two /root/nfs lines from exports

2. Restart NFS to pick up these changes.

3. Go into RHEV-M and as an ISO domain for the /nfs export.  When RHEV-M asks you for the address of the NFS export your answer should look something like this...

<ip address of rhev-m here>:/nfs

4. At this point, RHEV-M will *initialize* the ISO domain in the "/nfs" directory. 

5. After 4 completes (should be very quick), run the iso uploader to upload your ISO into this newly created domain.

As root on the server that will be exporting the share do this...

 

1. mkdir -p /<some dirname here>/<isodomain name here>

2. chmod 755 /<some dirname here>

3. chmod 750 /<some dirname here>/<isodomain name here>

4. chown -r 36:36 /<some dirname here>/<isodomain name here>

5. vim /etc/exports append this...

  /<some dirname here>/<isodomain name here>                 *(rw,sync,all_squash)

6. /etc/init.d/nfs restart