FA: hardware utils uses wrong source when looking at device vendor

Bug #1487133 reported by Alexander Gordeev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Alexander Gordeev
6.1.x
Won't Fix
High
MOS Maintenance

Bug Description

Apparently fuel-nailgun-agent uses ohai to get information about vendor of block device.

https://github.com/chef/ohai/blob/master/lib/ohai/plugins/linux/block_device.rb

ohai relies on the values which will be reported by sysfs. It just reads /sys/block/<devicename>/device/vendor if this file entity exists.

fuel-nailgun-agent is using this 'vendor' value to accept block devices which are reported as 'removable' by sysfs from particular vendors.
https://github.com/stackforge/fuel-nailgun-agent/blob/master/agent#L359-L360

if fuel-nailgun-agent rejects block device, then nailgun won't be able to use it.

During provisioning fuel-agent has it own hardware utils which will try to find block devices on a node too.
https://github.com/stackforge/fuel-agent/blob/master/fuel_agent/utils/hardware.py#L297-L299
Bad thing, that the similar judging is done by looking at ID_VENDOR from udev property.

So if ID_VENDOR property and sysfs 'vendor' the same it's fine. They could differ, but i'm not sure.

BUT

Sometimes there's no ID_VENDOR udev property for device, but vendor from sysfs is still here.
player@agordeev:~$ cat /sys/block/sda/device/vendor
ATA
player@agordeev:~$ udevadm info --query property --name /dev/sda|grep -i vendor
ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=208

That situation will definitely lead to provisioning failure as fuel-agent won't be able to find block device as hardware.py will accidentally reject it from processing.

It affects block devices which reported as 'removable' but should be accepted by fuel. It's a regression.

Changed in fuel:
status: New → Confirmed
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-agent (master)

Fix proposed to branch: master
Review: https://review.openstack.org/215587

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-agent (master)

Reviewed: https://review.openstack.org/215587
Committed: https://git.openstack.org/cgit/stackforge/fuel-agent/commit/?id=4c2ab9d6c623d345086c6e2874d1df81fd96a942
Submitter: Jenkins
Branch: master

commit 4c2ab9d6c623d345086c6e2874d1df81fd96a942
Author: Alexander Gordeev <email address hidden>
Date: Fri Aug 21 14:40:08 2015 +0300

    Hardware utils must get 'vendor' from sysfs

    fuel-agent should use the same source for 'vendor' of block device
    as fuel-nailgun-agent uses.

    Otherwise, we could end up with situation when block device is being
    filtered out during provisioning due to 'vendor' mismatch.
    In that case, provisiong will fail.

    Change-Id: If503e13e259bb123d95312ee37ce661905ea185f
    Closes-Bug: #1487133

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

hello mos-sustaining team. I think that patch should be backported to 6.1-updates.

It's a regression and affects specific hardware (unfortunately we might not have all that kind of specific H/W to test committed fix)

Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

Unfortunately, this issue was not caught in the wild. So, there're no exact steps to reproduce it and verify the fact that the issue has been totally resolved by the fix.

The issue was that fuel-agent used different data source to obtain the vendor of block device.

Typical fail scenario should be like this one:
One particular device is marked as removable, then fuel-agent could skip it entirely if vendor name mismatches and this block device vendor doesn't included into REMOVABLE_VENDOR list.

So, in order to reproduce the issue:
1) you need specific h/w, which will report its block device as 'removable' in sysfs and which has different values for 'vendor' in sysfs and 'ID_VENDOR' from udev database.
2) ID_VENDOR shouldn't be in list 'Adaptec', 'IBM', 'ServeRA'
3) try to provision this node. Provisioning should fail due to this particular block device being filtered by fuel-agent.

But, the piece of code with the actual fix for #1487133 was removed in order to resolve https://bugs.launchpad.net/fuel/+bug/1486601

So, the issue was fixed. But the fix was superseded by another one.

Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

To observe ID_VENDOR you could use:
$ udevadm info --query=property --name=<blockdevname> | grep ID_VENDOR

to observer vendor from sysfs:
$ cat /sys/block/<blockdevname>/device/vendor

under <blockdevicename> just place block device name, eg.: sda

$ udevadm info --query=property --name=sda> | grep ID_VENDOR
$ cat /sys/block/sda/device/vendor

Revision history for this message
Nastya Urlapova (aurlapova) wrote :

Due agreement that if we don't have proper hardware we marked it as Fix Released with comment.

Changed in fuel:
status: Fix Committed → Fix Released
Revision history for this message
Alexey Stupnikov (astupnikov) wrote :

Not a critical/security issue. Closing as Won't Fix for 6.1-updates as MOS 6.1 is on limited support.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.