Bug 1104035

Summary: OSError: [Errno 16] Device or resource busy: '/etc/sysconfig/network-scripts/ifcfg-eth0'
Product: [Retired] oVirt Reporter: Douglas Schilling Landgraf <dougsland>
Component: vdsmAssignee: Antoni Segura Puimedon <asegurap>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Pavlik <mpavlik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.5CC: asegurap, bazulay, bugs, danken, dougsland, fdeutsch, gklein, iheim, info, mgoldboi, mtayer, myakove, rbalakri, ybronhei, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: network
Fixed In Version: ovirt-3.5.0-beta2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:33:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1108571    
Attachments:
Description Flags
supervdsm.log none

Description Douglas Schilling Landgraf 2014-06-03 06:58:58 UTC
Description of problem:

In ovirt-node rmFile() cannot remove /etc/sysconfig/network-scripts/ifcfg-eth0. To remove a file in ovirt-node it must be unpersisted.

from supervdsm.log
======================

MainThread::DEBUG::2014-06-03 04:48:11,568::netconfpersistence::166::root::(_clearDisk) No existent config to clear.
MainThread::INFO::2014-06-03 04:48:11,568::netconfpersistence::182::root::(save) Saved new config RunningConfig({}, {})
to /var/run/vdsm/netconf/nets/ and /var/run/vdsm/netconf/bonds/
MainThread::DEBUG::2014-06-03 04:48:11,569::netconfpersistence::134::root::(_getConfigs) Non-existing config set.
MainThread::DEBUG::2014-06-03 04:48:11,571::utils::683::root::(execCmd) '/sbin/ifdown eth0' (cwd None)
MainThread::DEBUG::2014-06-03 04:48:11,636::utils::703::root::(execCmd) SUCCESS: <err> = ''; <rc> = 0
MainThread::ERROR::2014-06-03 04:48:11,637::utils::131::root::(rmFile) Removing file:
/etc/sysconfig/network-scripts/ifcfg-eth0 failed
Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/vdsm/utils.py", line 125, in rmFile
    os.unlink(fileToRemove)
OSError: [Errno 16] Device or resource busy: '/etc/sysconfig/network-scripts/ifcfg-eth0'
sourceRoute::DEBUG::2014-06-03 05:01:19,506::sourceroutethread::39::root::(process_IN_CLOSE_WRITE_filePath) Responding
to DHCP response in /var/run/vdsm/sourceRoutes/1401771679

Comment 1 Dan Kenigsberg 2014-06-07 22:11:45 UTC
Douglas, do you have more of that supervdsm.log available? I'd like to understand what during which process this bug has occurred - we shouldn't modify rmFile, but the function that called it.

Comment 2 Douglas Schilling Landgraf 2014-06-12 06:38:39 UTC
Created attachment 907956 [details]
supervdsm.log

Comment 3 Douglas Schilling Landgraf 2014-06-12 06:41:28 UTC
(In reply to Dan Kenigsberg from comment #1)
> Douglas, do you have more of that supervdsm.log available? I'd like to
> understand what during which process this bug has occurred - we shouldn't
> modify rmFile, but the function that called it.

Dan, please see the attachment.

Comment 4 Antoni Segura Puimedon 2014-06-12 12:35:08 UTC
I would rather make utils.py have:

def _rmFile_ovirt_node():
    """Checks if it is a persisted file and if so unpersists it"""

def _rmFile():
    """Removes a file"""

if <is ovirt node>:
    rmFile = _rmFile_ovirt_node
else:
    rmFile = _rmFile

Comment 5 Dan Kenigsberg 2014-06-16 08:51:41 UTC
(In reply to Antoni Segura Puimedon from comment #4)
> I would rather make utils.py have:

But most of the times that rmFile is called, the file is not persisted - even on the node. I think we should understand the failing flow, and unpersist the file specifically there, just like we do in vdsm/network/configurators/ifcfg's  _removeFile() (actually the implementation there could be improved).

Comment 6 Douglas Schilling Landgraf 2014-07-09 17:51:06 UTC
*** Bug 1115819 has been marked as a duplicate of this bug. ***

Comment 7 Martin Pavlik 2014-08-07 07:13:01 UTC
how to test this by using node connected to engine?

Comment 8 Douglas Schilling Landgraf 2014-08-07 09:29:55 UTC
Hi Martin,

(In reply to Martin Pavlik from comment #7)
> how to test this by using node connected to engine?

Try to register/approve host, if it gets UP, no issues.
I found this error during registration/approval, the host never the UP and in supervdsm.log I saw: 

"OSError: [Errno 16] Device or resource busy: '/etc/sysconfig/network-scripts/ifcfg-eth0'"

Please let me know if you need any additional info from my side.

Comment 9 Netbulae 2014-08-07 10:36:52 UTC
I saw it when using the admin interface on the node.

Try switching from dhcp to static ip and back again

Comment 10 Fabian Deutsch 2014-08-07 12:37:49 UTC
Toni, might this be related to your heroic persistence changes?

Comment 11 Antoni Segura Puimedon 2014-08-07 13:31:03 UTC
No. IIRC, this had to do with vdsm not calling unpersist. But it was fixed already.

Comment 12 Martin Pavlik 2014-08-08 08:48:27 UTC
verified oVirt Node Hypervisor release 3.1.0_master (20140805.0) (Edited, Unsigned)[root@localhost admin]#

Comment 13 Sandro Bonazzola 2014-10-17 12:33:30 UTC
oVirt 3.5 has been released and should include the fix for this issue.