rhevm-iso-uploader using the nfs method fails to upload the iso file in the ISO domain

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Virtualization 3

Issue

  • Upload fails with below error messages:
# rhevm-iso-uploader --nfs-server=test.test.example.com:/rhev/lab/iso upload /mnt/iso/open-source/linux/red-hat/rhev_beta/rhevh-6.2-20111010.2.iso

ERROR: /mnt/iso/open-source/linux/red-hat/rhev_beta/rhevh-6.2-20111010.2.iso exists on test.test.example.com.  Either remove it or supply the --force option to overwrite it.
  • Using the --force option is also not working, it throws below errors
# rhevm-iso-uploader --force --nfs-server=test.test.example.com:/rhev/lab/iso upload /mnt/iso/open-source/linux/red-hat/rhev_beta/rhevh-6.2-20111010.2.iso  
ERROR: Unable to copy /mnt/iso/open-source/linux/red-hat/rhev_beta/rhevh-6.2-20111010.2.iso to ISO storage domain on test.test.example.com:/rhev/lab/iso.
ERROR: Error message is "local variable 'id' referenced before assignment" <<
  • rhevm-iso-uploader throws the error message that iso already exits on ISO storage domain. But as per RHEV-Manager ISO is absent.

  • The option --iso-domain also does not work. Get the following verbose error on specifying the --verbose parameter:

# rhevm-iso-uploader --verbose --user=admin@internal --iso-domain=ISO upload test.iso
Please provide the REST API password for the admin@internal RHEV-M user (CTRL+D to abort): 
DEBUG: URL is https://rhevm.example.com:8443/api/storagedomains?search=name%3DISO
DEBUG: Returned XML is
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<storage_domains>
    <storage_domain id="1e804c54-068c-4dc2-89af-577b0660c910" href="/api/storagedomains/1e804c54-068c-4dc2-89af-577b0660c910">
        <name>ISO</name>
        <link rel="permissions" href="/api/storagedomains/1e804c54-068c-4dc2-89af-577b0660c910/permissions"/>
        <link rel="files" href="/api/storagedomains/1e804c54-068c-4dc2-89af-577b0660c910/files"/>
        <type>iso</type>
        <master>false</master>
        <storage>
            <type>nfs</type>
            <address>10.0.0.1</address>
            <path>/exports/iso</path>
        </storage>
        <available>0</available>
        <used>5368709120</used>
        <committed>0</committed>
        <storage_format>v1</storage_format>
    </storage_domain>
</storage_domains>

DEBUG: id=1e804c54-068c-4dc2-89af-577b0660c910 address=10.0.0.1 path=/exports/iso
DEBUG: local NFS mount point is /tmp/tmpR4jDu8
DEBUG: NFS mount command (/bin/mount -t nfs -o rw,sync,soft 10.0.0.1:/exports/iso /tmp/tmpR4jDu8)
DEBUG: /bin/mount -t nfs -o rw,sync,soft 10.0.0.1:/exports/iso /tmp/tmpR4jDu8
DEBUG: _cmds(['/bin/mount', '-t', 'nfs', '-o', 'rw,sync,soft', '10.0.0.1:/exports/iso', '/tmp/tmpR4jDu8'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()
ERROR: rhevh-6.2-20120423.1.iso exists on 10.0.0.1.  Either remove it or supply the --force option to overwrite it.
DEBUG: /bin/umount -t nfs -f  /tmp/tmpR4jDu8
DEBUG: /bin/umount -t nfs -f  /tmp/tmpR4jDu8
DEBUG: _cmds(['/bin/umount', '-t', 'nfs', '-f', '/tmp/tmpR4jDu8'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()

Resolution

  • As a possible workaround, try the following:
# rhevm-iso-uploader -u joe@a.example.com \
           --nfs-server=10.0.0.1:/virt/iso/a0b9ecf0-6bed-4a64-8d2f-85b7dea3ab31/images/11111111-1111-1111-1111-111111111111 \
           upload  test.iso
  • Specify the complete path to the ISO domain.

Root Cause

  • Only the NFS mountpoint is being specified.
  • This sees to be an error in the DOCS for Populating the ISO Domain
  • The Docs only specify the following steps:
ISO Storage Domain Options:
The options in this configuration group are used to specify the ISO domain to which files must be uploaded

1) -i, --iso-domain=ISODOMAIN
Sets the storage domain named ISODOMAIN as the destination for uploads.

2) -n, --nfs-server=NFSSERVER
Sets the NFS path NFSSERVER as the destination for uploads. This option is an alternative to --iso-domain, the two must not be used at the same time.

Diagnostic Steps

  • Check the directory permissions on the NFS mountpoint where you want to upload the ISO file.
  • Are the correctly set to user=vdsm,group=kvm; like below:
drwxr-xr-x.   3 vdsm kvm       4096 May 15 13:02 iso
  • Check if the ISO-Domain is ACTIVE.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments