Bug 1404389 - [RFE] Need ability to refresh direct's LUN size if it was added without a HOST parameter (or if the underlying storage was extended)
Summary: [RFE] Need ability to refresh direct's LUN size if it was added without a HOS...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.0.6.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-4.2.0
: 4.2.0
Assignee: Idan Shaby
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On: 1275649
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-13 17:42 UTC by Raz Tamir
Modified: 2019-04-28 13:30 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
The engine can update a direct LUN's missing or outdated information.
Clone Of:
: 1405770 (view as bug list)
Environment:
Last Closed: 2017-12-20 10:50:49 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.2+
gklein: testing_plan_complete-
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)
engine and vdsm logs (614.76 KB, application/x-gzip)
2016-12-13 17:42 UTC, Raz Tamir
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 74380 0 master ABANDONED backend: getDeviceList for both storage types 2020-05-20 03:45:55 UTC
oVirt gerrit 74381 0 master MERGED backend: introduce SyncStorageDomainsLunsCommand 2020-05-20 03:45:55 UTC
oVirt gerrit 77101 0 master MERGED backend: introduce SyncAttachedDirectLunsCommand 2020-05-20 03:45:56 UTC
oVirt gerrit 78199 0 master MERGED Add ability to synchronize a direct lun 2020-05-20 03:45:55 UTC
oVirt gerrit 78201 0 master MERGED core: add ability to sync a direct lun via the REST-API 2020-05-20 03:45:56 UTC
oVirt gerrit 78773 0 master MERGED restapi: Update to model 4.2.13 and metamodel 1.2.7 2020-05-20 03:45:56 UTC
oVirt gerrit 82162 0 master MERGED Update to model 4.2.19 2020-05-20 03:45:57 UTC
oVirt gerrit 82184 0 master MERGED Update to model 4.2.19 2020-05-20 03:45:57 UTC
oVirt gerrit 82303 0 master MERGED Update to model 4.2.19 2020-05-20 03:45:58 UTC

Description Raz Tamir 2016-12-13 17:42:19 UTC
Created attachment 1231294 [details]
engine and vdsm logs

Description of problem:
When adding a 50 GB direct lun to the system via REST API, it shows it's size is < 1 GB.
The POST body to /api/disks is:
<disk>
    <alias>direct_lun_test</alias>
    <lun_storage>
        <logical_units>
            <logical_unit id="LUN_ID">
                <address>ISCSI_SERVER_IP</address>
                <port>3260</port>
                <target>LUN_TARGET</target>
            </logical_unit>
        </logical_units>
        <type>iscsi</type>
    </lun_storage>
</disk>



Version-Release number of selected component (if applicable):
4.1.0-0.2.master.20161212071212.git8a015dd.el7.centos

How reproducible:
Add direct

Steps to Reproduce:
1. Send POST request to /api/disks with body:
<disk>
    <alias>direct_lun_test</alias>
    <lun_storage>
        <logical_units>
            <logical_unit id="LUN_ID">
                <address>ISCSI_SERVER_IP</address>
                <port>3260</port>
                <target>LUN_TARGET</target>
            </logical_unit>
        </logical_units>
        <type>iscsi</type>
    </lun_storage>
</disk>
2. Check the disk's size
3.

Actual results:


Expected results:


Additional info:

Comment 1 Allon Mureinik 2016-12-13 22:52:11 UTC
Without a host parameter, this just adds a LUN to the database. It should be refreshed when you try to use it.

Can you please try with the host element and check if it gets the size registered?

Comment 2 Raz Tamir 2016-12-13 23:39:54 UTC
Allon,
When adding the host it does show the correct LUN size.
When adding it without the host attribute and attach it to VM, the size isn't refreshed and the VM see it's real size (# lsblk)

Comment 3 Allon Mureinik 2016-12-15 13:56:53 UTC
OK, I think there are two issues here:

(In reply to Raz Tamir from comment #2)
> Allon,
> When adding the host it does show the correct LUN size.
Good news.
As I noted in comment 1, when a <host> element is not provided, this is just a DB operation, and no details from the LUN itself are saved to the DB.
This is the intended behavior, although I agree this is not necessarily intuitive, and should be documented better. 
Juan - I guess that DisksService#Add is the right place to document it?

> When adding it without the host attribute and attach it to VM, the size
> isn't refreshed and the VM see it's real size (# lsblk)
After going over the code again, this indeed is not the behavior. We need some way to refresh the LUNs details, which, AFAIK, we don't have.
I think we should open a new bug (RFE?) on this, and prioritize it with PM.

Comment 4 Idan Shaby 2016-12-15 14:05:33 UTC
This seems to be like a dup of bug 1275649 which I solved more than a year ago.

Regarding a scenario where you add a direct lun without a host - Allon I think we talked about it a while ago and I raised the idea that we can call GetDeviceList with a random host in the vm's dc when we attach the direct lun to that vm.

If we agree on the idea, this should indeed be a new RFE, IMHO.

Comment 5 Juan Hernández 2016-12-15 15:02:51 UTC
(In reply to Allon Mureinik from comment #3)
> Juan - I guess that DisksService#Add is the right place to document it?

Yes, that is the right place.

Comment 6 Allon Mureinik 2016-12-18 09:43:28 UTC
(In reply to Idan Shaby from comment #4)
> This seems to be like a dup of bug 1275649 which I solved more than a year
> ago.
Seems so, yes, but let's keep this BZ for future work described in comment 3.

> 
> Regarding a scenario where you add a direct lun without a host - Allon I
> think we talked about it a while ago and I raised the idea that we can call
> GetDeviceList with a random host in the vm's dc when we attach the direct
> lun to that vm.
> 
> If we agree on the idea, this should indeed be a new RFE, IMHO.
Not sure if attaching is the right event to trigger this (need PM input here).
But as this was always the behavior, and I don't see any critical flow blocked by NOT having this new capability, I agree we should treat this as an RFE.
Raz/Yaniv - if you disagree, please weigh in here.

Comment 7 Raz Tamir 2017-07-27 10:47:32 UTC
Verified on ovirt-engine- 4.2.0-0.0.master.20170725202023.git561151b.el7.centos

Added new direct lun with:

<disk>
    <alias>direct_lun_test</alias>
    <lun_storage>
        <logical_units>
            <logical_unit id="LUN_ID">
                <address>ISCSI_SERVER_IP</address>
                <port>3260</port>
                <target>LUN_TARGET</target>
            </logical_unit>
        </logical_units>
        <type>iscsi</type>
    </lun_storage>
</disk>

The disk was added and its size is < 1 GB.

Executed POST to /api/disks/<DISK_ID>/refreshlun

<action>
  <host>
    <name>host_mixed_1</name>
  </host>
</action>

LUN refreshed and its actual size is now displayed

Comment 8 Sandro Bonazzola 2017-12-20 10:50:49 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.


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