Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1143967

Summary: Rest-api's add disk logged with NONE variable,Adding Disk <UNKNOWN>
Product: Red Hat Enterprise Virtualization Manager Reporter: Ori Gofen <ogofen>
Component: ovirt-engineAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Raz Tamir <ratamir>
Severity: low Docs Contact:
Priority: low    
Version: 3.5.0CC: acanan, amureini, bazulay, ecohen, gklein, iheim, juan.hernandez, lpeer, lsurette, ogofen, oramraz, pstehlik, rbalakri, Rhev-m-bugs, scohen, yeylon
Target Milestone: ---Flags: scohen: Triaged+
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: org.ovirt.engine-root-3.5.0-21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
image_from_tasks_messages_tab
none
debug log + the script I have used none

Description Ori Gofen 2014-09-18 10:46:46 UTC
Created attachment 938833 [details]
image_from_tasks_messages_tab

Description of problem:
Adding disk from rest-api, py-sdk sends NONE variable to oVirt,the message in the TASKS tab is unclear (see image),"Adding Disk <UNKNOWN>".

Version-Release number of selected component (if applicable):
vt3.1

How reproducible:
100%

Steps to Reproduce:
1.add disk using py-sdk

Actual results:
operation is wrongly logged

Expected results:
adding disk,$DISK_NAME

Additional info:
UI operation are clear but I believe a comma is missing between disk and $DISK_NAME

Comment 1 Juan Hernández 2014-09-18 10:52:43 UTC
Can you attach to the bug the Python SDK script that you used to create the disk? Also, if possible, run that script with the debug=True option and attach the output as well.

Note that the output will contain your password in the "Authorization" header.

Comment 2 Allon Mureinik 2014-09-18 12:11:42 UTC
Juan, just to clarify - are you taking this, or should someone from my team take lead on this?

Comment 3 Juan Hernández 2014-09-18 12:26:39 UTC
I would like to check what the Python SDK is sending, then I can have a better understanding of what is happening. Once I have a better understanding I may redirect it to your team. I'm changing the whiteboard to "infra" to make that explicit, however I may change it back to "storage" later.

Comment 4 Allon Mureinik 2014-09-18 16:19:35 UTC
(In reply to Juan Hernández from comment #3)
> I would like to check what the Python SDK is sending, then I can have a
> better understanding of what is happening. Once I have a better
> understanding I may redirect it to your team. I'm changing the whiteboard to
> "infra" to make that explicit, however I may change it back to "storage"
> later.
Sure, no problem.
If you need any help from our side, just say so.

Thanks!

Comment 5 Ori Gofen 2014-09-23 08:29:43 UTC
Created attachment 940305 [details]
debug log + the script I have used

hope this help.

Comment 6 Juan Hernández 2014-09-23 11:13:54 UTC
What I see here is that the Python SDK script that you are using to create the disk is not setting the disk alias. As a result the backend will assign an alias automatically. But this name is assigned after the command is logged, so while it is being logged the alias doesn't have a value yet, thus it appears as <UNKNOWN>.

You can workaround this issue assigning the disk alias in your script, for example:

  b=params.Disk(alias=vm_str + "_disk", ...)

Note directly related to this, but I also see in your script that you are taking objects from the API and passing them as parameters to other calls. This isn't good practice. For example, you are taking the storage domain object like this:

  sd_iscsi=api.storagedomains.list()[0]

And then you are using it to create the disk like this:

  b=params.Disk(storage_domains=params.StorageDomains(storage_domain=[sd_iscsi]), ...)

That is ok, and works, but it also means that you are sending the complete definition of the storage domain, including the definition of its 30 logical units, to the server. All that data will just be ignored, and makes your request slower. Try to send only the identifier, for example:

  storagedomain_id = api.storagedomains.get("mydata").get_id()

  disk = params.Disk(
    storage_domains=params.StorageDomains(
      storage_domain=[
        params.StorageDomain(id=storagedomain_id)
      ]
    ),
    alias="mydisk",
    ...
  )
  vm.disks.add(disk)

Comment 7 Juan Hernández 2014-09-23 11:14:42 UTC
Just to be clear, if we want to fix this bug we need to assign the alias to the disk before logging the command.

Comment 8 Raz Tamir 2014-12-01 09:22:28 UTC
verified - vt12

Comment 9 Allon Mureinik 2015-02-16 19:13:07 UTC
RHEV-M 3.5.0 has been released, closing this bug.

Comment 10 Allon Mureinik 2015-02-16 19:13:09 UTC
RHEV-M 3.5.0 has been released, closing this bug.