← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1280306] Re: check if export is already mounted before mounting it (LibvirtNFSVolumeDriver)

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1280306

Title:
  check if export is already mounted before mounting it
  (LibvirtNFSVolumeDriver)

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  At the moment there is no check in _mount_nfs if the export is already
  mounted. It will be tried to mount the export and if the export is
  already mounted an exception is thrown following in a WARNING message
  that the export is already mounted. This pollutes the logs with
  useless WARNING messages and if there is a real exception (for example
  the NFS export is not reachable) we only have a WARNING in the logs.

      def _mount_nfs(self, mount_path, nfs_share, options=None, ensure=False):
          """Mount nfs export to mount path."""
          utils.execute('mkdir', '-p', mount_path)

          # Construct the NFS mount command.
          nfs_cmd = ['mount', '-t', 'nfs']
          if CONF.libvirt.nfs_mount_options is not None:
              nfs_cmd.extend(['-o', CONF.libvirt.nfs_mount_options])
          if options is not None:
              nfs_cmd.extend(options.split(' '))
          nfs_cmd.extend([nfs_share, mount_path])

          try:
              utils.execute(*nfs_cmd, run_as_root=True)
          except processutils.ProcessExecutionError as exc:
              if ensure and 'already mounted' in exc.message:
                  LOG.warn(_("%s is already mounted"), nfs_share)
              else:
                  raise

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1280306/+subscriptions


References