Bug 1506517

Summary: Can't run VM with sysprep - could not create floppy file
Product: [oVirt] vdsm Reporter: Petr Matyáš <pmatyas>
Component: CoreAssignee: Tomáš Golembiovský <tgolembi>
Status: CLOSED CURRENTRELEASE QA Contact: Israel Pinto <ipinto>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.20.4CC: bugs, ipinto, michal.skrivanek, pmatyas, tgolembi
Target Milestone: ovirt-4.2.0Keywords: AutomationBlocker, Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously when VDSM failed to remove sysprep floppy image this could prevent subesquent start of the same VM with sysprep floppy image. This is now fixed and the stale floppy image is removed before new image is created when starting the VM.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:21:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
vdsm log
none
payload img and supervdsm log none

Description Petr Matyáš 2017-10-26 09:28:03 UTC
Created attachment 1343616 [details]
vdsm log

Description of problem:
Cannot run VM with sysprep, because mkfs.fat could not create floppy file.

Version-Release number of selected component (if applicable):
vdsm-4.20.4-1.git08e939e.el7.centos.x86_64

How reproducible:
always

Steps to Reproduce:
1. run vm once with sysprep floppy
2.
3.

Actual results:
VM wont run

Expected results:
running VM with sysprep floppy

Additional info:
2017-10-26 12:13:35,186+0300 ERROR (vm/99dfd35e) [virt.vm] (vmId='99dfd35e-2e81-49d7-90d5-8d2056198e55') The vm start process failed (
vm:897)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 826, in _startUnderlyingVm
    self._run()
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2602, in _run
    self._devices = self._make_devices()
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2542, in _make_devices
    self._preparePathsForDrives(dev_spec_map[hwclass.DISK])
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 980, in _preparePathsForDrives
    drive['path'] = self.cif.prepareVolumePath(drive, self.id)
  File "/usr/lib/python2.7/site-packages/vdsm/clientIF.py", line 413, in prepareVolumePath
    vmId, device, params['vmPayload'])
  File "/usr/lib/python2.7/site-packages/vdsm/clientIF.py", line 457, in _prepareVolumePathFromPayload
    return func(vmId, payload['file'], payload.get('volId'))
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 53, in __call__
    return callMethod()
  File "/usr/lib/python2.7/site-packages/vdsm/supervdsm.py", line 51, in <lambda>
    **kwargs)
  File "<string>", line 2, in mkFloppyFs
  File "/usr/lib64/python2.7/multiprocessing/managers.py", line 773, in _callmethod
    raise convert_to_error(kind, result)
OSError: [Errno 5] could not create floppy file: code 1, out mkfs.fat 3.0.20 (12 Jun 2013)

err mkfs.msdos: unable to create /var/run/vdsm/payload/99dfd35e-2e81-49d7-90d5-8d2056198e55.5a4895245fd09f5bba77ad95411dd717.img

2017-10-26 12:13:35,186+0300 INFO  (vm/99dfd35e) [virt.vm] (vmId='99dfd35e-2e81-49d7-90d5-8d2056198e55') Changed state to Down: [Errno
 5] could not create floppy file: code 1, out mkfs.fat 3.0.20 (12 Jun 2013)

err mkfs.msdos: unable to create /var/run/vdsm/payload/99dfd35e-2e81-49d7-90d5-8d2056198e55.5a4895245fd09f5bba77ad95411dd717.img
 (code=1) (vm:1655)

Comment 1 Dan Kenigsberg 2017-10-26 10:31:15 UTC
supervdsm.log has the interesting bits. please include it.
please report the versions of any package mentioned in your traceback. in this time - mkfs.msdos.
Attaching the content of your temporary payload directory would be nice.

Comment 2 Petr Matyáš 2017-10-26 10:41:14 UTC
Created attachment 1343672 [details]
payload img and supervdsm log

util-linux-2.23.2-43.el7.x86_64
mkfs.fat 3.0.20 (12 Jun 2013)

Comment 3 Michal Skrivanek 2017-10-27 04:27:10 UTC
so the same file name is already there? please confirm, it's not clear whether you captured that before or after.

Comment 4 Petr Matyáš 2017-10-27 08:02:10 UTC
The image was copied after the run, it should be the new one according to timestamps.

Comment 5 Tomáš Golembiovský 2017-10-27 09:58:48 UTC
The problem is obvious. There is stale floppy image from previous run of the VM and mkfs.fat does not (by default) overwrite an existing image.

The more interesting question is how did it come to this. What happened to the VM so that the floppy image was not removed on shutdown? Unfortunately that we will never know because the old logs are missing.

Comment 6 Red Hat Bugzilla Rules Engine 2017-10-29 11:19:08 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 7 Tomas Jelinek 2017-10-30 15:41:02 UTC
*** Bug 1507550 has been marked as a duplicate of this bug. ***

Comment 8 Israel Pinto 2017-11-14 19:24:53 UTC
version: Software version:4.2.0-0.0.master.20171108151837.gita7de53e.el7.centos
Steps:
1. Seal windows VM
3. Create template
4. Create vm and start it with runonce

Results:
VM is running,
All the settings configure on VM.

Comment 9 Sandro Bonazzola 2017-12-20 11:21:18 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.