Bug 973616 - [TEXT] Change error description in engine.log “Cannot attach Virtual Machine Disk. Maximum PCI devices exceeded”
[TEXT] Change error description in engine.log “Cannot attach Virtual Machine...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.2.0
x86_64 Linux
unspecified Severity low
: ---
: 3.4.0
Assigned To: Michal Skrivanek
meital avital
virt
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-12 07:06 EDT by vvyazmin@redhat.com
Modified: 2015-09-22 09 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-28 02:29:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
## Logs rhevm (230.41 KB, application/x-gzip)
2013-06-12 07:06 EDT, vvyazmin@redhat.com
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 993260 None None None Never

  None (edit)
Description vvyazmin@redhat.com 2013-06-12 07:06:04 EDT
Created attachment 760092 [details]
## Logs rhevm

Description of problem: 
Change error description in engine.log “Cannot attach Virtual Machine Disk. Maximum PCI devices exceeded”


Version-Release number of selected component (if applicable):
RHEVM 3.2 - SF17.5 environment:

RHEVM: rhevm-3.2.0-11.30.el6ev.noarch
VDSM: vdsm-4.10.2-22.0.el6ev.x86_64
LIBVIRT: libvirt-0.10.2-18.el6_4.5.x86_64
QEMU & KVM: qemu-kvm-rhev-0.12.1.2-2.355.el6_4.5.x86_64
SANLOCK: sanlock-2.6-2.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create 50 disks with 'VirtIO' interface
2. Attached all disks to one VM
  
Actual results:
Get error : Operation Failed: [Cannot attach Virtual Machine Disk. Maximum PCI devices exceeded.]

Expected results:
Get error : Operation Failed: [Cannot attach Virtual Machine Disk. Maximum PCI devices exceeded. Maximum is 26 PCI or 3 IDE devices to one VM]

Impact on user:

Workaround:

Additional info:

/var/log/ovirt-engine/engine.log

2013-06-12 13:18:37,543 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-22) Operation Failed: [Cannot attach Virtual Machine Disk. Maximum PCI devices exceeded.]
2013-06-12 13:18:37,755 INFO  [org.ovirt.engine.core.bll.AttachDiskToVmCommand] (ajp-/127.0.0.1:8702-17) [7a57f146] Lock freed to object EngineLock [exclusiveLocks= key: 18937d45-1fa0-4603-a211-9a254e45f8e8 value: DISK
, sharedLocks= ]

/var/log/vdsm/vdsm.log


From investigation in code with Omer Frenkel we found folowing: 
// 26 PCI slots: 31 total minus 5 saved for qemu (Host Bridge, ISA Bridge,
    // IDE, Agent, ACPI)
    public final static int MAX_PCI_SLOTS = 26;
    // 3 IDE slots: 4 total minus 1 for CD
    public final static int MAX_IDE_SLOTS = 3;
Comment 1 Itamar Heim 2013-06-13 00:48:52 EDT
Get error : Operation Failed: [Cannot attach Virtual Machine Disk. Maximum PCI devices exceeded. Maximum is 26 PCI or 3 IDE devices to one VM]

i believe its 26 PCI and 3 IDE devices.
but how does customer knows what's a PCI device?
enabled smartcard? virtio-console, virtio-scsi has a controller when you first attach it, besides the disk (but then the disk doesn't need to be counted iirc), etc?
(i.e., not sure the MAX_PCI_SLOTS is actually up to date?)

flagging as storage to work with virt since the virtio-scsi is probably the most impact here.
Comment 4 Ayal Baron 2014-02-16 04:14:30 EST
(In reply to Itamar Heim from comment #1)
> Get error : Operation Failed: [Cannot attach Virtual Machine Disk. Maximum
> PCI devices exceeded. Maximum is 26 PCI or 3 IDE devices to one VM]
> 
> i believe its 26 PCI and 3 IDE devices.
> but how does customer knows what's a PCI device?
> enabled smartcard? virtio-console, virtio-scsi has a controller when you
> first attach it, besides the disk (but then the disk doesn't need to be
> counted iirc), etc?
> (i.e., not sure the MAX_PCI_SLOTS is actually up to date?)
> 
> flagging as storage to work with virt since the virtio-scsi is probably the
> most impact here.

I don't see what virtio-scsi has to do here.  It requires a single controller (i.e. single slot) and all disks are on it and don't affect PCI (we've tested with close to 1000 devices).
This same issue will happen if you attach many NICs or other devices.
This is a pure virt issue
Comment 5 Michal Skrivanek 2014-02-28 02:29:35 EST
The limit check has been updated during ppc development, it should be correct. Counts known devices..having a more specific message is probably too complex. Seems to me fine as it is

Note You need to log in before you can comment on or make changes to this bug.